different actionsteps for different kinds of hurt/death

Levty87

New member
Hi guys, I have another question. I'm making a metrovania platformgame. My player can jump on my enemies and when they die that way you see a deathanimation for a second and a halve before they get destroyed. this is set up in actionstep 6 because 7 is reserved for something else and has a recoil that I can't seem to turn off.
I have two other ways to die.
1. is by shooting
2. is by exploding

each way is supposed to have his own death/hit animation set up in the same monster actionsteps. But each monster has different sprites. So how do I set this up? Is there for example a way to check if it's a death by jumping, shooting, or exploding so that you can assign different actionsteps to them? And also how do I give them more strength especially when you shoot them? Now they disappear or have the jump on- death animation.

I have reserved actionstep 5 for the post explosion animation, 7 for the hit by shooting animation.
'Projectile source' is my shooting projectile. 'Effect 0' is my bombexplosion. When I get to it, I'm planning of setting the bomb up like Joe did in the advanced adventure tutorial.

It would be very helpful if I got this to work. Platformgames are definitely more fun when they are well animated. :)
 

Peter Schmitz

Active member
you could set up a collision check: if player is hit by/ collides with the projectile object -> change action step to 7, if it collides with the bomb explosion object -> change action step to 5
 

Levty87

New member
Sounds logical. Am I right when I see this has to be in the handle monsterhurtscript? What does this look like in code? How do I write it?
 

Peter Schmitz

Active member
Hi - had to meddle around a bit:

try this:

1) open project settings and go to register 'UserVariables'
2) add a new variable called 'Death'
3) open doHandleObjectCollisions_PlatformerBase.asm
4) add these line around line 89 right after +isWeapon
Code:
lda Object_type,x
            cmp #02  ;weapon projectile source  - game object #02
            bne +nextWeapon
            lda #$07   ; action step 7
            sta Death
            jmp +skip
           
            +nextWeapon
            cmp #08 ; game object #08 - Effect 0 -depends on where you're bomb explosion is
            lda #$05  ; action step 5
            sta Death
            bne +skip
           
            +skip

4.5) line 118 - comment DestroyObject -> otherwise the monster got destroyed before activating any action steps
5) open hurtMonster_PlatformBase.asm
6) delete DestroyObject in line 14 and insert ChangeActionStep temp, Death
7) set up you're action steps - timer and destroy object
 
Last edited:

Levty87

New member
At first glance it works. :D I'll have to test it for a bit. Now I'm having trouble setting up my bombs. I was planning on doing it like Joe did in the adventure tutorials, but I'm working in metrovania so some things work differently šŸ˜….. Anyway SUPERTANX Peter!
 
Top Bottom