Hi,
When i use PlaySprite in my function, my sprite position have been changed without reason.
The following code is the only place when i change position sprite, without initialisation.
When i comment PlaySprite, all move is fine, but when i uncomment him, sometimes sprites is moved. Why ?
Tween works
ant_x = GetSpriteX(ant_sprite)
ant_y = GetSpriteY(ant_sprite)
new_x = ant_x + coordonnee_x
new_y = ant_y + coordonnee_y
if (position_sprite_anthill_type.grass_1[new_x/32,new_y/32] = 0)
if (GetSpritePlaying(ant_sprite) = 0)
PlaySprite(ant_sprite)
endif
if (ant_x <> new_x or ant_y <> new_y)
SetTweenSpriteX(ant_tween, ant_x, new_x, TweenLinear())
SetTweenSpriteY(ant_tween, ant_y, new_y, TweenLinear())
PlayTweenSprite(ant_tween, ant_sprite, 0)
endif
endif