Pool party
Following on from the last update, for possibly the first and last time ever, I’ve done exactly what I said I’d do for this post. I know, some form of celebration - fireworks, street party, date etched on moon with giant space laser - is in order.
Continuing on from the pooling I started last post, I’ve now got all player and enemy characters being setup by a config and using the pre-created instances using two pools - one for players, and one for everyone else. The player characters have a special pool as they can be interacted with in different ways, so it was just easier to split these two.
To handle the colouring of the teams, I load the data from a JSON file (originally meant to be YAML but Unity works natively with JSON and, err, not with YAML). The following shows a basic setup, and should provide a decent base going forward for some interesting ideas:
{
"teams": [
{
"id": 0,
"name": "npc_team_name",
"colour": "BABABF",
"group": 0
},
{
"id": 1,
"name": "player_team_name",
"colour": "74BEE0",
"group": 1
},
{
"id": 2,
"name": "first_enemy_team_name",
"colour": "EECAC0",
"group": 2
}
]
}
Lastly, as shown in the video above, I’m now handling the collisions between characters and calculating damage. Only a currently selected character can cause damage for now, so no chain reactions of damage yet - maybe as a special power in future.
When the characters hit 0 health they get removed from game, but they don’t seem to slow down the aggressor. That’s an accident but is quite cool as could lead to some interesting strategies.