Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the asteroids Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 11:44:23 2020 GMT+0.
• Introduction | What asteroids is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Classic asteroids arcade game in Common Lisp, using SDL.
Originally ported from Python by andyhd (thanks, andyhd!). The game now has sounds, keyboard controls, a built-in REPL (triggered by ESC key) and is very playable.
Install SBCL (or CCL) and quicklisp as described here)
IMPORTANT - install native sdl libraries! For linux, that means apt-get install
Now, in lisp (ql:quickload "asteroids") (asteroids:main)
Quicklisp updates monthly. If you want the newest version, git clone this repo into an asdf-visible directory (see Xach's article). ql:quickload will load the local repo first
The game plays like original asteroids, except instead of saucers you get powerups. Ram the powerups to pick up super-missiles that go through anything, shields, or to stop time.
Keyboard controls:
Q - quit A - rotate ship left F - rotate ship right J - thrust SPC - fire ESC - REPL
P starts the game in attract mode.
In retrospect, this was my first attempt at programming in Lisp, by modifying code written by someone who was probably doing the same thing (I think original code was in some other language...). Don't look too closely; I know I won't.
Code has been re-organized and cleaned up. Names have been altered to make it more sensible and bugs fixed. Now loading with quicklisp
ESC now brings you to a REPL. Examine the game state, recompile anything (carefully).
I also added audio using MAME asteroids samples. lispbuilder-sdl-mixer is fragile and very sensitive to being shut down correctly in an interactive environment.
Background music is courtesy http://teknoaxe.com/Home.php.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The asteroids system |
stacksmith stack@sdf.org
Do Whatever The Fuck You Want (DWTFYF)
An improved asteroids game with sounds
asteroids.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files | ||
• Static files |
Next: Static files, Previous: Files, Up: Files [Contents][Index]
• The asteroids.asd file | ||
• The asteroids/package.lisp file | ||
• The asteroids/asteroids.lisp file |
Next: The asteroids/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
asteroids.asd
asteroids (system)
Next: The asteroids/asteroids․lisp file, Previous: The asteroids․asd file, Up: Lisp files [Contents][Index]
Previous: The asteroids/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
asteroids (system)
asteroids.lisp
main (function)
Previous: Lisp files, Up: Files [Contents][Index]
Next: The asteroids/sounds/biding․mp3 file, Previous: Static files, Up: Static files [Contents][Index]
asteroids.lisp (file)
asteroids (system)
sounds/banjo.mp3
Next: The asteroids/sounds/explode1․wav file, Previous: The asteroids/sounds/banjo․mp3 file, Up: Static files [Contents][Index]
sounds/banjo.mp3 (file)
asteroids (system)
sounds/biding.mp3
Next: The asteroids/sounds/explode2․wav file, Previous: The asteroids/sounds/biding․mp3 file, Up: Static files [Contents][Index]
sounds/biding.mp3 (file)
asteroids (system)
sounds/explode1.wav
Next: The asteroids/sounds/explode3․wav file, Previous: The asteroids/sounds/explode1․wav file, Up: Static files [Contents][Index]
sounds/explode1.wav (file)
asteroids (system)
sounds/explode2.wav
Next: The asteroids/sounds/fire․wav file, Previous: The asteroids/sounds/explode2․wav file, Up: Static files [Contents][Index]
sounds/explode2.wav (file)
asteroids (system)
sounds/explode3.wav
Next: The asteroids/sounds/haters․mp3 file, Previous: The asteroids/sounds/explode3․wav file, Up: Static files [Contents][Index]
sounds/explode3.wav (file)
asteroids (system)
sounds/fire.wav
Next: The asteroids/sounds/life․wav file, Previous: The asteroids/sounds/fire․wav file, Up: Static files [Contents][Index]
sounds/fire.wav (file)
asteroids (system)
sounds/haters.mp3
Next: The asteroids/sounds/lsaucer․wav file, Previous: The asteroids/sounds/haters․mp3 file, Up: Static files [Contents][Index]
sounds/haters.mp3 (file)
asteroids (system)
sounds/life.wav
Next: The asteroids/sounds/music․mp3 file, Previous: The asteroids/sounds/life․wav file, Up: Static files [Contents][Index]
sounds/life.wav (file)
asteroids (system)
sounds/lsaucer.wav
Next: The asteroids/sounds/phaser․wav file, Previous: The asteroids/sounds/lsaucer․wav file, Up: Static files [Contents][Index]
sounds/lsaucer.wav (file)
asteroids (system)
sounds/music.mp3
Next: The asteroids/sounds/sfire․wav file, Previous: The asteroids/sounds/music․mp3 file, Up: Static files [Contents][Index]
sounds/music.mp3 (file)
asteroids (system)
sounds/phaser.wav
Next: The asteroids/sounds/ssaucer․wav file, Previous: The asteroids/sounds/phaser․wav file, Up: Static files [Contents][Index]
sounds/phaser.wav (file)
asteroids (system)
sounds/sfire.wav
Next: The asteroids/sounds/thrust․wav file, Previous: The asteroids/sounds/sfire․wav file, Up: Static files [Contents][Index]
sounds/sfire.wav (file)
asteroids (system)
sounds/ssaucer.wav
Next: The asteroids/sounds/thumphi․wav file, Previous: The asteroids/sounds/ssaucer․wav file, Up: Static files [Contents][Index]
sounds/ssaucer.wav (file)
asteroids (system)
sounds/thrust.wav
Next: The asteroids/sounds/thumplo․wav file, Previous: The asteroids/sounds/thrust․wav file, Up: Static files [Contents][Index]
sounds/thrust.wav (file)
asteroids (system)
sounds/thumphi.wav
Previous: The asteroids/sounds/thumphi․wav file, Up: Static files [Contents][Index]
sounds/thumphi.wav (file)
asteroids (system)
sounds/thumplo.wav
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The asteroids package |
package.lisp (file)
main (function)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
asteroids.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal constants | ||
• Internal special variables | ||
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal classes |
Next: Internal special variables, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
asteroids.lisp (file)
Next: Internal macros, Previous: Internal constants, Up: Internal definitions [Contents][Index]
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
asteroids.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
return a list of vertices (points) suitable for draw-polygon
asteroids.lisp (file)
asteroids.lisp (file)
return a list of points located along the radius around p, at list of angles
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
Create a ’xy-off’
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
Next: Internal classes, Previous: Internal functions, Up: Internal definitions [Contents][Index]
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
create a point from mob’s fractional coordinates
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
Fire a missile using ship’s direction
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
Set ship’s acceleration using *thrust-factor* and ship’s direction
asteroids.lisp (file)
Set ship’s acceleration to null
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
asteroids.lisp (file)
automatically generated reader method
asteroids.lisp (file)
automatically generated writer method
asteroids.lisp (file)
Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
asteroids.lisp (file)
mob (class)
asteroids.lisp (file)
mob (class)
:super
super-p (generic function)
(setf super-p) (generic function)
(make-instance (quote asteroids::timer) :ms 1000)
lifetime (generic function)
(setf lifetime) (generic function)
asteroids.lisp (file)
standard-object (class)
:pos
(quote (0.5 0.5))
pos-of (generic function)
(setf pos-of) (generic function)
:radius
0
radius-of (generic function)
:velocity
(quote (0 0))
velocity-of (generic function)
(setf velocity-of) (generic function)
asteroids.lisp (file)
mob (class)
0
rotation-of (generic function)
(setf rotation-of) (generic function)
:direction
0
direction-of (generic function)
(setf direction-of) (generic function)
asteroids.lisp (file)
mob (class)
(make-instance (quote asteroids::timer) :ms asteroids::*powerup-max-age*)
lifetime (generic function)
(setf lifetime) (generic function)
asteroids.lisp (file)
powerup (class)
asteroids.lisp (file)
powerup (class)
asteroids.lisp (file)
powerup (class)
asteroids.lisp (file)
mob-rot (class)
:size
1
size-of (generic function)
(setf size-of) (generic function)
radii (generic function)
(setf radii) (generic function)
asteroids.lisp (file)
mob-rot (class)
(make-hash-table)
timers (generic function)
(setf timers) (generic function)
(quote (0 0))
acceleration-of (generic function)
(setf acceleration-of) (generic function)
asteroids.lisp (file)
standard-object (class)
opened (generic function)
(setf opened) (generic function)
sample (generic function)
(setf sample) (generic function)
music (generic function)
(setf music) (generic function)
asteroids.lisp (file)
standard-object (class)
1000
target (generic function)
(setf target) (generic function)
1
phasex (generic function)
(setf phasex) (generic function)
:period
1500
period (generic function)
(setf period) (generic function)
asteroids.lisp (file)
standard-object (class)
:ms
0
target (generic function)
(setf target) (generic function)
asteroids.lisp (file)
standard-object (class)
mobs (generic function)
(setf mobs) (generic function)
ship (generic function)
(setf ship) (generic function)
(make-hash-table)
timers (generic function)
(setf timers) (generic function)
0
level (generic function)
(setf level) (generic function)
0
num-of-rocks (generic function)
(setf num-of-rocks) (generic function)
0
score (generic function)
(setf score) (generic function)
0
best-level (generic function)
(setf best-level) (generic function)
0
high-score (generic function)
(setf high-score) (generic function)
1
lives (generic function)
(setf lives) (generic function)
paused (generic function)
(setf paused) (generic function)
(make-instance (quote asteroids::thumper) :period 1000)
thumper (generic function)
(setf thumper) (generic function)
asteroids.lisp (file)
mob-rot (class)
(make-instance (quote asteroids::timer) :ms 1000)
lifetime (generic function)
(setf lifetime) (generic function)
255
fade (generic function)
(setf fade) (generic function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | A F L S |
---|
Jump to: | A F L S |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
A B C D F G H I K L M N O P R S T U V X |
---|
Jump to: | (
A B C D F G H I K L M N O P R S T U V X |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
+
A B C D F H L M N O P R S T V |
---|
Jump to: | *
+
A B C D F H L M N O P R S T V |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | A C E M P R S T W X |
---|
Jump to: | A C E M P R S T W X |
---|