Platformer player atack and npc enemy atack

I’m new to gdevelop and most of the tutorials i find are for the older version, i was hoping somoene could give a few guidelines on how to make the playable character in a platformer both atack and be atacked by npc’s, like what conditions actions and behaviours to use, or perhaps just a link to a written or video tutorial.
(also have been running into an issue with the scene preview, where it tries to load and just gives me a black screen, no idea why, if anyone knows, i’d aprecciate some help)

Thanks in advance

The black screen on preview is probably because there’s a problem with the resources, check your resources manager and search for duplicated images, images with the same name in different folders and missing images :slight_smile:

To get the platformer to attack it is “easy”, add an attack animation and a new attack_hitbox object, when the attack button is pressed switch to the attack animation and create the attack_hitbox object over the player. If an enemy comes collides with the hitbox damage it. When the attack animation is finished delete the hitbox and switch back to the stand animation.
Of course you’ve to check if you are already attacking (animation = attack) before walking or attacking, because you can’t walk nor attack if you’re attacking :wink:

The npc is more difficult, the attacking logic is the same but you’ll need some AI around, check distance to attack, attack frequency, moves while fighting?, etc.

Thank you!