Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Integration #19

Open
11 of 23 tasks
naofireblade opened this issue Mar 20, 2018 · 4 comments
Open
11 of 23 tasks

Map Integration #19

naofireblade opened this issue Mar 20, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@naofireblade
Copy link
Collaborator

naofireblade commented Mar 20, 2018

Maps with their config and assets should be added in their own folders. Thus they can be easily added to the game.

  • Config
    • Key (should be the map folder)
    • Name
    • Lives
    • Layers (Array)
      • Type (graphics / waypoints / buildings)
      • Start (optional sprite that refers to start point)
      • Way (optional sprite that refers to a waypoint (not start/end))
      • End (optional sprite that refers to end point)
      • Blocked (optional sprite that refers to a tile that is blocked for buildings)
    • Waves (Array)
      • Enemies (Array)
        • Layer
        • Delay
        • Type
        • Health
        • Amount
        • Points
        • Speed
        • Spawn interval
  • Assets
    • properties.json
    • spritesheet.png
    • tilemap.json
    • animation.json
@naofireblade naofireblade added enhancement New feature or request help wanted Extra attention is needed labels Mar 20, 2018
@naofireblade
Copy link
Collaborator Author

naofireblade commented Mar 21, 2018

Updated: Added array of layers that describe waypoints and graphics. Each layer will be rendered above the previous one. Each element of the layers array referes to an element of the tilemap layers array.

@naofireblade
Copy link
Collaborator Author

naofireblade commented Mar 21, 2018

Example config:

{
	"name": "Train",
	"lives": 10,
	"layers": [
		{
			"type": "graphics"
		},
		{
			"type": "waypoints",
			"start": 1,
			"way": 2,
			"end": 3
		},
		{
			"type": "waypoints",
			"start": 11,
			"way": 12,
			"end": 13
		},
		{
			"type": "buildings",
			"blocked": 1
		},
		{
			"type": "graphics"
		}
	],
	"waves": [
		{
			"enemies": [
				{
					"layer": 1,
					"delay": null,
					"type": "Steam Loco",
					"health": 50,
					"amount": 5,
					"points": 10,
					"speed": 30,
					"spawnInterval": 1000
				},
				{
					"layer": 2,
					"delay": 3000,
					"type": "Steam Loco Small",
					"health": 10,
					"amount": 10,
					"points": 2,
					"speed": 50,
					"spawnInterval": 1000
				}
			]
		},
		{
			"enemies": [
				{
					"layer": 1,
					"delay": null,
					"type": "Electric Loco",
					"health": 50,
					"amount": 5,
					"points": 10,
					"speed": 30,
					"spawnInterval": 2000
				}
			]
		}
	]
}

@naofireblade
Copy link
Collaborator Author

naofireblade commented Mar 23, 2018

Updated: Added layer type "buildings" and option "blocked" to define which tiles cannot be build upon. All towers will be build on the layer. Only one buildings layer is allowed. Graphic and Enemys layers after the buildings layer will be rendered on top of the buildings.

@naofireblade
Copy link
Collaborator Author

naofireblade commented Mar 23, 2018

Updated: Converted enemy object to array. Moved layer and delay option into enemies entry instead of wave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant