Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fosskers/aero-fighter

A recreation (in CL) of a friend's old game that he wrote in Turbo Pascal.
https://github.com/fosskers/aero-fighter

common-lisp raylib

Last synced: 30 days ago
JSON representation

A recreation (in CL) of a friend's old game that he wrote in Turbo Pascal.

Awesome Lists containing this project

README

        

#+title: Aero Fighter

* Game Mechanics

** Spawn Schedule

Every frame, something might spawn.

| Thing | Timing | Per-frame Chance |
|-----------+-----------+-------------------|
| Bomb | Every 20s | 4/5000 |
|-----------+-----------+-------------------|
| Blob | Every 2s | (level * 40)/5000 |
| Tank | Every 3s | (level * 25)/5000 |
| Evil Ship | Every 5s | 16/5000 |
| Building | Every 5s | 16/5000 |

Certain other entities have fixed spawn timings.

| Thing | Timing |
|---------------------+-------------------|
| Missile | Every 1s |
| Beam Upgrade | Every 1000 points |
| Difficulty Increase | Every 5000 points |
| Tripwire-Cannon | Every 5000 points |

* Coding Conventions

- Prefix: =@= denotes a smart constructor.
- Postfix: =?= denotes a boolean result from a function.
- Postfix: =!= implies that the function mutates its arguments.
- Top-level =defparameter= values are placed in the =package.lisp=.

Otherwise, we keep things simple: just structs and functions. No CLOS, other
than light use of =defgeneric=.

All dependencies are vendored.

* Credits

Aero Fighter uses [[https://github.com/bohonghuang/claw-raylib][bindings]] for [[https://github.com/raysan5/raylib/][Raylib]] for windowing, sound effects, collision,
etc. The rest of the game logic is in pure Common Lisp.

| Person | Role |
|--------------+----------------|
| Colin | Code, Graphics |
| JPJ | Concept |
| Gumichan01 | [[https://opengameart.org/content/laser-shot][Sound Effects]] |
| Joel Burford | [[https://joelfrancisburford.itch.io/jrpg-8-bitchiptune-sfx-pack][Sound Effects]] |
| SketchyLogic | [[https://opengameart.org/content/nes-shooter-music-5-tracks-3-jingles][Music]] |

* Minutia

** REPL Loading

All dependencies are vendored, so we need to help ASDF by telling it to only
look in this project folder when searching for systems:

#+begin_src lisp
(require :asdf)
(asdf:initialize-source-registry `(:source-registry (:tree ,(uiop:getcwd)) :ignore-inherited-configuration))
#+end_src

The =load.lisp= file provides this. Within Emacs, you can then define an alternate
connection scheme for Sly:

#+begin_src emacs-lisp
(setq sly-lisp-implementations
'((sbcl-vendored ("sbcl" "--dynamic-space-size" "4GB" "--load" "load.lisp") :coding-system utf-8-unix)
(ecl-vendored ("ecl" "--load" "load.lisp") :coding-system utf-8-unix)))
#+end_src

Make sure to start Sly from the project root.

** Compiling Executables

*** SBCL

If =raylib= has not yet been built:

#+begin_example
sbcl --dynamic-space-size 4GB --load build.lisp
#+end_example

Otherwise:

#+begin_example
sbcl --load build.lisp
#+end_example

*** ECL

#+begin_example
ecl --load build.lisp
#+end_example

** Updating Raylib

1. Reclone [[https://github.com/bohonghuang/cffi-object]] and
[[https://github.com/bohonghuang/cffi-ops]] if they've changed.
2. Reclone https://github.com/bohonghuang/claw-raylib and move to its =prebuilt= branch.
3. Delete all references to =raygui=. The git diff helps here.
4. Run =raylib.sh= to generate the "adapter" =.so= files.