Snake
Classic Snake in Defold
Build the classic Snake game with grid-based movement, food spawning, body growth and game-over states. Master Lua tables and state management!
Build the classic Snake game with grid-based movement, food spawning, body growth and game-over states. Master Lua tables and state management!
Each step adds one feature. Write the code, watch it come alive in the canvas, then make it your own.
Keep the Defold cheatsheet handy
Components, game objects and messages in one place - use it beside this workshop.
local pos = go.get_position()function update(self, dt)go.set_position(pos)if self.moving_right then pos.x = pos.x + self.speed * dtendBuild it in the browser first
Try this project step by step right here: write the code, watch it run, then download it and keep building in your engine.