mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

Bullets not being destroyed in water #60

Closed mspraggs closed 9 years ago

mspraggs commented 9 years ago

I don't know if anyone else has noticed, but sometimes bullets aren't destroyed upon impact with the floor when they're fired in water. It seems to happen when the velocity of the bullets is fairly low upon impact.

Fyll commented 9 years ago

Okay I found the source of this. When they got too close to the ground friction was being applied, and slowing them down (making them stop). I've fixed this by making friction only apply to movement in the x-axis.

mspraggs commented 9 years ago

Although your change seems to have reduced the frequency of this occurring, it does still happen occassionally.

mspraggs commented 9 years ago

I fixed this by adding a condition to Bullet::update that kills the bullet if it's velocity drops below 1e-6.

Fyll commented 9 years ago

That doesn't work. That was the solution that I wrote way back when (possibly pre-revamp), but it means the bullets just die off when you shoot them straight up. I definitely had it working, but then I tweaked some stuff and pushed, so may have made it stop working again. I'll see if I can remember what I did.

Fyll commented 9 years ago

I remembered. Unfortunately, that made everything else go incredibly slowly, so I've put something else in instead that makes bullets work, and doesn't cause everything to slow down.