Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andyhd/asteroids
Asteroids game in Common Lisp
https://github.com/andyhd/asteroids
Last synced: about 1 month ago
JSON representation
Asteroids game in Common Lisp
- Host: GitHub
- URL: https://github.com/andyhd/asteroids
- Owner: andyhd
- Created: 2012-08-19T23:41:20.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-07-27T09:41:45.000Z (almost 6 years ago)
- Last Synced: 2024-02-08T19:55:02.303Z (5 months ago)
- Language: Common Lisp
- Size: 43 KB
- Stars: 113
- Watchers: 28
- Forks: 23
- Open Issues: 1
-
Metadata Files:
- Readme: README.mdown
Lists
- awesome-cl-software - Asteroids - Asteroids game in Common Lisp. [No License Specified]. (Applications / Games)
- awesome - asteroids - Asteroids game in Common Lisp (Common Lisp)
README
ASTeroids
=========A simple Asteroids clone, inspired by [Square Shooter by No Time To Play][1],
but written in Common Lisp with Lispbuilder-SDL.Why?
----I'm learning Common Lisp this year, and it seemed like a fun project. It was.
**UPDATE**
Wow, I made the front page of Hacker News!
I read a few questions there and on /r/programming about why I did this, and it
really was just a fun learning project, partly in response to an article I read
about refactoring the original Python version.Thanks to everyone for the generally positive feedback!
I wasn't trying to fit it into 600 LOC or trying to make a very clean or fast
implementation.The code is quite un-Lispy because I'm only about 4 months into learning Lisp
and this is a translation from a Python codebase, rather than starting from
scratch. I also wanted to learn a bit of CLOS. I haven't really tried any
macro programming yet.I did write it using Vim, because that's what I'm used to, and I haven't got
into Emacs and Slime yet. It's difficult to switch, but I will give it a try.There aren't many inline comments, I'm not a fan of them. I prefer my code to
be self documenting as far as possible.Why are the first three letters of ASTeroids capitalized?
---------------------------------------------------------It's a pun on Abstract Syntax Tree - which Lisp essentially is. Sorry.
How do I play it?
-----------------You'll need to install [Steel Bank Common Lisp][2] and [the
Quicklisp package tool][3], which is pretty easy.I've also tested with Clozure CL.
I used [Homebrew][4] to install SDL and SDL_gfx on my Mac.
Start SBCL and type the following at the REPL prompt:
```lisp
(sb-ext::set-floating-point-modes :traps nil)
(load "asteroids.lisp")
```Quicklisp will then install some dependencies. When Quicklisp tries to install Lispbuilder-SDL, it may fail
and complain about CocoaBuilder. You have to manually compile it:
```sh
cd ~/quicklisp/dists/quicklisp/software/lispbuilder-20130312-svn/lispbuilder-sdl/cocoahelper
make
```
Then retry loading asteroids.lispOnce that is done, you can start the game from the REPL with:
```lisp
(asteroids:main)
```The game is mouse controlled.
What does it look like?
-----------------------A bit rubbish, really. Next steps are learning some OpenGL to make it a bit
prettier.![ASTeroids screenshot](screenshot.png)
[1]: http://notimetoplay.org/our-games/square-shooter/
[2]: http://www.sbcl.org/
[3]: http://www.quicklisp.org/
[4]: http://mxcl.github.com/homebrew/