O'Reilly logo

Practical GameMaker Projects: Build Games with GameMaker Studio 2 by Ben Tyers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

3. Snake

Ben Tyers1 
(1)
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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required