I have Enemy sprite with LOS behaviour. When Enemy see Player, it charges (bullet behaviour).
My player has bullets and if a bullet hits Enemy, it should slow down (or at least that's what I'm trying to do).
I do have a var=zom_speed = 30
I think the LOS behaviour is preventing this.
Any ideas please?
Enemy has LOS to player
...Enemy bullet speed<1000 : Enemy set bullet acceleration to 500
...Else : Enemy set bullet acceleration to 0
PlayerBullet on collision with Enemy : Enemy set bullet speed to 1
So every time player bullet hits the enemy, it will stop, and then will start accelerating again, up to the maximum speed of 1000.
If you don't want it to stop, then instead of 1 you can use something like min(100, Enemy.Bullet.Speed) or (Enemy.Bullet.Speed/2)
Develop games in your browser. Powerful, performant & highly capable.