Commit Graph

183 Commits

Author SHA1 Message Date
Charles Peyrat dab84738d9 Remove the starting room door only if it really shouldn't be here; also account for the new randomized placement in removing lone door tile 2021-01-08 15:18:13 +01:00
Charles Peyrat 8d7e264381 Fix a bug where the generator could crash by trying to place the starting room out of bounds; starting room position is now random 2021-01-08 15:06:38 +01:00
Charles Peyrat fab1bee8d8 Force loop entrance to get coverage 2021-01-08 14:52:59 +01:00
Charles Peyrat c06f903a16 Fix a typo that made corridors unable to be built 2021-01-08 07:41:00 +01:00
Charles Peyrat c6947fab44 Integrate the new map generation into the game ! Closes #5 2021-01-08 07:39:52 +01:00
Charles Peyrat 641f5c7872 Make generation more sparse by asking for extra space around rooms; also add out of bounds option to Map.neighbourhood 2021-01-08 07:38:47 +01:00
Charles Peyrat 605696dddd Revamp door placing algorithm so that it generates cleaner doors; also remove lone starting room door from level 2021-01-08 07:36:31 +01:00
Charles Peyrat 5ba07afc9f Fix typo in parameter names 2021-01-08 07:05:02 +01:00
Charles Peyrat e21d4d230c Add missing termination condition 2021-01-08 07:04:24 +01:00
Charles Peyrat b0ac580677 Fix place_walls, that placed floors instead ... 2021-01-08 07:03:49 +01:00
Charles Peyrat d362bdc949 Fix place_room and add missing argument 2021-01-08 06:58:02 +01:00
Charles Peyrat 9c252a2bbc Correct out of bounds errors and add missing arguments to range call 2021-01-08 06:54:01 +01:00
Charles Peyrat c959a9d865 Update tests because Map.neighbourhood became a static method 2021-01-08 05:42:12 +01:00
Charles Peyrat 8475e5228e Large neighbourhood shouldn't return the central cell 2021-01-08 05:41:16 +01:00
Charles Peyrat 20cbf546f9 Correct formulas for random enumeration of a grid 2021-01-08 05:21:31 +01:00
Charles Peyrat 49e261557c Fix typos 2021-01-08 05:14:46 +01:00
Charles Peyrat abbad0f352 Fix formulas in place_room and room_fits 2021-01-08 05:14:32 +01:00
Charles Peyrat 05ccd0e339 Circular rooms should not try to generate any holes if their radius isn't large enough 2021-01-08 04:51:20 +01:00
Charles Peyrat c6f66d95f2 Fix typos 2021-01-08 04:48:32 +01:00
Charles Peyrat 6fbc757f1e Implement method place_walls 2021-01-08 04:43:10 +01:00
Charles Peyrat ffa7641b21 Made Map.neighbourhood a static method 2021-01-08 04:36:57 +01:00
Charles Peyrat 3229eb8ea7 Implement place_room method 2021-01-08 03:45:26 +01:00
Charles Peyrat 42f0c195aa Add prototype for create_random_room; change return value of attach_doors and create_circular_room so we have info on door direction; minor syntax change 2021-01-08 03:43:20 +01:00
Charles Peyrat ddbd0299a0 Implement method room_fits 2021-01-08 03:38:37 +01:00
Charles Peyrat 5cbf15bef5 Return value of Generator.run should be a Map 2021-01-08 03:37:10 +01:00
Charles Peyrat bb3422f7d8 Add main generation loop 2021-01-08 03:19:59 +01:00
Charles Peyrat 5579f5d791 Room now can now generate with a corridor; implemenent door placement finding 2021-01-07 07:06:08 +01:00
Charles Peyrat 9fb366aaab Make name follow style convention 2021-01-07 05:02:49 +01:00
Charles Peyrat f5e5e365d4 Starting the implementation of the new map generator 2020-12-18 20:02:37 +01:00
Charles Peyrat ba3d979f9c Fix syntax error 2020-12-18 18:10:52 +01:00
Charles Peyrat 5fbb918132 Add walls even to map borders 2020-12-18 17:05:50 +01:00
Yohann D'ANELLO fb926f8c84 Always use predefined map in game unit tests 2020-12-11 19:27:57 +01:00
Yohann D'ANELLO 209bde5b5c Fix sunflowers and merchants since the position of the player is no longer fixed 2020-12-11 19:21:02 +01:00
Yohann D'ANELLO 895abe88ad Ensure that the neighboorhood is walkable in movement tests 2020-12-11 19:18:48 +01:00
Charles Peyrat 3d7667573e Add testing for the no_lone_walls option 2020-12-11 19:14:28 +01:00
Charles Peyrat fe9dfdf242 Syntax change in randomwalk.Generator.__init__ 2020-12-11 19:13:15 +01:00
Charles Peyrat deb52d7350 Adding a missing parenthesis 2020-12-11 19:05:26 +01:00
Yohann D'ANELLO e91deccb6f Merge branch 'master' into map_generation
# Conflicts:
#	squirrelbattle/interfaces.py
2020-12-11 19:02:45 +01:00
Charles Peyrat 18ca083ba2 Added a connexity test 2020-12-11 18:59:07 +01:00
Yohann D'ANELLO a4a10e340d Test clicking on the merchant pad 2020-12-11 18:44:05 +01:00
ynerant 53d090a9c8 Merge branch 'master' into 'mouse_interaction'
# Conflicts:
#   squirrelbattle/display/display_manager.py
#   squirrelbattle/display/menudisplay.py
#   squirrelbattle/entities/items.py
2020-12-11 18:38:13 +01:00
Yohann D'ANELLO f453b82a58 Test clicking on the screen 2020-12-11 18:33:47 +01:00
Charles Peyrat 7667079aa3 Changed Map.large_neighbourhood so we can also request only immediate neighbours, ignoring diagonals 2020-12-11 18:33:16 +01:00
eichhornchen 9d3e8a9822 Merge branch 'village' into 'master'
Village

Closes #41, #38, #37, #36, and #18

See merge request ynerant/squirrel-battle!44
2020-12-11 18:23:10 +01:00
Yohann D'ANELLO d9912cacad Listen to mouse clicks in the main loop 2020-12-11 18:17:59 +01:00
Yohann D'ANELLO 45f420aaef Linting 2020-12-11 18:17:08 +01:00
eichhornchen e7f24c2371 The store menu now displays the price of objects, fixes #41 2020-12-11 18:08:10 +01:00
Yohann D'ANELLO 1afa397fec Better interaction with inventory menu 2020-12-11 18:07:39 +01:00
Charles Peyrat d3c14a48ee Add docstring for Map.large_neighbourhood 2020-12-11 17:46:49 +01:00
Yohann D'ANELLO 089a247b2f Maybe mouse clicks may use the game 2020-12-11 17:43:46 +01:00