Page 1 of 1

Snake

Posted: Sun May 27, 2012 10:38 pm
by Nixola
I support Canvases.
I'm happy 'cause of that.
I'm so happy I just wrote a 2 player snake game that uses canvases.
WASD move the blue snake, ↑←↓→ move the green snake.
Tomorrow I'll write a version without canvases,
If the happiness doesn't make me forget it.

EDIT: added something, read the next post for more infos

Re: Snake

Posted: Mon May 28, 2012 8:27 pm
by Nixola
Small update:
Added menu
Added options (Snake1 RGB, Snake2 RGB, speed, wether to display a (horrible) snake face)
Removed possibility to turn back quickly and move into yourself, losing
I surely changed something else, but I don't remember what.
Any suggestion? Should I add something else? What, in case?
EDIT: Now it saves settings when you quit and reads them when you run it

Re: Snake

Posted: Wed May 30, 2012 12:09 am
by kesac
I created a head-on-head collision between the snakes and the game got a little confused as who won:
Y2TGW.png
Y2TGW.png (15.72 KiB) Viewed 547 times

Re: Snake

Posted: Wed May 30, 2012 8:07 pm
by Nixola
Thanks, fixed it. Also added optional tail transparence, rewrote the menu (now it uses my gui) and added a proper pause (press ESC while playing, you can change everything but snake's color during pause)

Re: Snake

Posted: Thu May 31, 2012 3:25 pm
by tomriddle
Thanks Nixola, great example. Simple code. I'm thinking about making my own version of Snake where you're not constricted to a grid, where you can turn left and right in a fluid motion, almost like controlling a car. Maybe theres a thing or two I can learn from it.
kesac wrote:I created a head-on-head collision between the snakes and the game got a little confused as who won:
Haha, hilarious. As a web developer I know that there'll always be something that happens in the live environment that you could never have accounted for. So many possibilities of what could do wrong. Always having clients discover quirks and bugs by trying to do

Re: Snake

Posted: Mon Jun 04, 2012 10:22 am
by Hampton Bay
its great, smooth
reminds me of the good one on the nokia's

all i see today are bad/laggy/non responsive

Re: Snake

Posted: Mon Jun 04, 2012 9:48 pm
by Nixola
@Hampton: You didn't see Snayke then!
@Everyone: do you have any suggestion, bugfix, feature, something?
[OT]Anyway, why didn't I see these last two posts as unread?[/OT]