ill show you how to make him strike and go off screen.
on collision hit your atack
- Code: Select all
angle=direction( ennemy player.x, ennemyplayer.y, yourplayer.x, yourplayer.y)+180;\\opposite angle from the striking
directional_velocity=(ennemyhealth/10)+4;\\making him fly depending the percent(this is for the percentage that gos from 0 to 100%, you shouuld do that!)
int striking;
striking=1;
ennemyhealth+=9+rand(6);\\ increasing the damage ratio
in draw actor
- Code: Select all
if(striking)
{
directional_velocity*=0.06;
}
on collision whit the ground (note, remove the physical respond if there is currently one)
- Code: Select all
if(striking)
{
angle+=180;\\to make a richochet effect
}
else
{
physicalrespond action here*\\the physical respond if only standing, moving...
}
Note:
you must have a variable of the ennemy health
on the damge ratio text in draw actor:
- Code: Select all
textNumber=ennemyhealth;\\making the text the same as the ennemy health
in create actor:
- Code: Select all
ennemyhealth=0;\\changing var at start of battle