
Set up a go ebiten project in vs code, initialize go.mod, fetch ebiten v2, and implement a minimal game with update, draw, and layout to launch an empty window.
Create the player sprite by loading assets/player.png from an embedded assets file system, using must load image to decode PNG for the Everton game engine.
Create a dedicated player object in a new file to manage the player sprite with a new player factory, plus a draw method and an update routine.
Move the player forward by tracking an x and y position as a vector, normalizing movement, and updating velocity with acceleration and rotation, while appearing at the opposite edge.
Implement screen wrap for the player in a Go game by defining screen width and height, adding a keep-on-screen routine, and centering the player at spawn.
Set up a scene manager to transition between title, game, and game over scenes with fade effects, and implement Ebiten's game interface (update, draw, layout) in main.go.
Set up meteor objects with center-directed spawns, randomized angles and velocities, and rotation, using sprites from assets; include a factory for big meteors and four small meteors.
Draw multiple meteors on the title screen by storing them in a map, initializing the meteors in update, and drawing each meteor in the title scene's draw loop.
Add the resolve package to enable collision detection in the project, pinning to version 0.8 to stabilize the API and update go.mod.
Enable player lasers: press spacebar to fire, load a laser sprite, and implement a laser object that moves with rotation and collides with meteors, updated and drawn each frame.
Add backward movement with the down arrow, reverse velocity using rotation, spawn exhaust in front, and manage reverse state and engine sound.
Load an explosion.ogg asset and create an explosion audio player, then play the sound when shooting big or small meteors and when the player dies.
Add levels, display a level transition and restart the game with increased difficulty, implement a game over scene with lives, score, and persistent high scores via a scene manager.
Load the shield sprite, shield indicator, and shield sound. Create a shield with position and rotation, update it to follow the player, and draw it in Ebiten.
Display and update the shield in the game scene, activate with the S key, and manage a six second shield timer, including deactivation and removal when the timer ends.
Load shield indicator assets and define a shield indicator type with draw and update. Store indicators in a shield indicators slice, like life indicators, and render them.
In this hands-on course, you will learn how to create a classic 2D space shooter game, Asteroids, using the powerful and lightweight Ebitengine library in Go. Whether you’re a beginner to game development or looking to expand your skills in a new language and framework, this course will guide you through the entire process of building your own version of this iconic arcade game.
Ebitengine's easy to learn and use API allows you to develop 2D games quickly and easily. Games can be deployed across multiple platforms, including Windows, Mac, Linux, FreeBSD, the Web, iOS and Android. You can even deploy your game to Steam!
Go is fast, and so is Ebitengine. While Ebitengine's drawing API is very simple, games developed in it run very quickly with GPU power.
In this course, we'll learn how to:
Introduction to Ebitengine: Get familiar with the basics of how to set up Go and use Ebitengine for 2D game development.
Game Design Fundamentals: Understand core game mechanics like player movement, object collisions, game states, and rendering.
Creating the Game World: Learn how to design the asteroid field, ship controls, and space physics—like rotation, thrust, and inertia.
Rendering and Animation: Master how to draw and animate your ship, asteroids, bullets, and explosions using Ebitengine’s powerful drawing functions.
Game Logic: Implement the game loop, scoring system, levels, and spawn mechanics for asteroids. Learn how to create enemies and manage the player’s health.
Sound and Music: Add sound effects for shooting, explosions, and background music to enhance the player's experience.
Building a Playable Game: Integrate everything to create a fully functional, interactive game that runs in the browser or on desktop platforms.
By the end of this course, you will have developed your own playable Asteroids clone, gaining the knowledge and confidence to create more complex 2D games in Go. Whether you want to add new features or make your own game from scratch, this course will equip you with the foundational skills needed for game development in Go using Ebitengine.
Prerequisites:
A basic knowledge of the Go programming language.
Tools Used:
Go
Ebitengine (a 2D game engine for Go)
Visual Studio Code (or your favourite IDE)
Take your first step into the world of game development with Go!