Skip to content
Example Racket games, mostly created to help me learn Racket, but maybe useful to others?
Racket
Branch: master
Clone or download
Latest commit 3227599 Dec 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images Smaller image Dec 9, 2018
.gitignore Initial import Dec 28, 2015
2d-tests.rkt direction-from-a-to-b same as angle-between May 24, 2018
2d.rkt direction-from-a-to-b same as angle-between May 24, 2018
3d-tests.rkt point-distance Oct 4, 2017
3d.rkt point-distance Oct 4, 2017
GClef.png Initial import Dec 28, 2015
GClef.svg Initial import Dec 28, 2015
LICENSE Initial commit Dec 28, 2015
README.md Update README.md Dec 26, 2018
asteroids-tests.rkt New controls Sep 23, 2017
asteroids1.rkt First version of asteroids Dec 30, 2015
asteroids2.rkt Moving ship Dec 30, 2015
asteroids3.rkt Fix comment Jan 3, 2016
asteroids4.rkt Better comment Jan 3, 2016
asteroids5.rkt Removed debug Feb 13, 2018
asteroids6.rkt Removed debug Feb 13, 2018
boids1.rkt Better intro Dec 9, 2018
boids2.rkt Better intro Dec 9, 2018
boids3.rkt Better intro Dec 9, 2018
boulder1.rkt Add boulders and gems to landscape + Make boulders fall Jan 17, 2016
boulder2.rkt More consistent use of block struct Jan 19, 2016
boulder3.rkt Changes? Oct 4, 2017
forest1.rkt Changes? Oct 4, 2017
learn-music-phrase1-tests.rkt Refactoring random-note-phrase and making more generic Jan 3, 2016
learn-music-phrase1.rkt Next version Jan 7, 2016
learn-music-phrase2-tests.rkt Scalable display Jan 7, 2016
learn-music-phrase2.rkt
learn-music1.rkt Initial import Dec 28, 2015
learn-music2.rkt Initial import Dec 28, 2015
learn-music3.rkt Initial import Dec 28, 2015
learn-music4.rkt Changes Oct 4, 2017
stars.rkt Initial import Dec 28, 2015
stars2.rkt Initial import Dec 28, 2015
stars3.rkt
stars4.rkt Initial import Dec 28, 2015
stars5.rkt Initial import Dec 28, 2015
stars6.rkt Initial import Dec 28, 2015
stars7.rkt Initial import Dec 28, 2015
thrust-tests.rkt Refactoring and new inside methods Oct 4, 2017
thrust1.rkt New version with gravity Apr 10, 2018
thrust2.rkt New easier level 1 Apr 10, 2018
tree1.rkt Added Feb 13, 2016
tree1b.rkt Better draw-tree Apr 4, 2016
tree2.rkt Fixes Apr 3, 2016
tree2b.rkt Better randomisation Apr 4, 2016
tree3.rkt Fixes Apr 3, 2016
util.rkt random-choice - Return #f for empty list Jan 20, 2016

README.md

racket-examples

A set of example Racket games, mostly created to help me learn Racket, but maybe useful to explore to help you learn too?

My starting place for learning Racket was the books: Realm of Racket http://www.realmofracket.com/, The Little Schemer and The Seasoned Schemer https://mitpress.mit.edu/books/little-schemer-fourth-edition

After that I created a set of games / demos (which you'll find in this repo), to help me prove I understood the principles and explore the language further. The games are pretty basic, but hopefully interesting to explore.

If you find these examples useful feel free to leave suggestions on the issues page, or email me comments.

Some thoughts on Racket:

  • I found each game pretty hard to write (my background is Python and other procedural languages) but once complete, surprising low in defects.
  • After getting over the lack of objects I found the functional approach produced a simpler design.
  • When making a game do objects and mutable state better model what's going on?

Contents:

  • asteroids -- a simple arcade game.

asteroids screen shot

  • boids -- bird like objects that flock together.

  • boulder -- a take on Boulder Dash.

boulder screen shot

stars screen shot

  • thrust -- a take on the game Thrust from 1986.

Many of the app filenames have numbers, these indicate major changes -- so it's easy to look back at previous, simpler versions.

You can’t perform that action at this time.