1 decade ago by sanity
I am attempting to make an idle game that can still be entertaining to interact with. To do this im using 2d type play style where you can move around but the direction in which you shoot and mob spawn is static.
The timer i need help with is getting the Fireball that you just casted, to only cast once every so many seconds. Right now i have only been able to get it to animate as a flamethrower where the Fireball is casted continuously, and where its casted for a few seconds and then stops all together.
Here is the main code for spawning the Fireball:
The timer i need help with is getting the Fireball that you just casted, to only cast once every so many seconds. Right now i have only been able to get it to animate as a flamethrower where the Fireball is casted continuously, and where its casted for a few seconds and then stops all together.
Here is the main code for spawning the Fireball:
if(this.countdown = false){ this.cast.set(0.5); this.countdown = true; } if(this.cast.delta() == 0){ if(this.countdown = true){ ig.game.spawnEntity( EntityBullet, this.pos.x + 60, this.pos.y + 40, {flip:this.flip} ); this.cast.reset(); } } else{ this.countdown = false;//conditions met reset the trigger to allow this action be triggered again }