free-game gives you a world so that you can create games easily.
$ cabal update
$ cabal install free-game
-
runGame paramrunGame Window (BoundingBox 0 0 640 480)orrunGame FullScreen (BoundingBox 0 0 640 480)setTitle "Lorem ipsum"- Unicode characters are OK:
setTitle "ニンジャ" showCursororhideCursorclearColor blacksetFPS 60
-
loadBitmapsWith 'func "/path/to"loadBitmapsWith [|func|] "/path/to"
-
keySpecialkeyPressorkeyDownorkeyUp-- You don't have to keep key states anymore!
-
foreverTick mforeverFrame m-- It is faster
-
do { some draw-only computation }- Just apply
drawto make your code faster.
- Just apply
-
Gameis a kind of coroutine uponFrame.
Comparison with gloss
free-game's API is similar to what gloss have.
| gloss | free-game |
|---|---|
| Picture | Game () |
| Blank | return () |
| Text | text font size |
| Bitmap w h d | bitmap |
| Translate x y | translate (V2 x y) |
| Scale x y | scale (V2 x y) |
| Rotate | rotate |
| Color | color |
| Pictures xs | sequence_ xs |
| Circle | circle |
| Line | line |
| Polygon | polygon |
- jbracker, extended features and fixed minor bugs
Bug reports, pull requests, feature requests are welcome.
Bitcoin Address: 1EvewG7YHdcgMjmQEYEBrKiPjUwGWBckY4
