Skip to content

J0J0/rp2-asteroids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ℝP2-Asteroids

This is a very minimalistic implementation of the video game classic Asteroids – with one notably exception: it is played on the real projective plane ℝP2 instead of the torus (as usual).

It's implemented in Haskell, yet it is supposed to be run in the browser. This is accomplished by the haste compiler which is one of the available Haskell to Javascript compilers (see the HaskellWiki for alternatives). (In particular this code will not work with a vanilla GHC installation!)

You can see it in action (and, of course, play it) here.

Controls

  • Left/Right arrow keys: rotate ship
  • Up arrow key: boost
  • Space: shoot

Build instructions

Get hastec and haste-cabal, the haste compiler and patched cabal for use with haste, respectively. The easiest way to do this, is via the "ready to use" binary packages.

Then you can just use (haste-)cabal as usual:

git clone "https://github.com/J0J0/rp2-asteroids.git"
cd rp2-asteroids
path/to/haste-cabal update
path/to/haste-cabal build --hastec-options='--opt-all'

This will produce a javascript file rp2-asteroids.js that can be used by any html file providing a (big enough) canvas element with id set to game-canvas (and statically assigned width/height html attributes). See RP2-Asteroids.html for an example.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published