Skip to content

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

Notifications You must be signed in to change notification settings

daneelsan/spacewasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.14.0-dev.1588+2111f4c38

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

Topics

Resources

Stars

Watchers

Forks

Languages