daneelsan / spacewasm

Original 1962 game code running on a PDP-1 emulator in Zig + Wasm + JS + HTML5 Canvas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spacewasm

Original 1962 game code running on a PDP-1 emulator in Zig + Wasm + JS + HTML5 Canvas

See it live at: https://daneelsan.github.io/spacewasm/

spacewasm

"a", "d", "s", "w" to control the first spaceship, the "Needle".

"j", "l", "k", "i" to control the second spaceship, the "Wedge".

The controls are spin one way, spin the other, thrust, and fire.

Keep away from the central star that pulls the ships with gravity.

The game ends when any of the ships explode into pixel dust.

Build

To build the .wasm file (and put it in the appropriate place), run:

$ zig build && cp zig-out/bin/space.wasm docs/space.wasm

$ ls docs/*.wasm
docs/space.wasm
$ zig version
0.12.0-dev.2341+92211135f

TODO

[ ] Fix a bug that occurs when a ship crashes with the central star and launches it in an erratic pattern

[ ] Implement a fully featured Type 30 CRT display (phosphor decay, intensity levels, etc.)

[ ] Improve the "game loop" by using requestAnimationFrame instead of setInterval

[ ] Abstract the IO devices away from the PDP1.zig file

[ ] Abstract the platform away (the only target right now is Wasm + JS)

Resources

About

Original 1962 game code running on a PDP-1 emulator in Zig + Wasm + JS + HTML5 Canvas


Languages

Language:Zig 100.0%