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

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




PostPosted: Wed Apr 21, 2004 11:06 am   Post subject: Walls For a Snake program

Hey this is my basics so far for a snake program i made.
could someone help me with what the wall code would look like.
Thanks

btw i was hoping the walls would be random like how they are on this snake game.

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



INTROGAME.T
 Description:

Download
 Filename:  INTROGAME.T
 Filesize:  3.28 KB
 Downloaded:  266 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Wed Apr 21, 2004 12:26 pm   Post subject: (No subject)

well the easyest way to do this whould be to uses whatdot color constion dection.

witch u can find out more about here:

http://www.compsci.ca/v2/viewtopic.php?t=2381

that idea whould be to draw random walls and obsticals that are not the same color as the backgorund or sank and then chech the color of the pixels on or close to the snake. if they are not the background color or the snake color then the snake has hit somting.


this could also be done with out whatdotcolor, you could keep track of all the pxiels in an array of boolean where true means the snake can not go there and false means it can. then u whould have to check this agested the curent postion of the sanke. this could also be used in a way to make rnadom walls by making an array witch has randomly amounts of pixels add to the top of the col and the end of it.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
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: