Space Grunts 2 DEVLOG #4 – Interface and mouse controls

Space Grunts 2 DEVLOG #4 – Interface and mouse controls

As mentioned in the video, these written blogs dive a little deeper into some of the technical aspects of this game’s development stuff.

Also, I can now say with 100% certainty that the Steam page is up!

So these devlogs will also be posted there, and you can of course wishlist it ASAP!

Now.. back to the dev-talk: one thing I didn’t talk about in the video was signal-maps. I’m still a bit new to the whole turn-based game loop handling and the best way to do things, but so far I’m just using a few data maps on-top of the tile map to handle various things. I already had a monsterDamage map, a playerDamage map and this week I decided to add a signalMap to it.

The signal map is used, as you might guess, to register signals. And the signals are simple values between 0 (no signal) and 100 (loud signal). I changed all the monster AI code to now focus on the nearest, and loudest signal instead of just honing in on the player’s location. The player now always spawns a 80 signal on the player-location, so if nothing else is there or louder (a 100 signal), the monsters will still hunt you down.. BUT the whole reason for adding this map was the various devices and items I wanted to add, the first of which is the Signal-Bomb.  This will transmit a signal to the surrounding tiles and thus attract monsters.

As mentioned in the video I also implemented mouse-controls, and for this one I simply borrowed the Space Grunts 1 code, but to be fair, it’s just the fairly standard A* pathfinding. So when you move the mouse, the game will do a quick pathfinding call from the mouse pointer back to the player’s tile. If you then click on that tile, the path is used to decide the movement of the player – still calling the default code for it’s left,right,up,down triggers that you’d normally get from keyboard or gamepad, but now based on where the next tile in the path is located.

I figured re-writing it didn’t add much value, because I’d still end up with the exact same code! :)

Besides those major changes, I also implemented the code to correctly blow up walls with bombs (when allowed) which is mostly just removing walls around the bomb-entity and adding some special effects and a new floor-texture.

Come live chat with the developer and other gamers, get exclusive information on new games, features, discounts and BETA access! Join Discord: https://discord.gg/orangepixel