Hello guys,
i really dont know, why my animation starts if my player.x is < 300, because I wrote if player.x >300. What am I doing wrong? :confused:
function room_RepExec()
{
// animation zombie
if (player.x >=300) {
oZombieFenster.SetView(13, 0);
oZombieFenster.Animate(0, 5, eRepeat, eNoBlock, eForwards);
}
If I turn the code to player.x <300, the animation is right. But it makes no sense :/
I am using the current beta 3.4.1 - Thanks so far
derrikk
The problem might be that you trigger the animation every game loop (normally 40 times a second). So the animation can only proceed when the player walks off the area that is > 300 (and the animation is not triggered again).
Does this work?:
if (player.x >= 300 && !oZombieFenster.Animating) {
oZombieFenster.SetView(13, 0);
oZombieFenster.Animate(0, 5, eRepeat, eNoBlock, eForwards);
}
hey,
thank u very much for ur reply. Yes that works perfect! If i understand this correctly, the problem was that i didnt tell ags to start animation only if its not animated already?
Thanks again.
Exactly, !oZombieFenster.Animating is the same as oZombieFenster.Animating == false.
With (player.x >=300) as the only condition and the animation being non-blocking, the animation just keeps getting started and is never able to be played, unless player.x is < 300.
wow thank u so much for ur help, I really appreciate it. Now it makes sense again :-D.