© Ben Tyers 2018
Ben TyersPractical GameMaker Projectshttps://doi.org/10.1007/978-1-4842-3745-8_3

3. Snake

Ben Tyers1 
Worthing, West Sussex, UK

In this chapter, you will make a basic Snake game. Doing so will introduce you to using sounds and music as well as some important programming fundamentals such as enums and sprite manipulation. It will also build upon and reinforce what you learned in Chapters 1 and 2.

The aim of this game is to eat as much food as possible, without hitting the red blocks or any part of your tail.

Create a new GML project and name it Snake.

This game uses just five sprites. You can load them in now. The origin of all sprites is middle center. They are
  • spr_head

  • spr_block

  • spr_trial

  • spr_food

  • spr_bg

This game also uses ...

Get Practical GameMaker Projects: Build Games with GameMaker Studio 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.