Share your repls and programming experiences

← Back to all posts
[GAME] Snake game, but the food refuses to be eaten
ernestoyaquello (40)

Another twist on this classic. In this one, the food runs away from the snake's head to make it harder to score points.

It is written in HTML + JS, and it adapts to different screen sizes, although it is designed to be played on a computer. It can be played with the buttons, with the arrow keys or with the WASD keys - if the keys don't work when you start playing, click on the canvas to make them work.

This is just a small experiment developed quickly, so please let me know if you encounter any errors!

Comments
hotnewtop
WilliamCantrell (4)

Swiggity swears, I'm coming for that square

Muffinlavania (1526)

@WilliamCantrell Hippity hoppity, your square is my property

OldWizard209 (1538)

Wow, the styling is great and the food is annoying,
but overall the game is amazing.

ernestoyaquello (40)

@OldWizard209 I am glad to hear you found the food annoying, that was the point haha. Thanks!

OldWizard209 (1538)

It is just like an annoying younger brother, who takes advanatage of age, steals your stuff and never gives it back. This game is trying to put it in snake perspective. @ernestoyaquello

BTW, this is so underrated. sigh

Whippingdot (658)

wut! I am a younger brother and my brother never gets in trouble. I always get in trouble. @OldWizard209

svensk007 (58)

hippety hoppity this apple's life is now my property

iocoder (162)

@ernestoyaquello
first try:

wow! that was hard tho! good game! breathes heavily

countchrisdo (0)

Super awesome snake game

ANDREWVOSS (187)

Great game, the best I could get is 12 lol

Writerfrighter (25)

This game is triggering and addicting at the same time XD

Muffinlavania (1526)

Other than the square downloading hacks, very cool style and its very smooth wow

Bunnytoes (157)

I got the fruit a bunch(get it)

NoahRoopull (19)

This is so polished and well done, Nice!

PyCoder01 (56)

Wow! This is actually fun compared to original snake.

FlaminHotValdez (694)

make the food as fast as you

ernestoyaquello (40)

@FlaminHotValdez But then it would be impossible to catch it! If you want to try it, go to the line 84 of the JS file (js/huntersnake.js) and replace this:

} else if ((moveNumber % 2) == 0 && calculateDistanceToSnakeHead(food.x, food.y) < 5) {

With this:

} else if (calculateDistanceToSnakeHead(food.x, food.y) < 5) {