Call Attack animations in a Beat N UP game.

Saulus_Lira

Member
Hello.
I'm quite new to nesmaker, I've seen all the basic tutorials to start creating my project.
I'm trying to make a beatn up game in stages, as I don't have much time. This has become a little difficult for me as there is (yet) no pre-existing module for it, but with the help of everyone here, mainly from Dale_Coop, I have advanced a little on this.
I just Want Press B, and punch hits enemy.
I would like to know how do I program, calling an animation punch and the same collide and take damage from enemies?
I've seen many here based on melee sprites, but they're not helping me much.
My game moves in 8 directions, but it only has two faces, left and right.
 

dale_coop

Moderator
Staff member
You could hijack the sprite melee weapon from the Adventure module (it's a sprite that is drawn next to the player when he's on his attack state... the action step used is 2, and the sprite drawn is defined by two constant "SPR_WEAPON_V" and "SPR_WEAPON_H".
So, make you attack animation, assign it to your Action Step 2... (with a "End Animation" to "GotoFirst").
And if you follow that tutorial, your sprite weapon should make damages: http://nesmakers.com/viewtopic.php?f=35&t=1738
 

Saulus_Lira

Member
dale_coop said:
You could hijack the sprite melee weapon from the Adventure module (it's a sprite that is drawn next to the player when he's on his attack state... the action step used is 2, and the sprite drawn is defined by two constant "SPR_WEAPON_V" and "SPR_WEAPON_H".
So, make you attack animation, assign it to your Action Step 2... (with a "End Animation" to "GotoFirst").
And if you follow that tutorial, your sprite weapon should make damages: http://nesmakers.com/viewtopic.php?f=35&t=1738

Thanks Dale_Coop, always saving me.
I'll try this when I get home from work.
 

Saulus_Lira

Member
Good Morning.
I did it as directed, but I couldn't get this part to work.
I did my animation and inserted the command in Action step 2 (like example).
I had some doubts.
1) The HandleSpriteWeapon Script is pre-existing in the project, so, do I need to insert the new script in the project after modifying it?
2) How big can my animation be? I made my whole character in combat animation (melee), with about 4 frames, and I named it "Attack". Does this number of frames interfere when calling the sprite?
3) When I assign it to the player weapon, and turn it on in project properties, my character crashes. What can it be?
I thought it would be simpler to make a simple blow, but I see that I will have to burn some neurons after all, hehehehehe.

Thanks, and sorry to bother you so much about the same subject.
 

dale_coop

Moderator
Staff member
You’re doing that wrong...

In your case I suggested to use an empty Sprite for your sprite weapon... and play your player attack animation in the actual Player action step 2.

The original handle Sprite weapon script kills any enemy you will kick. You could keep it like that for testing, but I understood it’s not what you really want, you would prefer hurting the monster.
 

dale_coop

Moderator
Staff member
You could watch again the adventure tutorial video for the 4.1 to understand how the default sprite weapon work.
 

Saulus_Lira

Member
dale_coop said:
You could watch again the adventure tutorial video for the 4.1 to understand how the default sprite weapon work.

finally, I managed to understand and make it work. only got a glitch, but I'll fix it later. next step, after fixing the graph, is to put AI in the enemies. Now the game begins.
Thanks a lot dude! :D
 
Top Bottom