Melee Combat mechanics

Hello everyone!

I am a novice game developer, and I’m currently working on a sort of top down dungeon crawler. I’ve got the foundations of my game laid down, and am currently working on implementing a melee combat system. Obviously I know this topic is a little more complex than can be answered on a simple forum post. However, can anybody recommend any resources, like videos, or only tutorials that I can use for guidance. There isn’t a whole lot of outside documentation for Defold like there is for more popular game engines. Any help would be awesome!

Thanks

1 Like

If it’s a turn-based, tile-based type of game, presumably you have a table where you store what objects/enemies are in each tile. So if the player tries to move into a tile, first you check if there’s an enemy there, and if so, you can get a reference to that enemy, and then do whatever attack and damage calculations you like.

If it’s more of an action/Zelda type of thing, then you can add a Trigger collision-object on your player that rotates with the player (to face front), that will represent the attack range/sweep of the player’s weapon. Keep track of the current objects overlapping this trigger (only mask it to enemies or other destructible objects), and when the player presses the attack button, send a message to each of the overlapping objects telling them they got hit.

Some unsolicited advice: Don’t make things more complicated than they are! :slight_smile: Not everything needs a fancy “system”. Do the most stupid-simple thing you can think of first, then make it more complex if you need to. You really can’t know what you’ll need until you do it.

5 Likes