-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,101 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ def griddly_package_data(config='Debug'): | |
|
||
setup( | ||
name='griddly', | ||
version="1.2.21", | ||
version="1.2.22", | ||
author_email="[email protected]", | ||
description="Griddly Python Libraries", | ||
long_description=long_description, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Mechanics Integration Tests | ||
|
||
The mechanics integration tests here make sure that future updates do not break simple important mechanics. | ||
These tests also make sure that the examples in the python project are working. | ||
|
||
These tests do: | ||
* Provide a list of environments with specific mechanics | ||
* These specific mechanics are important to keep working in future updates | ||
* Prove that the specific mechanics are not broken. | ||
* Check that state information is as-expected during state transitions | ||
|
||
These tests do not: | ||
* Check rendering of environments | ||
|
||
|
169 changes: 169 additions & 0 deletions
169
python/tests/example_mechanics/project_lines/project_lines.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
Version: "0.1" | ||
Environment: | ||
Name: Bombs | ||
Description: | | ||
This environment tests | ||
* Objects can be spawn underneath the agent | ||
* Objects can spawn other object repeatedly in directions in single time-steps | ||
* Objects can be removed with delayed actions | ||
* Custom Action Ids with custom VectorToDests can be used to propagate further actions on spawns | ||
Player: | ||
AvatarObject: bomber # The player can only control a single avatar in the game | ||
Levels: | ||
- | | ||
w w w w w w w w w w w w w | ||
w . . . . . . . . . . . w | ||
w . . . . . . . . . . . w | ||
w . . . . . . . . . . . w | ||
w . . . . . . . . . . . w | ||
w . . . . B . . . . . . w | ||
w . . . . . . . . . . . w | ||
w . . . . . . . . . . . w | ||
w . . . . . . . . . . . w | ||
w w w w w w w w w w w w w | ||
Actions: | ||
|
||
# Define the move action | ||
- Name: move | ||
Behaviours: | ||
|
||
# Avatar and boxes can move into empty space | ||
- Src: | ||
Object: bomber | ||
Commands: | ||
- mov: _dest | ||
Dst: | ||
Object: _empty | ||
|
||
- Name: plant_bomb | ||
InputMapping: | ||
Inputs: | ||
1: | ||
VectorToDest: [ 0, 0 ] | ||
Behaviours: | ||
- Src: | ||
Object: bomber | ||
Commands: | ||
- spawn: bomb | ||
Dst: | ||
Object: [ bomb, bomber ] | ||
|
||
|
||
- Name: explode_bomb | ||
InputMapping: | ||
Inputs: | ||
1: | ||
VectorToDest: [ 0, 0 ] | ||
Internal: true | ||
Behaviours: | ||
- Src: | ||
Object: bomb | ||
Commands: | ||
- remove: true | ||
- exec: | ||
Action: propagate_explosion | ||
ActionId: 1 | ||
- exec: | ||
Action: propagate_explosion | ||
ActionId: 2 | ||
- exec: | ||
Action: propagate_explosion | ||
ActionId: 3 | ||
- exec: | ||
Action: propagate_explosion | ||
ActionId: 4 | ||
- exec: | ||
Action: propagate_explosion | ||
ActionId: 5 | ||
Dst: | ||
Object: [ bomb, bomber ] | ||
|
||
|
||
|
||
- Name: propagate_explosion | ||
InputMapping: | ||
Inputs: | ||
1: | ||
VectorToDest: [ 0,0 ] | ||
2: | ||
VectorToDest: [ 1,0 ] | ||
3: | ||
VectorToDest: [ 0,1 ] | ||
4: | ||
VectorToDest: [ -1,0 ] | ||
5: | ||
VectorToDest: [ 0,-1 ] | ||
Internal: true | ||
Behaviours: | ||
- Src: | ||
Object: [ bomb, explosion ] | ||
Dst: | ||
Object: _empty | ||
Commands: | ||
- spawn: explosion | ||
- exec: | ||
Action: propagate_explosion | ||
|
||
- Name: end_explosion | ||
InputMapping: | ||
Inputs: | ||
1: | ||
VectorToDest: [ 0, 0 ] | ||
Internal: true | ||
Behaviours: | ||
- Src: | ||
Object: explosion | ||
Commands: | ||
- remove: true | ||
Dst: | ||
Object: explosion | ||
|
||
|
||
Objects: | ||
|
||
- Name: bomber | ||
Z: 3 | ||
MapCharacter: B | ||
Observers: | ||
Block2D: | ||
- Shape: triangle | ||
Color: [ 0.0, 1.0, 0.0 ] | ||
Scale: 0.8 | ||
|
||
- Name: wall | ||
Z: 1 | ||
MapCharacter: w | ||
Observers: | ||
Block2D: | ||
- Shape: square | ||
Color: [ 0.5, 0.5, 0.5 ] | ||
Scale: 0.9 | ||
|
||
- Name: bomb | ||
Z: 2 | ||
InitialActions: | ||
- Action: explode_bomb | ||
Delay: 3 | ||
ActionId: 1 | ||
MapCharacter: x | ||
Observers: | ||
Block2D: | ||
- Shape: triangle | ||
Color: [ 0.9, 0.1, 0.1 ] | ||
Scale: 0.5 | ||
|
||
- Name: explosion | ||
Z: 1 | ||
InitialActions: | ||
- Action: end_explosion | ||
Delay: 2 | ||
ActionId: 1 | ||
|
||
- Action: propagate_explosion | ||
MapCharacter: x | ||
Observers: | ||
Block2D: | ||
- Shape: triangle | ||
Color: [ 0.9, 0.9, 0.1 ] | ||
Scale: 0.9 |
Oops, something went wrong.