KNOCKING DOWN ENEMIES

In Double Dragon, the players and enemies walk around on a pseudo 3D map, so there isn’t really a floor or platform they walk on.

So to get them to fall down was alot trickier than it first looked. I mean this engine is designed for platformers so has jumping and falling built in but on our pseudo 3D map we don’t really have a floor so we need to do something else.

Change Actor Type

When the enemy receives a hit in the stunned position I switch to new actor that just has the fall animations. This actor has to be set up in a certain way otherwise we won’t be able to move it freely.

We have to ensure there is no collision detection on the Y axis, set the movement type to CPU and then most importantly set the speed to 0. This now overrides the Scorpions inbuilt movement code.

Initiate Fall

We then start the movement code, first setting Var1 to the current Y position, then Var5 to 6, we will use Var5 as a Y vector to move the actor up and down, decreasing it from 6 until it becomes minus.

Move Actor Position

Here we use a “While” statement to move the actor up from a starting point (Var1) into the air and back down again to the same point.

Each frame we decrease the Var5 value by 1, eventually it becomes a minus number so the actor will come back down again.

When the actor reaches the starting point (Var1) we then end the “While” statement.

Change Actor Type Back Again

Now the actor has reached the “floor” I change the type back to the main type and then change it’s animation to the Floor/Get Up animation.

Death

If the enemies health is 0 or below I play the Death animation instead.

And this is what it looks like…