Gamdev blog 6: Threat indicators

in #gamedev7 years ago

Over the past week I did a bit of work on the game, but there isn't that much new to show for it, as most of the stuff was behind the scenes.

Bug squashing

First thing I did was add some enemies. The code was largely in place already, as I wrote it back when I made the roguelike core and pathfinding. When I added them, I gave them a simple red circle sprite to show where they are, and checked if the pathfinding worked. It did, but there was an issue, as soon as they were in the same room, they started showing errors.

--**technobabble **
Looking at the code, I found out the problem.

I was storing the BoardPosition of each actor in a Dictionary with a key of a vector and a value of a BoardPosition. Since the Dictionary doesn't allow duplicates, it means where a new actor moved into a position with another actor, it overrode it. This is because when I designed roguelike core I designed it with a traditional roguelike in mind, meaning one entity per position. But my current design is one where each position is a room, and each room can have multiple actors. So I changed it to have a key of a vector and a value of a list of board positions, meaning more than one actor can be in each vector position.

There are a bunch more code changes, but I wouldn't want to overdue the technical bits.

--**End of technobabble **

Threat

After fixing that bit, I went on to create an EnemyDisplayManager to handle showing where the enemies are. I gave each enemy a threat meter, which I will set manually. The EnemyDisplayManager will tally the amount of threat in a room, and display a red circle with a size according to the amount of threat.

As you can see, as the enemies converge and get into the same room, the threat indicator grows in size.

Up next, I want to do the shadow on the rooms as per the mockup. Shading rooms you can move to slightly, and all other rooms even further.
After that, if the player is in the same room as enemies, show more specific information on the left. Which enemies, etc.
And lastly, add a button to attack, and make sure enemies attack back and everything works as it should.

Thanks for reading, it keeps me motivated.

If you've missed my previous posts, here they are:
Gamedev blog 1: Brewing an idea
Gamedev blog 2: Birthing pains
Gamedev blog 3: It’s checklist time
Gamedev blog 4: The world
Gamedev blog 5: Mockup

Coin Marketplace

STEEM 0.15
TRX 0.12
JST 0.026
BTC 56787.81
ETH 2507.96
USDT 1.00
SBD 2.24