Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,52 @@ to end without merging anything:

Staging holds the result of the last branch that was pushed, whoever pushed it.

#### 2D starters

A 2D starter can have a `theme-slots.json` too. It is optional, and maps only
the art of the game: the interface (buttons, joysticks, texts) is left out.

```json
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": { "slot": "2d.side.player", "anchor": "bottom" },
"scene:Game Scene/Coins": "2d.side.coin",
"scene:Game Scene/Platform_Ground": "2d.side.ground",
"scene:Game Scene/Ground_Tilemap": {
"slot": "2d.overhead.tilemap",
"tiles": { "0": "ground", "1": "ground.detail1", "3": "area" }
}
}
}
```

- A **sprite** maps to a sprite slot. The theme art is drawn where the
placeholder was (same origin, center and points, so events and instances are
untouched), covering the same area and never enlarged. `"anchor": "bottom"`
makes it stand on the bottom of the placeholder instead of being centered on
it, and `"fit": "width"` or `"height"` makes it take that dimension of the
placeholder.
- A **tiled sprite** or a **panel sprite** maps to a texture slot.
- A **tile map** maps to a tile map slot, with the role each of its tiles
plays: the theme gives its own atlas and the tile playing each role.
- A sprite whose animations need precise art of the theme names the
animations of the theme each one can be played by, the first found being
used: `"animations": { "Walk0": ["Walk Right", "Right"] }`.
- A sprite showing different things in its animations (the icons of an
inventory) maps each animation to its own slot instead of `slot`:
`"animationSlots": { "Rock": "2d.rpg.resource.rock", "Log": "2d.rpg.resource.log" }`.
- `"tileSize"` (64 by default, next to `"version"`) is the size of the tiles
of the starter. Pixel art, drawn for smaller tiles, is scaled by a whole
number so its tiles become these.
- Keep `requireAllSlots`: a theme then re-skins the starter only if it fills
every slot it maps, as 2D theme art next to placeholder art looks broken.

The 2D slots are named after the point of view of the starters using them
(`2d.side.*`, `2d.overhead.*`, `2d.driving.*`...), because 2D art only works
from the point of view it was drawn for.

### Gameplay tests

A game can contain _gameplay tests_: scripts that play the game like a player
Expand Down
22 changes: 22 additions & 0 deletions examples/starting-2d-car-racing/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:GameScene/PlayerCar": "2d.driving.car",
"scene:GameScene/BushObstacle": "2d.driving.obstacle",
"scene:GameScene/Road": {
"slot": "2d.driving.tilemap",
"tiles": {
"0": "ground",
"1": "ground.detail1",
"2": "ground.detail2",
"3": "area",
"4": "area",
"5": "area",
"6": "area",
"7": "area",
"8": "area"
}
}
}
}
22 changes: 22 additions & 0 deletions examples/starting-2d-driving/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:GameScene/PlayerCar": "2d.driving.car",
"scene:GameScene/BushObstacle": "2d.driving.obstacle",
"scene:GameScene/Road": {
"slot": "2d.driving.tilemap",
"tiles": {
"0": "ground",
"1": "ground.detail1",
"2": "ground.detail2",
"3": "area",
"4": "area",
"5": "area",
"6": "area",
"7": "area",
"8": "area"
}
}
}
}
14 changes: 14 additions & 0 deletions examples/starting-2d-platformer-shooter/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": {
"slot": "2d.side.player",
"anchor": "bottom"
},
"scene:Game Scene/Target": "2d.side.target",
"scene:Game Scene/Bullet": "2d.side.projectile",
"scene:Game Scene/Platform_Ground": "2d.side.ground",
"scene:Game Scene/Background": "2d.side.background"
}
}
53 changes: 53 additions & 0 deletions examples/starting-beatemup/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": {
"slot": "2d.brawler.player",
"anchor": "bottom",
"animations": {
"Idle": [
"Idle"
],
"AttackBuildUp": [
"Punch Windup"
],
"AttackStrike": [
"Kick",
"Punch"
],
"Hurt": [
"Hurt"
]
}
},
"scene:Game Scene/Enemy": {
"slot": "2d.brawler.enemy",
"anchor": "bottom",
"animations": {
"Idle": [
"Idle"
],
"AttackBuildUp": [
"Punch Windup"
],
"AttackStrike": [
"Kick",
"Punch"
],
"Hurt": [
"Hurt"
]
}
},
"scene:Game Scene/Movement_Boundary": "2d.brawler.wall",
"scene:Game Scene/GroundTilemap": {
"slot": "2d.overhead.tilemap",
"tiles": {
"0": "ground",
"1": "ground.detail1",
"2": "ground.detail2"
}
}
}
}
17 changes: 17 additions & 0 deletions examples/starting-draggable-tiles/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Unit": "2d.board.piece.a",
"scene:Game Scene/Tower": "2d.board.piece.b",
"scene:Game Scene/Tree": "2d.board.piece.c",
"scene:Game Scene/Board_Tilemap": {
"slot": "2d.board.tilemap",
"tiles": {
"0": "ground",
"1": "cell.a",
"2": "cell.b"
}
}
}
}
17 changes: 17 additions & 0 deletions examples/starting-endless-runner/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": {
"slot": "2d.side.player",
"anchor": "bottom"
},
"scene:Game Scene/Hazard": {
"slot": "2d.side.hazard",
"anchor": "bottom"
},
"scene:Game Scene/Platform_Ground": "2d.side.ground",
"scene:Game Scene/Platform_Floating": "2d.side.ground",
"scene:Game Scene/Background": "2d.side.background"
}
}
13 changes: 13 additions & 0 deletions examples/starting-flappy-bird/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": "2d.flappy.player",
"scene:Game Scene/SpikeObstacle": {
"slot": "2d.flappy.obstacle",
"fit": "height"
},
"scene:Game Scene/Boundary": "2d.flappy.ground",
"scene:Game Scene/Background": "2d.flappy.background"
}
}
11 changes: 11 additions & 0 deletions examples/starting-physics/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Background": "2d.physics.background",
"scene:Game Scene/Ground": "2d.physics.ground",
"scene:Game Scene/Ball": "2d.physics.ball",
"scene:Game Scene/Block_Light": "2d.physics.block.light",
"scene:Game Scene/Block_Heavy": "2d.physics.block.heavy"
}
}
14 changes: 14 additions & 0 deletions examples/starting-platformer-pixel/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"requireAllSlots": true,
"tileSize": 32,
"objects": {
"scene:Game Scene/Player": {
"slot": "2d.side.player",
"anchor": "bottom"
},
"scene:Game Scene/Coins": "2d.side.coin",
"scene:Game Scene/Platform_Ground": "2d.side.ground",
"scene:Game Scene/Background": "2d.side.background"
}
}
13 changes: 13 additions & 0 deletions examples/starting-platformer/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": {
"slot": "2d.side.player",
"anchor": "bottom"
},
"scene:Game Scene/Coins": "2d.side.coin",
"scene:Game Scene/Platform_Ground": "2d.side.ground",
"scene:Game Scene/Background": "2d.side.background"
}
}
30 changes: 30 additions & 0 deletions examples/starting-point-and-click-pixel/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": 1,
"requireAllSlots": true,
"tileSize": 32,
"objects": {
"scene:Game Scene/Player": {
"slot": "2d.rpg.player",
"anchor": "bottom"
},
"scene:Game Scene/Obstacle_Impassable": {
"slot": "2d.rpg.building",
"anchor": "bottom"
},
"scene:Game Scene/Water_Passable": "2d.rpg.water",
"scene:Game Scene/Ground_Tilemap": {
"slot": "2d.rpg.tilemap",
"tiles": {
"0": "ground",
"1": "ground.detail1",
"2": "ground.detail2",
"3": "area",
"4": "area",
"5": "area",
"6": "area",
"7": "area",
"8": "area"
}
}
}
}
23 changes: 23 additions & 0 deletions examples/starting-point-and-click/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": "2d.overhead.player",
"scene:Game Scene/Obstacle_Impassable": "2d.overhead.wall",
"scene:Game Scene/Water_Passable": "2d.overhead.water",
"scene:Game Scene/Ground_Tilemap": {
"slot": "2d.overhead.tilemap",
"tiles": {
"0": "ground",
"1": "ground.detail1",
"2": "ground.detail2",
"3": "area",
"4": "area",
"5": "area",
"6": "area",
"7": "area",
"8": "area"
}
}
}
}
30 changes: 30 additions & 0 deletions examples/starting-rts-unit-selection/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/RTSUnit": {
"slot": "2d.rts.unit",
"anchor": "bottom"
},
"scene:Game Scene/Building": {
"slot": "2d.rts.building",
"anchor": "bottom"
},
"scene:Game Scene/Water_Passable": "2d.rts.water",
"scene:Game Scene/Collision_Impassable": "2d.rts.blocked",
"scene:Game Scene/Ground_Tilemap": {
"slot": "2d.rts.tilemap",
"tiles": {
"0": "ground",
"1": "ground.detail1",
"2": "ground.detail2",
"3": "area",
"4": "area",
"5": "area",
"6": "area",
"7": "area",
"8": "area"
}
}
}
}
11 changes: 11 additions & 0 deletions examples/starting-shootemup/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/Player": "2d.shooter.player",
"scene:Game Scene/Enemy": "2d.shooter.enemy",
"scene:Game Scene/PlayerBullet": "2d.shooter.projectile.player",
"scene:Game Scene/EnemyBullet": "2d.shooter.projectile.enemy",
"scene:Game Scene/RepeatingBackground": "2d.shooter.background"
}
}
37 changes: 37 additions & 0 deletions examples/starting-tile-placement/theme-slots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": 1,
"requireAllSlots": true,
"objects": {
"scene:Game Scene/TilePlacement_Indicator": {
"animationSlots": {
"Unit": "2d.board.piece.a",
"Tower": "2d.board.piece.b",
"Tree": "2d.board.piece.c"
}
},
"scene:Game Scene/TileType_Button": {
"animationSlots": {
"Unit": "2d.board.piece.a",
"Tower": "2d.board.piece.b",
"Tree": "2d.board.piece.c"
}
},
"scene:Game Scene/Unit": "2d.board.piece.a",
"scene:Game Scene/Tower": "2d.board.piece.b",
"scene:Game Scene/Tree": "2d.board.piece.c",
"scene:Game Scene/Ground_Tilemap": {
"slot": "2d.rts.tilemap",
"tiles": {
"0": "ground",
"1": "ground.detail1",
"2": "ground.detail2",
"3": "area",
"4": "area",
"5": "area",
"6": "area",
"7": "area",
"8": "area"
}
}
}
}
Loading
Loading