Commit Graph

30 Commits

Author SHA1 Message Date
Brent Yorgey
597d1c6853
require --cheat flag to allow toggling creative mode with m key (#368)
Closes #360.
2022-06-10 00:38:00 +00:00
Brent Yorgey
8961d03a1a
Generalize challenges + classic/creative modes to scenarios (#337)
Generalize challenges + various modes to all be "scenarios" which are described by `.yaml` files in `data/scenarios`.  

- Both challenges and classic/creative modes are now subsumed under the more general notion of "scenarios".
- A scenario describes how to set up the world etc. when starting a game; all scenarios are stored in a `.yaml` file in `data/scenarios`.
- "New game" menu item now lets the user choose a scenario.
- Some small improvements to the way seeds are handled.

See #296.  This will enable #35 and #25 .
2022-06-04 13:20:49 +00:00
Brent Yorgey
d36a89af18
deal gracefully with absence of git repo (#329) 2022-04-29 05:19:04 -05:00
Brent Yorgey
667f001c8b print git branch and hash in --help menu
Not super useful on its own.  This is mostly just to figure out the
`githash` library (which wasn't hard) in initial preparation for #66.
2022-04-27 08:01:45 -05:00
Brent Yorgey
008d4000a5
Add a --run flag to run the contents of a program on startup (#312)
Fixes #82.

Right now it only works in classic mode.  It wouldn't be too hard to
make it work with challenge mode as well, but that would require some
more careful thinking about whether every challenge is required to
have a 'base' and how we identify which robot that is, so that we run
the given file on the right robot.
2022-03-07 05:56:15 -06:00
Brent Yorgey
b1f0e316fd
Challenge mode (#285)
Add a "challenge mode" where the player tries to achieve some specified goal from specific starting conditions.
2022-01-27 17:00:00 -06:00
Ondřej Šebek
77c7fd686d
Add seed option to CLI (#170)
- adds CLI option `--seed` and propagates it to `testWorld2` (Closes #14)
- moves the base in the tree shade (Closes #90)
- makes the `random` command depend on initial seed (Closes #13)
2021-10-05 19:43:52 +00:00
Tristan de Cacqueray
28885afd65
Add stdin support for swarm format (#141)
This change enables reading code from stdin to simplify editor integration.

Fixes #140
2021-10-03 02:21:48 +00:00
Tristan de Cacqueray
a23212ae9d
Reformat the haskell code with fourmolu (#146)
This PR was generated using `find src/ app/ test/ -name "*.hs" | xargs fourmolu --mode=inplace`.

Fixes #103
2021-10-02 18:40:24 +00:00
Tristan de Cacqueray
c7baf13efe
Add basic editor integration with LSP (#108)
This change improves the user experience when editing swarm code outside of the REPL with:

- CLI for a `format` command to quickly parse and type check a file.
- Basic LSP server to provide IDE feedback on save, e.g. visual squiggly for errors.
- Initial emacs mode.

Fixes #82 #110
2021-10-01 20:11:08 +00:00
Brent Yorgey
95f6ac28d4 factor out remaining UI + app stuff 2021-08-23 16:52:40 -05:00
Brent Yorgey
f046b2b43c factor out more UI code 2021-08-23 16:39:56 -05:00
Brent Yorgey
dda0aafc93 factor out Swarm.Game.Resource 2021-08-23 16:30:41 -05:00
Brent Yorgey
65917c2ae4 split out Swarm.UI.Attr 2021-08-23 16:27:51 -05:00
Brent Yorgey
4efea30df2 factor out more code into separate modules 2021-08-23 16:24:54 -05:00
Brent Yorgey
319b36ace8 fix refactoring, split UIState out of GameState into top-level AppState 2021-08-23 16:13:25 -05:00
Brent Yorgey
9526392d26 WIP 2021-08-23 15:01:09 -05:00
Brent Yorgey
eb832d366c refactor: split out Swarm.AST 2021-08-23 13:31:57 -05:00
Brent Yorgey
4bb87983ec factor out handleREPLEvent 2021-08-23 13:18:08 -05:00
Brent Yorgey
381a49e5d6 refactor and add REPL history 2021-08-23 11:44:25 -05:00
Brent Yorgey
79bbf4de76 add repeat command 2021-08-22 22:02:01 -05:00
Brent Yorgey
7ea09880bd clean up 2021-08-22 22:01:50 -05:00
Brent Yorgey
44897c6535 decrease delay between ticks 2021-08-22 22:01:38 -05:00
Brent Yorgey
f82b4cc071 build just takes a Command 2021-08-22 21:49:51 -05:00
Brent Yorgey
7fdccbbc14 add a bunch of stuff!
enhanced 'turn' command
blocks
build command
real-time syntax checking for REPL inputs
error message dialog for parse errors
2021-08-22 21:47:39 -05:00
Brent Yorgey
2f8e13eebe add focus ring for panels
Tab key cycles the focus.
Also clean up a few warnings.
2021-08-22 14:20:04 -05:00
Brent Yorgey
7c0a2bfd75 test with larger, randomly generated world 2021-08-22 08:08:09 -05:00
Brent Yorgey
0c73122d2a tweaks 2021-08-22 06:48:23 -05:00
Brent Yorgey
81fe71f3bb draw interface with three full-size panels, and improve visuals 2021-08-22 06:36:56 -05:00
Brent Yorgey
479b10e986 initial exploration 2021-08-21 18:18:07 -05:00