I was planning on making the Octopus punch in my game. And I Did! But it was short lived, when I tried to polish it up (add sound effects and make
stars come out of the enemy) I ruined it. octopus can be killed by the enemy while standing still. but when running i can kill the enemy.
I tried to fix it by undoing what I did but it was no use.
But obviously the code I am using is not the ideal and there is a better way of doing it.
but here is my code all the same:
this is the code in the collision event with the enemy:
- Code: Select all
switch(animindex)
{
case 0:
HP--;
DestroyActor("Collide Actor");
break;
case 1:
DestroyActor("Collide Actor");
break;
}
if(HP==0)
{
DestroyActor("Event Actor");
}
- Code: Select all
if(kickright==0)
{
ChangeAnimation("Event Actor", "Player Right Attack", NO_CHANGE);
}
if(kickleft==0)
{
ChangeAnimation("Event Actor", "Player Left Attack", NO_CHANGE);
}
animindex=1;
- Code: Select all
kickright=1;
if(kickleft=1)
{
kickright=0;
}
this is a section from the event with the "left" key
- Code: Select all
}
kickleft=1;
if(kickright=1)
kickleft=0;
if that still does not make sense Ive got the ged here.
even if you can not help me fix what I have can you give me a substitute punch system that works well with HP?