An open API service indexing awesome lists of open source software.

https://github.com/deckarep/cosmicinvaders

Future home for the re-creation of Cosmic Invaders originally in C++/Allegro, now in Zig/Raylib.
https://github.com/deckarep/cosmicinvaders

allegro raylib zig ziglang

Last synced: 4 months ago
JSON representation

Future home for the re-creation of Cosmic Invaders originally in C++/Allegro, now in Zig/Raylib.

Awesome Lists containing this project

README

        

# Cosmic Invaders



These assets come from an old Allegro ~4.2 game and are in zlib compressed format. Two types of bitmap files
exist: `.mz` and `.sz` files. The `.mz` variant are just simple bitmap graphics usually containing no animation
frame data and are just meant to largely convey RGB24 static images, such as a game background.

The `.sz` variant is meant to utilize Allegro's `sub_bitmap` feature and treats the asset as having multiple
frames of data as an RGB24 animated/multi-frame set of images.

The good news is, both file types can be treated as a single bitmap at least for the purpose of viewing the
files and properly extracting them.

So far, this code will also knock out the two key colors that this particular collection of assets use.

In order to process these files `zlib` must be used to properly deal with the fact that they are compressed.
The way these assets were figured out is by reverse engineering the original game asset using Binary Ninja.

To decompress and generate the `.png` equivalent assets just do: `zig build run` or for zigup users:
`zigup run master build run`

# Note and License

The original game was **not** built by me and was created circa 2006. If you are adept at coding and can
figure out how I extracted the assets then you'll have access to the original game assets! If not, don't ask.

Aside from the game assets, this version is a **fully clean-room, developed implementation** of how I think
the code behaves from observation of the original game. My version of this game, written in Zig is
protected by the `AGPL-3.0` license. Additionally, while I intend to create a close working clone, I will
not be so strict on details and am mostly concerned with capturing the spirit of the original game. I might
even diverge or change some aspects of the game such as the graphics, enemies, sound, music, etc.

# Original

- [ ] Original game runs at: 320x240, this game should as well but default to 640x480 and then
magically scale up/down based on user doing some resizing of the window.
All pixel-art must remain sharp.
- [ ] On start game, player starts with 550 money, 25 health points
- [ ] Weapons:
- [ ] Lazer Canon Turret = 140 - simply fires projectile up
- [ ] Missle Battery = 350 - fires a heat seeking, exploding missle
- [ ] Spark Tower = 550 - emits a catastrophic spark of electricity
- [ ] On game over, show GAME OVER banner, WAVES DEFEATED:
- [x] Max of 12 invaders per row
- [ ] Every level, a new set of invaders spawns in a symmetrical formation
- [ ] Upon hit of weapon station, screen shake
- [ ] Upon weapon station blowing up, longer screen shake
- [ ] On game over screen, everything is rendered in monochrome greyscale except banner
- [x] Hit on invader makes it flash white, invader now becomes red
- [x] Between waves, all player's buildings remain
- [x] On building hit, show a single dust cloud
- [x] On building collapse:
- [x] Show a timed release of 3 to 5 fiery explosions
- [x] Station becomes dead (removed) from scene
- [ ] End with exploding sharapenel that bounces a few times on ground
- [ ] When alien bullet hits weapon station, show a single smoke plume (just one).
- [x] When building is below X percent, show repeated smoke plumes.
- [ ] Buildings cannot overlap on user placement, if overlapped render as red and don't allow placing it
- [ ] When an invader is hit, his framerate speeds up temporarily to illustrate injury (faster pulsating)
- [ ] Each new building costs more than the last (verify)
- [ ] BOSS FIGHT: Every 5 levels (confirm this), a boss shows up drops red balls, green bubble with
red eye. Invaders will fly in circular motion around it, protecting it
- [ ] Additional settings (from original game) and factors can be found here: `data/strings.txt`