https://github.com/robrix/starlight
spaceships in space
https://github.com/robrix/starlight
game haskell opengl
Last synced: 9 months ago
JSON representation
spaceships in space
- Host: GitHub
- URL: https://github.com/robrix/starlight
- Owner: robrix
- License: bsd-3-clause
- Created: 2019-12-04T21:47:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-25T02:25:48.000Z (about 5 years ago)
- Last Synced: 2025-04-30T09:09:51.028Z (9 months ago)
- Topics: game, haskell, opengl
- Language: Haskell
- Homepage:
- Size: 6.51 MB
- Stars: 71
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `starlight`

## Development
Development currently assumes a Mac with `ghc` 8.8 & `cabal` 3.0. You can install them directly, or use [`ghcup`](https://www.haskell.org/ghcup/).
Initial setup:
```bash
brew bundle # for sdl2 & sqlite3
cat data/ephemerides.sql | sqlite3 data/data.db # to populate the solar system db with planets
cat data/factions.sql | sqlite3 data/data.db # to populate the solar system db with factions
cabal build # to set up dist-newstyle with the ghc package db
```
Run `script/repl` to load the project (both library & executable) into the REPL. In the REPL, `:main` will launch the game. Use `:main --profile` to enable profiling (timings for various parts of the game, shown on exit).
Alternatively, `cabal run starlight` will launch the game. Use `cabal run starlight -- --profile` to enable profiling.
## Controls
Controls are currently hard-coded; I intend to eventually make them configurable.
- Up arrow: forward thrust
- Left/right arrows: turn left/right
- Down arrow: turn to face opposite direction from current heading (relative to target’s heading, if any, or absolute otherwise; helps you match speed and heading to target’s)
- +/-: increase/decrease throttle (controls rate of thrust)
- tab/shift tab: switch to the next/prev target
- escape: clear the target
- space: fire weapons in the direction you’re facing
- t: turn to face the selected target (if any)
- f: face in the direction the ship is moving
- b: brake/match speed to target
- j: jump to the target (if any)