Commit graph

6 commits

Author SHA1 Message Date
Rob O'Dwyer
b1ddd2f4ca
Add wrapped_constrictor game mode and support for map tags (#102)
* add support for wrapped_constrictor game mode

* add tags to map metadata
2022-08-17 13:03:09 -07:00
Blayne Campbell
ffeb401377
add 'map' cli command to provide map information (#100)
* add 'map' cli command

- provides the following map information functions:
  - list all available maps in the global registry
  - display map metadata

- update docs with map command examples

* add list and info subcommands to map cli command

* rename map command list and info factory functions

* add --all flag to map info subcommand

* handle cmd.Help error
2022-08-09 15:06:28 -07:00
Corey Alexander
08cb7ae61d
[Custom Map] Single Player Maze (#81)
* Commit from Stream

We got the maze working decently well!

Started off with exploring the repo a bit and getting used to the Map
stuff

The Maze is working pretty well except the mazes that are generated
aren't actually complete-able yet. They end up creating spaces that are
blocked off from the rest of the map

The maze generation algo is based off 'Recursive division method' mostly
following this Wiki

This looked to always create a 'valid' maze, while mine doesn't so need
to figure out what my bug is, cause I'm pretty sure there is one!

* I think we got maze generation working!

Did a lot, should have commited more lol

Got map generation working where I can see it go frame by frame, and
think we squashed the last few bugs with wall generation and hole
cutting

Now need it to actually make a new maze when you finish this first one

* We can run on a bigger board now, and we place the food randomly on the board after you grab it the first time

* Make sure my health is always 100 so don't have to worry about that lol

* Fix placing of food on maze to NOT be on an existing hazard and after 3 foods make a new maze

* Maze generation works better now and a bit of cleanup

* Committing old code

* Got state saving as Hazards Bits Working well, I think whats up next is making the map grow each level

* Draw maze in the center of the board, the maze grows as you complete levels until it fills the entire board

* Ran go fmt

* Remove my little debugging script that I added

* Revert changes I made initially to the map interface

* Move my copy-pasted printMap function to my map specifically

* Go fmt

* Write some doc comments and fix some weird code artifacts

* A few more comments and one last go fmt

* Cut less holes, this makes the maze more exciting

* Add version to Metadata and go fmt again

* Can collapse this down

* Random food spawns are more fun for sure

* add minimal support for serving a game to the board UI

* We did 3 main things here:

- Fixed the bug where hazards were getting multi-stacked
- Fixed the bug where the food could spawn on top of the snake head
- Fixed the lint errors

* Games aren't infinite now, they end by not spawning a food when you have reached a certain number of turns at the max board size

* Extract some functions to make deciding when the game is over easier

* Get evil mode implemented to force the game to end

* Fix small bugs about where we spawned the food in evil mode

* Have the snake keep growing by adding tail segments to match the current level. We start at two length because 1 lenth snakes look weird on the board since they don't have a neck to orient themselves. Here we also fix a bug where evil mode was trying to place food off the map

* Run go fmt

* Add the missing meta-data pieces

* Support a smaller board without the change of infinite loops and change the name of the maze

* Rename the actual struct and fix the tests to not make extra snakes when the map doesn't support it

* Revert "add minimal support for serving a game to the board UI"

This reverts commit 0ac3592c7669ab1bccd7bd3322adffbef5e911ce.

* add minimal support for serving a game to the board UI

* Cleanup and extract and function to place food so we don't have basically the same body twice. This also will prevent the initial food spawn from being right next to the snake

* Revert "add minimal support for serving a game to the board UI"

This reverts commit c1a3b134213dabf44df56e3ca1e6d30ff8aaa516.

* Fix lint

* 2 length snakes are silly, so lets start with 3 each time

* We start out with 3 length snakes, and a fixed set of map sizes

Co-authored-by: Rob O'Dwyer <odwyerrob@gmail.com>
2022-07-04 10:25:28 -07:00
Torben
3180429688
Add player and board size meta data to all game maps (#84)
* WIP: initial data model for new meta props
* WIP: implemented new props
* test and bug fix:
- add coverage of players and sizes
- fix unlimited map size bug
* FIX: update supported players for arcade to 6
* fix: test should be min -> max, not max->max
* Change some naming and the FixedSizes function
* update comment to reflect API changes
* improve comment clarity
* rename field for improved clarity
* change some more "map" -> "board" wording
2022-06-19 20:09:17 -07:00
Torben
e8e20c53ad
Add a "Version" field to GameMap Meta (#83)
* initial concept for versioning
* simple uint version implementation
* tidy up dependencies
2022-06-15 15:51:42 -07:00
Rob O'Dwyer
1adbc79168
DEV 953: Add basic maps support to CLI (#74)
* remove squad support and switch to using pipelines only in RulesBuilder

* remove spawn_food.standard from legacy ruleset definitions

* bugfix: Royale map generates Standard food

* add maps support to CLI

* add automated tests for all registered GameMap implementations

* update README
2022-05-25 11:24:27 -07:00