[game] sliding snake

51 views
Skip to first unread message

Symbroson Development

unread,
Feb 26, 2017, 6:20:14 PM2/26/17
to DroidScript
Regarding Michaels topic I made a simple snake game with sliding effect. It uses the js Date() object to calculate the passed time and the steps between 2 tiles
Snake.spk

Michael Seymour

unread,
Feb 27, 2017, 2:14:05 AM2/27/17
to DroidScript
Sliding looks very neat and polished compared to stepping! Considering I only use the 1/w and 1/h values for drawing to the canvas (the grid[][] array contains the contents of the grid and used as a reference for collisions and drawing), I could step it down even further and draw smaller steps so it looks like it's sliding, but the game logic still works in "pixel" steps. Thanks for the ideas!

Symbroson Development

unread,
Feb 28, 2017, 8:10:17 AM2/28/17
to DroidScript
Hi. I replaced the image canvas by an glview and I use a sprite sheet for the sprites. Now my problem is that I cant rotate the head tile using glv.ctx.rotate( radient_angle ) - for some reason it wasn't drawn any more if I uncomment this line. Anyone has an Idea why this happens?
Thanks for help
Regards
Snake.spk
Reply all
Reply to author
Forward
0 new messages