Ask your own question, for FREE!
Mathematics 16 Online
OpenStudy (anonymous):

Well, I need a function that makes a tetr shape rotate over its center

OpenStudy (angela210793):

where do u get these???????????????? O.o

OpenStudy (anonymous):

just trying to program a tetr and i need this function ^^

OpenStudy (anonymous):

it should rotate when u pick right or left arrow keys,

OpenStudy (anonymous):

i think that i should make an rectangle and then put the shape into of it and shapes and rectangels x and y should be same. then i should make the rectangle turn over its square

OpenStudy (anonymous):

and i think that i can allot this rectangle to rectangles to make the collapsion test and to make this shape really rotate :)

OpenStudy (anonymous):

WELL HERE ITS THE THINg i think

OpenStudy (anonymous):

just look at the thing i am thinkining on it i mean rotate.jpg

OpenStudy (amistre64):

well, rotation of an image is tricky; but you can cheat by having an image of it in each position and then flipping thru the images

OpenStudy (amistre64):

like a movie screen

OpenStudy (amistre64):

if (keypress == rotateleft) {imageN = imageN+1}

OpenStudy (anonymous):

aha!

OpenStudy (anonymous):

but whats N means?

OpenStudy (amistre64):

N just means whatever number it is; you get the next image i the sequence

OpenStudy (anonymous):

hmm i don2T got it sarry :(

OpenStudy (amistre64):

image1 = up; image2 = left; image3 = down ; image4 = right display image3 when rotate left; display image2 when rotate left; display image1 when rotate 3 times to the right; display image2, then image3, then image4

OpenStudy (anonymous):

ahh now i got it

OpenStudy (anonymous):

so images change splaces with eacht other kk

OpenStudy (anonymous):

its a CHEAT!! :(

OpenStudy (amistre64):

if you are moving sections of defined areas; then have an array built up if area locators

OpenStudy (amistre64):

its an effect lol

OpenStudy (anonymous):

yea :D xd

OpenStudy (anonymous):

but its the easier way of it but without this trick how can we rotate this?

OpenStudy (amistre64):

similar method to the cannon rotating; converting polar coordinates into cartesians

OpenStudy (amistre64):

but unless you have the computational power to keep track of all the points in an array, it gets messy

OpenStudy (anonymous):

but the center of the shape is orign this time ye?

OpenStudy (amistre64):

yes

OpenStudy (anonymous):

kk

OpenStudy (anonymous):

thank you and i have to leave now bb

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!