Hello everyone,
I'm in a bit of a pickle. I want to make the enemy attack the player but then pause for a few seconds then follow/attack again (sorta like invincible frames)
function repeatedly_execute()
{
cEnemy.FollowCharacter(player, 1, 100);
if (cEnemy.IsCollidingWithChar(player))
{
//Enemy Attacks!
player.Tint(100, 0, 0, 100, 90);
PlayerHealth -= 3; //Player takes damage
cEnemy.Animate(0, 9, eOnce, eBlock, eForwards);
cEnemy.UnlockView(eKeepMoving);
player.RemoveTint();
tickspassed = 0;
}
}
This is what I have so far(trying to keep things simple...if I can)
Any help will be greatly appreciated :)
So, if cEnemy collides with the player cEnemy animates and the player loses health..
And you want to this to repeat?
You will probably need to move the player away just a little bit from cEnemy and have cEnemy again follow player...
I think this is what you mean... Or do you mean repeat actions a few times in succession?
If cEnemy collides with player, cEnemy animates player loses health, then cEnemy can't move for a few seconds (giving the player a chance to move) then chases the player again.
I apologize if this was confusing.
Maybe have the player walk say about 10 pixels away from cEnemy and have character repeat follow.... player will then only have a very short time to run away.
Food for thought...
Is there a way to check how far cEnemy may be to the player?
Quote from: Stranga on Mon 04/11/2019 06:59:27
Is there a way to check how far cEnemy may be to the player?
You have 1 pixel follow
cEnemy.FollowCharacter(player, 1, 100);
you could add a condition if enemy x from player then run collide script.
thanks Slasher, that did the trick! :)