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

Username:   Password: 
 RegisterRegister   
 'snake' help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Chaos_Theory




PostPosted: Wed Apr 20, 2005 11:17 pm   Post subject: 'snake' help

okay... new problem

when I touch teh mouse, Im suppsoed to grow bigger, I know how to get my guy to grow bigger... but how do I get it so that when my 'head' tuns, the other sections dont all turn right away?

hope sombody knows what I'm talking about
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Thu Apr 21, 2005 1:23 am   Post subject: (No subject)

Am I understanding correctly when I assume 'mouse' is like a dot or whatever the snake eats? OK.

I strongly suggest going to the ''tutorials" section and doing a search on collision detection. You will probably be using whatdotcolour or Math.Distance.
Cervantes




PostPosted: Thu Apr 21, 2005 7:06 am   Post subject: (No subject)

Not even. Snake works on a grid system. So determining whether the snake is over top of the mouse is as simple as checking if the snake.x = the mouse.x and the snake.y = the mouse.y. It's also as complex as checking if the snake.x + the snake.dir = the mouse.x and the snake.y + the snake.dir = the mouse.y.
Chaos_Theory




PostPosted: Thu Apr 21, 2005 11:58 am   Post subject: (No subject)

Cervantes wrote:
Not even. Snake works on a grid system. So determining whether the snake is over top of the mouse is as simple as checking if the snake.x = the mouse.x and the snake.y = the mouse.y. It's also as complex as checking if the snake.x + the snake.dir = the mouse.x and the snake.y + the snake.dir = the mouse.y.


I did that...and it's not working...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: