Battle snake - Testers wanted

Started by
9 comments, last by Ne_cro 16 years, 11 months ago
Some time ago I wrote a &#106avascript version of Snake, unfortunatly the original thread is retired. I recently added a cpu controlled snake, in an attempt to make it somewhat more interesting and to prevent the inevitable zig-zagging. I read the GD Article on using Genetic Programming to controll a cpu snake, wich was interesting to read but not much use for creating an interesting opponent. My Cpu snake only reaches a length of around 50-120 on it's own (in a 20 x 20 grid) but hopefully it makes for an interesting opponent. :) I have only tested it with IE and FF. Please let me know if you use another browser. Play Battle snake! Ideas, suggestions and opinions much apriciated! [Edited by - Kirl on May 16, 2007 5:55:10 PM]
Advertisement
That's cool, and a fun twist - I enjoyed it. ^_^

Perhaps for the next step you could make the snakes thinner and food items smaller, and with it the map bigger (which would mean that the total screen space needn't change). You could also consider creating wall obstacles within the area for the player and CPU snakes to avoid.

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

nice. this &#106avascript snake reminds me on this solo snake clone :

jsfbgl snake demo
So long,Mr.E
Cool, you don't see many games developed in &#106avascript.<br><br>On my third go, the CPU snake did not appear. I have no idea how to replicate the bug.
Try, try and fucking try again.
Thanks for the positive comments!


@ Thaumaturge
Thanks for the suggestions, there is a limmit to the cell size because it is actually html table, some browsers may go all mimsy... I'll give it a try though, thanks.


@ Mr E
I saw you stumbled upon the same idea I had when I discovered I could change bg color on the fly. I like your white noise example! :)

The snake game is waaaay too fast for me though... (and I've had quite some snake practice already)


@ Talib
That's right, when I got the idea of using tables cells as pixels I couldn't resist trying though.

It all started as a joke & coding practice, but now I think JS defenatly has some atractive qualities for simple skill games, compatibilty being a big one (I can play these games on Pc, Wii, Psp and almost any www capable machine).

I also made this Tetris version using the same aproach. :)


No clue about the bug...



- There really should be walls, without walls the player needs a huge snake to try to kill the opponent. If you hate walls, large objects in the middle could work.

- The dots should give more length.

- You could try making the front squares fade in and the back ones fade out, to make the movement smoother.

[Edited by - Zanshibumi on May 18, 2007 6:36:08 AM]
There was a slight syntax error, I think it fixed the dissappearing snake...


Thanks for your suggestions Zanshibumi!

- You can kill the cpu snake with a minimum length of 4. :)
I added the opponent snake to create a dynamic sort of wall.

- I don't like to increase the growing speed, I can decrease the size of the playField, but I'm not sure. Why do you think the apple should give more length?

- Fading in and out is a good idea, I may give it a try, but it may require quite a bit more cpu power.


Did anybody test it on browsers other then IE or FF?
Quote:Original post by Kirl
- You can kill the cpu snake with a minimum length of 4. :)
I added the opponent snake to create a dynamic sort of wall.

I think it's more interesting as a "kill the other snake" game where the apples are just a way of growing long enough to kill it.

Quote:Original post by Kirl
- I don't like to increase the growing speed, I can decrease the size of the playField, but I'm not sure. Why do you think the apple should give more length?

I prefer simple games to be shorter and quickly make the player play again. If they are long, most players will only play once and go.
I now know what causes the dissappearing snake, this will be fixed soon...


Quote:Original post by Zanshibumi
I prefer simple games to be shorter and quickly make the player play again. If they are long, most players will only play once and go.
I agree, you're right. You now grow two squares when eating an apple, let me know if you feel it's still too slow. I'm also working on schooling the AI, but that will probably take slightly longer. :)



Do you think your speed should increase when eating an apple? (it currently is, but not noticably) This will give you a slight advantage at first, but it will eventually become a dissadvantage...
Quote:Original post by Kirl
Do you think your speed should increase when eating an apple? (it currently is, but not noticably) This will give you a slight advantage at first, but it will eventually become a dissadvantage...

Let the speed increase but only to a manageable limit.

Also, you could add a button that removes size (and speed) from you and the opponent. That way, you let the player decide how much speed he's able to manage and how much size he needs to kill the opponent snake.

[Edited by - Zanshibumi on May 20, 2007 4:12:43 PM]

This topic is closed to new replies.

Advertisement