Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Work in progress Snake: The Dark Descent
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#13
RE: Snake: The Dark Descent

The animation is simply an infinitely loop; a function which calls itself on a timer. The timer's duration is a global variable so I can change it with power ups and such, or simply to debug by watching it slowly.

Since the grid consists of 800 units, it's not very efficient to use a for loop or to try and track which grid units should be lit/unlit and other data. The data structure would be huge...I tried that approach but I ended up with an 800 member array, and each member was an array of 7 or 8 variables (direction, lit/unlit, and some more variables I can't think of off the top of my head). Instead, I just activate the grid light which is the snake's head position, and create a timer whose duration increases as the snake's length increases, which in turn deactivates the grid light. It's really quite a simple approach, and makes checking for the snake's head-to-body collisions fairly simple.

11-03-2011, 08:15 AM
Find


Messages In This Thread
Snake: The Dark Descent - by palistov - 11-01-2011, 08:50 AM
RE: Snake: The Dark Descent - by Gamemakingdude - 11-01-2011, 08:57 AM
RE: Snake: The Dark Descent - by palistov - 11-01-2011, 09:08 AM
RE: Snake: The Dark Descent - by flamez3 - 11-01-2011, 09:32 AM
RE: Snake: The Dark Descent - by palistov - 11-01-2011, 09:55 AM
RE: Snake: The Dark Descent - by Gamemakingdude - 11-01-2011, 10:26 AM
RE: Snake: The Dark Descent - by palistov - 11-01-2011, 07:27 PM
RE: Snake: The Dark Descent - by palistov - 11-02-2011, 11:44 PM
RE: Snake: The Dark Descent - by Kman - 11-03-2011, 12:50 AM
RE: Snake: The Dark Descent - by Your Computer - 11-03-2011, 02:06 AM
RE: Snake: The Dark Descent - by flamez3 - 11-03-2011, 06:17 AM
RE: Snake: The Dark Descent - by Brute - 11-03-2011, 07:28 AM
RE: Snake: The Dark Descent - by palistov - 11-03-2011, 08:15 AM
RE: Snake: The Dark Descent - by RawkBandMan - 11-07-2011, 03:28 AM
RE: Snake: The Dark Descent - by palistov - 11-07-2011, 08:18 AM
RE: Snake: The Dark Descent - by Juby - 11-07-2011, 02:02 PM
RE: Snake: The Dark Descent - by palistov - 11-07-2011, 07:01 PM
RE: Snake: The Dark Descent - by Arvuti - 11-07-2011, 07:05 PM
RE: Snake: The Dark Descent - by Tanshaydar - 11-07-2011, 08:26 PM
RE: Snake: The Dark Descent - by RawkBandMan - 01-16-2012, 02:11 AM
RE: Snake: The Dark Descent - by palistov - 01-16-2012, 04:18 AM
RE: Snake: The Dark Descent - by Danny Boy - 01-16-2012, 11:45 PM
RE: Snake: The Dark Descent - by Mine Turtle - 01-19-2012, 08:45 AM
RE: Snake: The Dark Descent - by palistov - 01-19-2012, 09:18 AM



Users browsing this thread: 1 Guest(s)