This is a toy project to learn how to make a simple emulator in rust. I first used gtk to run the graphic interface, then tried piston, and finally took a shot at webassembly. So there are currently 3 implementations of the game (2 native and one in the browser). Every implementation is based on intel-8080-emu which is a library I extracted from this project.
There are 4 crates :
- space-invaders-core : common code for space invaders specific emulation and asset embedding.
- gtk-space-invaders : a space invaders implementation using gtk-rs
- piston-space-invaders : a space invaders implementation using piston libraries
- wasm-space-invaders : a space invaders implementaion using the webassembly target of rust and a simple canvas in js (try it!).
gtk-space-invaders needs the gtk-rs requirements
(sudo apt install libgtk-3-dev on a debian base distribution, brew install gtk+3 on osx)
wasm-space-invaders needs wasm-pack and npm.
I added
space-invaders-core/resources/invaders.rombut the emulator keep showing the random stuff.
The compiler automatically embed invaders.rom if it exists but you might need to run cargo clean
to force a recompilation if you compiled first with dummy.rom.