CONTROLS:

  • ARROW or WASD : Moves snake
  • SHIFT : Makes the Snake Sprint
  • Collecting apples while still holding one in your stomach adds extra points
  • Snake segments with an apple in them are collide-able from the sides.

FORWARD:

As an exercise in game development I often make very small games. A lot of times I use a new engine so I can stretch my brain cells. This time I chose Godot. I might write my thoughts about Godot in a future devlog. After watching a platformer tutorial online, I created 'an iteration on snake' in under an hour. The majority of the time was wrapping my head around some of the way Godot is different (good and bad) from GameMaker.

So what is different about 'an iteration on snake' and why did I call it an iteration? The first game I make in ANY game development engine is snake. Why? I've found that snake is one of the best ways to learn some of the key pieces in any game development software (at least 2D). It teaches movement, timers, collisions, 'talking' between objects, array/lists/structs, file saving/loading (save systems), among other basics things. It is an iteration on MY snake games (and the classic snake game as well) I've made through the year. There are a few key differences I've added.

The first change I made is in the snakes movement. Snake games always start the snake at one speed and keeps that speed through out the game. It is key for the player to keep timing to make sharp turns. I've add a SPRINT button. This will allow the player to speed up the snake and slow it back down to normal speed. This also will increase the length of the snake (as the player moves).

You might ask why would you want to speed up the snake and make it longer!? Wouldn't that just make the game harder? No one would use that! Good question, I am glad you are asking that because a good game designer doesn't add things all willy-nilly. I added a speed mechanic AFTER I implemented the score multiplier. As the snake moves around the room and picks up the 'apple' it stores the apple in closest segment. As the snake moves the 'apple' moves from segment to segment until it reaches the end and disappears. [If you've programmed a snake game before you'll know that this isn't really how you program it, this is just what it seems like the player] If a player eats another 'apple' while the snake is still 'digesting' one it adds extra point(s) to the score depending on the number of 'apples' it has in it's belly. This gives the player then incentive to eat the apples quickly while keeping the snake as long as possible to keep the 'apples' in the belly and thus RISK the use of sprinting.

The last change (and possibly most controversial to the gremlins that live in my brain) I made was to make the segments that are holding the apples to be collide-able from the sides. Normally you can make very sharp turns and move right next to your body. Now though the apple-belly adds a bit of a challenge and obstacle.

The game could use smoother key movements (made worse by this being a browser game) and I think the apples can spawn under the snake body parts. Again this is the first game I made in Godot and HTML5 so be nice :) . It isn't super polished, for example I don't know why the graphics are crunchy looking (I could not find any AA settings). Also I am not sure how to get High Score to save to the computer. I am guess it would be a cookie or something but I can't find any documentation to do that (if any Godot experts could help me I'll update it).

The source code is posted if anyone is interested.

Download

Download NowName your own price

Click download now to get access to the following files:

an_iteration_on_snake_source.zip 330 kB

Development log

Leave a comment

Log in with itch.io to leave a comment.