Computer Science Canada Snake game - How can i make the snake grow? |
Author: | nivlack [ Fri Jun 05, 2009 7:11 pm ] | ||
Post subject: | Snake game - How can i make the snake grow? | ||
Hi I'm relatively new here, and like many other people, I have an ISU due in about a week. Im making a snake game, but my only problem is I JUST CANT MAKE MY SNAKE GROW. Here is my code so far...
From searching through the forum, someone said I should use an array to do it, but i've read the tutorial on how use arrays, but I still have no clue what to do ![]() Forgive me if my coding seems very primitive, and please help me asap cuz i dont wanna fail ![]() |
Author: | Kharybdis [ Fri Jun 05, 2009 9:00 pm ] |
Post subject: | RE:Snake game - How can i make the snake grow? |
well, you should have either a linked list or an array. i'm assuming you'll be using an array. well, everytime you get whatever it is your snake is getting, assign the next part of your array (your array starts at 1) to be "filled" with a picture/ w/e that represents part of your snake. You have to set an array of predetermined size, say 100 for the maximum size of the snake. |
Author: | Siavash [ Fri Jun 05, 2009 10:10 pm ] |
Post subject: | RE:Snake game - How can i make the snake grow? |
actually you could just use a flexible array. var mycoolarray:flexible array 1..0 |
Author: | tjmoore1993 [ Fri Jun 05, 2009 11:15 pm ] | ||
Post subject: | Re: RE:Snake game - How can i make the snake grow? | ||
Flexible arrays are very useful in your situation. |
Author: | nivlack [ Sat Jun 06, 2009 7:49 am ] |
Post subject: | RE:Snake game - How can i make the snake grow? |
thanks for the fast replies guys! ok, I guess my weekend task is to learn how to put flexible arrays into my game. |