Well, this is something I can't solve.
I have a character roaming around the screen (an enemy)
When this character's y coordinate and player character's y coordinate are the same, the enemy character starts walking to the player character.
That works.
When the player character kicks the enemy character, a variable (player's strengt) y subtracted to another variable (enemy's health). When enemy's health reaches 0 or less, the enemy dies, playing an animation, and this is the problem. the enemy character stays running that animation once time and another. The problem is not that ive wrote wrong the parameters when implementing the character.Animate, because I wrote this:
else if (pjs[1].evit <= 0) {
if (cZombie.View != 19){
cZombie.LockView(18);
cZombie.Animate(cZombie.loop, 4, eOnce, eBlock, eForwards);
cZombie.Solid = false; // this allows the player to walk through the enemy
cZombie.FollowCharacter(null, 0, 0); //this makes the enemy stop following the player
cZombie.UnlockView();
cZombie.ChangeView(19); //Finally this makes the enemy change its view.
}
But it looks like the script ignores UnlockView and ChangeView, because it never reaches View 19.
Can anyone explain me what happens, please?
I have a character roaming around the screen (an enemy)
When this character's y coordinate and player character's y coordinate are the same, the enemy character starts walking to the player character.
That works.
When the player character kicks the enemy character, a variable (player's strengt) y subtracted to another variable (enemy's health). When enemy's health reaches 0 or less, the enemy dies, playing an animation, and this is the problem. the enemy character stays running that animation once time and another. The problem is not that ive wrote wrong the parameters when implementing the character.Animate, because I wrote this:
else if (pjs[1].evit <= 0) {
if (cZombie.View != 19){
cZombie.LockView(18);
cZombie.Animate(cZombie.loop, 4, eOnce, eBlock, eForwards);
cZombie.Solid = false; // this allows the player to walk through the enemy
cZombie.FollowCharacter(null, 0, 0); //this makes the enemy stop following the player
cZombie.UnlockView();
cZombie.ChangeView(19); //Finally this makes the enemy change its view.
}
But it looks like the script ignores UnlockView and ChangeView, because it never reaches View 19.
Can anyone explain me what happens, please?