Shoot at the same distance
UltraLionBlu
Member Posts: 157
Hello everyone! I have a spaceship that shoots to the right
If I stand still and shoot I get the effect I want, one shot after another at the right distance.
The problem comes when I shoot while going forward or backward.
Forwards the bullets are closer together, backwards much further apart.
This obviously depends on the proximity or distance of the spacecraft from the first shot to the moment of the second.
However, this is usually not noticed in games, but I couldn't figure out how to fix this effect. Is there any magic trick I'm missing?
Comments
The behavior you are describing makes sense. If your projectile launches at a constant speed and you're moving, then you will close or increase the distance between player and then projectiles.
Watching some walkthroughs of old an new games I notices a few things.
So I suggest you can do one of two things. Shoot burst or blurred shots (cuphead) that move quickly or add the player's velocity to the bullets and limit their lifetime.
I'm not sure if this will work, but try creating a player velocity game level attribute(s) and constrain it to the player's velocity. Then make movement speed an equation that adds the player's velocity? It's will be weird physics wise, but it should get your desired effect.
Thanks adent42 my solution for now has been to adjust the firing frequency differently according to the movements of the spaceship, maybe you could also get a more precise and better effect, but I'm very close to what I was looking for :)
In any case, the effect I wanted would have been the precise one, such as in X Out
https://www.youtube.com/watch?v=r7Q9vKjPSNY
If anyone has a better idea, to make it happen precisely ..: D