Skip to content

stefanpartheym/zig-invaders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zig-invaders

My implementation of Space Invaders in zig using raylib and an ECS.

Screenshot

I'm working on this game as part of The 20 Games Challange. Space Invaders is Challange #3.

Goals

  • Create a player ship that moves side to side.
  • Create a few different types of alien invaders.
    • Enemies will move together in a grid. They cross the screen horizontally before dropping vertically and reversing their direction.
  • Add the ability for the player ship to fire rockets that travel up the screen.
  • Add bombs/bullets that the enemies drop. The player’s rockets can destroy enemy bullets.
  • Make sure that the player’s bullets will destroy invaders, and the invader bullets will destroy the player.
  • Add a mothership that will cross the screen periodically. Destroying it will result in bonus points.
  • Add a UI that tracks the player score and lives left. The player starts with three lives.

Playing the web version of the game

Head over to itch.io to play the game in your browser.

Running the game

zig build run

Building for the web

zig build -Dtarget=wasm32-emscripten

Controls

Key Description
H, Arrow Left Move left
L, Arrow Right Move right
Space Shoot
Enter Start/pause/resume
F1 Toggle debug mode
F2 Toggle sounds/music
Q, Escape Quit game

Assets

List of all assets used in this game:

File Source/Author
assets/soundtrack.wav stefanpartheym in Ardour with OB-Xd
assets/explosion.wav stefanpartheym in Ardour with Surge XT
assets/explosion-short.wav stefanpartheym in Ardour with Surge XT
assets/impact.wav stefanpartheym in Ardour with Surge XT
assets/win.wav stefanpartheym in Ardour with Surge XT
assets/loose.wav stefanpartheym in Ardour with Surge XT
assets/gameover.wav stefanpartheym in Ardour with Surge XT
assets/player.png stefanpartheym in GIMP
assets/invaders.png Alfalfamire on OpenGameArt.org
assets/explosion.png Sogomn on OpenGameArt.org

About

Space Invaders implementation in zig

Resources

Stars

Watchers

Forks

Packages

No packages published