8e1fe17758
Towards #1662 Prerequisite for #1672 To allow a robot-occupied cell to take on the underlying terrain color as the background color of its cell, the terrain color must be representable strictly as a "background". However, currently, the `dirt`, `stone`, and `grass` terrains are represented by a half-shaded **foreground** glyph upon `black` background. Currently the ["Medium Shade" unicode character](https://www.compart.com/en/unicode/U+2592) (`▒`) is used to "blend" a somewhat bright color with a black background, resulting in a moderately dark color in the terminal for `dirt`, `stone`, and `grass`. However, these same dark colors are not reproducible in the 240-color scheme without this foreground+background blending trick; the closest approximations as a background-only or foreground-only color come out quite a bit lighter. ## Visual comparison Using: scripts/play.sh -i creative --seed 2 --autoplay | Before | After | | --- | --- | | ![Screenshot from 2023-12-03 23-33-15](https://github.com/swarm-game/swarm/assets/261693/edeeaeac-13e0-4641-9822-773fdb20f1d4) | ![Screenshot from 2023-12-03 23-32-36](https://github.com/swarm-game/swarm/assets/261693/ae5a5b5d-aa69-4580-b7e1-85eec21b4aeb) | ## Possible approaches So, we need to decide whether to: 1. Accept the new lighter colors 2. Choose new, alternative terrain colors that may be darker given the 240-color palette 3. Abandon support for 240 colors and assume "full" color terminals 4. Abandon efforts to passthrough terrain color as background of robot cells |
||
---|---|---|
.github | ||
.vscode | ||
app | ||
data | ||
docs/blog | ||
editors | ||
example | ||
images | ||
scripts | ||
src | ||
test | ||
web | ||
.gitignore | ||
.hlint.yaml | ||
.mergify.yml | ||
.restyled.yaml | ||
.stan.toml | ||
cabal.haskell-ci | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
COMMUNITY.md | ||
CONTRIBUTING.md | ||
DESIGN.md | ||
feedback.yaml | ||
fourmolu.yaml | ||
hie.yaml.stack | ||
LICENSE | ||
NOTICE | ||
pull_request_template.md | ||
README.md | ||
scenarios | ||
stack.yaml | ||
swarm.cabal |
Swarm
Swarm is a 2D programming and resource gathering game. Program your robots to explore the world and collect resources, which in turn allows you to build upgraded robots that can run more interesting and complex programs. More info can be found on the Swarm website.
Contributing
See CONTRIBUTING.md for information about various ways you can contribute to Swarm development!
Building
If you just want to play the game, head over to the Swarm website for installation instructions. If you want to build Swarm from source (e.g. in order to contribute, or to test out the latest bleeding-edge unreleased features), read on.
-
Clone the Swarm repository, e.g.
git clone https://github.com/swarm-game/swarm.git
-
If you don't already have the
stack
tool:-
Get the
ghcup
tool, a handy one-stop utility for managing all the different pieces of a Haskell toolchain. -
Use
ghcup
to installstack
:ghcup install stack
-
-
Now use
stack
to build and run Swarm:cd /path/to/the/swarm/repo stack run
-
Go get a snack while
stack
downloads a Haskell compiler and all of Swarm's dependencies. -
You might also want to check out the
scripts
directory, which contains an assortment of useful scripts for developers.