项目作者: robrix

项目描述 :
spaceships in space
高级语言: Haskell
项目地址: git://github.com/robrix/starlight.git
创建时间: 2019-12-04T21:47:51Z
项目社区:https://github.com/robrix/starlight

开源协议:BSD 3-Clause "New" or "Revised" License

下载


starlight

screenshot showing player’s ship in quite a close approach to Mercury

Development

Development currently assumes a Mac with ghc 8.8 & cabal 3.0. You can install them directly, or use ghcup.

Initial setup:

  1. brew bundle # for sdl2 & sqlite3
  2. cat data/ephemerides.sql | sqlite3 data/data.db # to populate the solar system db with planets
  3. cat data/factions.sql | sqlite3 data/data.db # to populate the solar system db with factions
  4. 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)