/zig-invaders

Space Invaders implementation in zig

Primary LanguageZig

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.

Running the game

zig build run

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

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