Skip to content

Commit

Permalink
Prevent missile vel from getting reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Jun 12, 2024
1 parent 1d3b04a commit 96ca719
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/progressed/entities/bullet/pseudo3d/ArcBulletType.java
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,12 @@ public ArcBulletData(){
}

public void backMove(Bullet b){
b.vel.sub(Tmp.v1.trns(b.rotation(), accel * Time.delta));
float vSub = accel * Time.delta;
if(vSub > b.vel.len()){
b.vel.setLength(0); //Prevent rotation from being reversed
}else{
b.vel.sub(Tmp.v1.trns(b.rotation(), vSub));
}
z -= zVel * Time.delta;
zVel += gravity * Time.delta;
}
Expand Down

0 comments on commit 96ca719

Please sign in to comment.