You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
idea: Gun::fireAtPoint() should spawn bullets and forward them for (currentTime - lastShot - coolDownTime). Then update lastShot = lastShot + coolDownTime.
This should only happen if the player was fireing in the last frame!
Sound only needs to played once
The text was updated successfully, but these errors were encountered:
Another idea: #542 as my proposed solution for everything
GameElements would be a baseclass of Weapon and Bullet.
GameElement::updateFrequency() is the weapons frequency, so Weapon::update() is called for every bullet that needs to be spawned
GameElements have their own clock, progressed on GameElement::update(), and Bullets will be spawned with the timestamp the clock of the Weapon has when it fires that particular bullet.
The effect would be that bullets indeed would be spawned on the same position, but because their clocks have different "delays" on the next frame, they would be moved different distances.
This may sound complicated but I think once the base-architecture (=GameElement) is implemented, everything will be much easier.
I have quite some ideas for this that I will present tomorrow.
idea: Gun::fireAtPoint() should spawn bullets and forward them for (currentTime - lastShot - coolDownTime). Then update lastShot = lastShot + coolDownTime.
This should only happen if the player was fireing in the last frame!
Sound only needs to played once
The text was updated successfully, but these errors were encountered: