[4.5.9 SOLVED] Jump-Thurst attack in Metroidvania/Platformer

9Panzer

Active member
So I had an idea to make Panzer (one of the playable characters in my game) suck less. CutterCross Managed to get a Jump-Thurst attack working in The Tower of Turmoil many years ago. I thought that would be a really straight forward code that would add a really cool element into my game. Unfortunately it looks like back in 4.1 the jump/stomp attack was removed and my thoughts of a simple code were dashed away! lol

I started poking around at the object collisions code and couldn't quite figure out where a check for an actionstep would go. I figured that if it could do a collision check between the mounter and the player in an unused actionstep that would do the trick. Anyone tinked with this yet?
 

Knietfeld

Member
Do you mean jump-thrust as opposed to jump-thurst? How do you imagine this attack working? You're talking about collisions, so is it something that would happen when you touch an enemy while Panzer is in a specific action step? I might be able to help but I don't understand what you're aiming for.
 

9Panzer

Active member
@Knietfeld thanks for taking a look.

I was envisioning a Zelda 2 style downthrust. So when the player holds “down” on the controller which in the air this would cause the player object to enter into action step 4. When he lands on a monster in that action step it would damage it and cause the player to “hop” up.
 

Knietfeld

Member
I haven't looked at it yet, but you might try looking at the platformer module's collisions script. I think that's where it determines if the player is jumping on top of a monster. Or maybe it's in the player hurt routine... it seems like it was somewhere I didn't expect it when I stumbled upon it last year. If you can find where it does that you could probably steal pieces if that code for the metroidvania module (if it doesn't already use it) and add in a check so it checks both that the player is on top of the monster and that the player object is in the right action step.
 

mouse spirit

Well-known member
If you just do it based on ...." if weapon is hitting monster, when player in action step 4, then Add some vertical movement.
That should achieve this.
 

9Panzer

Active member
Thanks guys,
I managed to find the section that deals with the player jumping on stuff to kill it in another module. It was in the PlayerHurt not the object collisions so I was looking in the wrong section. I started tinkering with it and got it working in my game without the actionstep check yet. This is what I have so far.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; is the monster below our feet?
;;;;;;;;;; and are we moving downward?

LDA Object_v_speed_hi,x
BEQ +doHurtPlayer ;; equal to zero
BMI +doHurtPlayer ;; or negative
;; here we are moving downward.

TXA
PHA
LDX otherObject
LDA BossDamage ;;;; check if the boss invincible timer is up.
BEQ +actuallyHurt
JMP +NoHurt
+actuallyHurt
JSR handleMonsterHurt: ;;;;; run monster hurt
+NoHurt
PLA
TAX

;; Do a hop
LDA #$FC
STA Object_v_speed_hi,x


JMP +skipHurt
 

9Panzer

Active member
Success. So now when the player holds down and B he will be put into action step 4, then on collision if the player lands on the bad guys head he will damage them and do a little bounce! :)

 
Last edited:
Top Bottom