1 decade ago by ajainvivek
Hi All,
I am developing a game where the biker riding entity is swapped with biker exhaust entity when heat meter is full. I have created a dot entity in the biker so the collision is set to the dot. The dot entity is set along with biker riding entity. At the current point i want the dot entity velocity to be set to 0 ,until the exhaust frame is over then swap with biker riding entity .but i am unable to set the dot velocity to 0 for particular time.
I have put down the code
I am developing a game where the biker riding entity is swapped with biker exhaust entity when heat meter is full. I have created a dot entity in the biker so the collision is set to the dot. The dot entity is set along with biker riding entity. At the current point i want the dot entity velocity to be set to 0 ,until the exhaust frame is over then swap with biker riding entity .but i am unable to set the dot velocity to 0 for particular time.
I have put down the code
if(ig.input.state('right')) { this.exhaustTimer.set(4); //set the timer if(heat.anims.run.frame == 97 ) //condition when entity is spawned { ig.game.spawnEntity( EntityPlayer_exhaust, this.pos.x ,this.pos.y-50 ); if(this.exhaustTimer.delta() >= -4 && this.exhaustTimer.delta() <= -1 ) { this.vel.x = 0; } } // how do i set the velocity to 0 }