4 Directions

Talk about making games.

4 Directions

Postby Joshua Worth » Sat Apr 15, 2006 1:23 am

I can find the direction between 2 points, but how would I turn that into 4 directions. eg. 0 - up, 1 - right, 2 - down, 3 - left.

Ill tell you what I am going to use it for after I get an answer... :D
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby makslane » Sat Apr 15, 2006 6:36 pm

Use the returned angle in the direction function:

45 - 135: up
135 - 225: left
225 - 315: down
315 - 45: right
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest