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

Username:   Password: 
 RegisterRegister   
 Snake Game project
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bigr




PostPosted: Thu Apr 15, 2004 8:50 am   Post subject: Snake Game project

i talked to my teacher about doing this snake game in turing.

http://www.addictinggames.com/worm.html

i notice that on all the tutorials and already posted "snake help" topics, every game is the one where u get food and u get longer. how would i make the code so that the walls are random (but no too hard) and the snake moves up when the left mouse button is clicked and falls down when the left click isn't down. would this involve using a grid like idea for the other snake games.
this is also my first year programming in computer science so bare with me.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Apr 15, 2004 8:57 am   Post subject: (No subject)

zylum has a nice snake game writen...

anyways, for walls you just use random
code:

myGrid(Rand.Int(1,width),Rand.Int(1,height)) := "wall"

where myGrid is your 2D array for the playfield.

as for mouse controls
code:

var x,y,b:int
loop
Mouse.Where(x,y,b)
if b then
  put "mouse down"
else
  put "mouse up"
end if
end loop
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: