Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Object Rotation
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Master




PostPosted: Thu May 06, 2004 3:09 pm   Post subject: Object Rotation

Does anyone know how to rotate a rectangle or an object that looks like a rectangle that can be rotate.

Ex. the (up) key is to move up, but if you rotate the object 180degrees, the (up) keys moves downward

PLEASEEEEEEE HELP[/b][/i]
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu May 06, 2004 4:50 pm   Post subject: (No subject)

eh... just use the angle to move in that direction Thinking
code:

x = cos(angle) * distance;
y = sin(angle) * distance;

locationX = locationX + x;
locationY = locationY + y;
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: