Difference between revisions of "WxAsteroids"

From HaskellWiki
Jump to navigation Jump to search
 
("wxHaskell - A Portable and Concise GUI Library for Haskell" is now locally stored)
 
(2 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
To run the game, you will need [http://www.haskell.org/haskellwiki/WxHaskell/Download wxHaskell]
 
To run the game, you will need [http://www.haskell.org/haskellwiki/WxHaskell/Download wxHaskell]
   
If wxHaskell is installed, and you have cabal-install
+
If wxHaskell is installed, and you have [[cabal-install]]
on your system, give the folllowing command to install
+
on your system, give the following command to install
 
wxAsteroids:
 
wxAsteroids:
 
cabal install wxAsteroids
 
cabal install wxAsteroids
Line 35: Line 35:
   
 
For a detailed description of wxHaskell and the program, see
 
For a detailed description of wxHaskell and the program, see
[http://legacy.cs.uu.nl/daan/download/papers/wxhaskell.pdf wxHaskell - A Portable and Concise GUI Library for Haskell]
+
[[media:wxhaskell.pdf | wxHaskell - A Portable and Concise GUI Library for Haskell]]
 
 
  +
There is also an [[Functional Reactive Programming | FRP]] [https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/Asteroids.hs version of the main program], it uses the package [http://hackage.haskell.org/package/reactive-banana reactive-banana]
  +
  +
Furthermore, wxAsteroids has also been ported to the [http://uu-computerscience.github.com/js-asteroids/ web browser] using the Utrecht Haskell Compiler (UHC) JavaScript backend.
   
 
Further information: [[wxHaskell]]
 
Further information: [[wxHaskell]]

Latest revision as of 19:22, 21 September 2014

Your space ship enters an asteroid belt, try to avoid collisions!

WxAsteroids.png

wxAsteroids is a game demonstrating the wxHaskell GUI.

To run the game, you will need wxHaskell

If wxHaskell is installed, and you have cabal-install on your system, give the following command to install wxAsteroids:

 cabal install wxAsteroids

Another option is, to download the wxAsteroids tarball from Hackage and unpack it; go to the directory with the game code and enter the commands:

 runhaskell Setup configure
 runhaskell Setup build
 runhaskell Setup install

You will get a message about the directory in which the executable is installed; this directory must be in the search path.

Give the following command to start the game:

 wxAsteroids

Use the left and right cursor keys to move the ship sideways. Ctrl-n creates a new window with a new Asteroids game. Ctrl-p pauses/resumes the game. To increase the speed of the space ship, press '+'; to slow down, press '-'.

For a detailed description of wxHaskell and the program, see wxHaskell - A Portable and Concise GUI Library for Haskell

There is also an FRP version of the main program, it uses the package reactive-banana

Furthermore, wxAsteroids has also been ported to the web browser using the Utrecht Haskell Compiler (UHC) JavaScript backend.

Further information: wxHaskell