A classic Snake game implementation written in Go and Ebitengine, featuring sound effects, particle systems, and progressive difficulty.
Mostly created as a good way to play with Golang and to add another Ebitengine example
Majority of the work in a weekend after discovering ebitengine
I am strong believer in monkey see, monkey do
This is a modern take on the classic Snake game where players control a snake that grows longer as it consumes food.
- Use arrow keys to control the snake's direction
- Guide the snake to eat the food items that appear on the screen
- Avoid hitting the walls or the snake's own body
- Press p to pause the game and resume it at any time
- Press m to toggle sound effects on and off
- Press Spacebar to fire snake tongue
- When gameover, press Spacebar to restart
- UI buttons for new game, mute and pause
- The snake grows longer each time it eats food (caps at 40 segments)
- Eat the food to gain 2 points, or use tongue to do it more quickly for 1 points
- The game speed increases with each food item eaten, making it progressively more challenging
- Food items may randomly disappear, adding an extra challenge
- Game ends if the snake collides with walls or itself
- Smooth snake movement
- Visual particle effects
- Sound effects for:
- Food collection
- Game over events
- Progressive difficulty (snake speeds up as it eats)
- Random food disappearance mechanics
- Ensure you have Go installed on your system
- Clone the repository
- Run the following commands:
go mod tidy
go run .
Set env vars
GOARCH=wasm GOOS=js go build -o main.wasm
Creates a main.wasm
file, copy to web server along with index.html
and wasm_exec.js
Note, your web server should support correct mime type for wasm i.e. 'application/wasm', or it won't load