Better bullet range calc
This commit is contained in:
@@ -199,7 +199,7 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
|
|
||||||
/** Returns maximum distance the bullet this bullet type has can travel. */
|
/** Returns maximum distance the bullet this bullet type has can travel. */
|
||||||
public float range(){
|
public float range(){
|
||||||
return Math.max(speed * lifetime * (1f - drag), maxRange);
|
return Mathf.zero(drag) ? speed * lifetime : Math.max(speed * (1f - Mathf.pow(1f - drag, lifetime)) / drag, maxRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return continuous damage in damage/sec, or -1 if not continuous. */
|
/** @return continuous damage in damage/sec, or -1 if not continuous. */
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ public class LiquidBulletType extends BulletType{
|
|||||||
this(null);
|
this(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public float range(){
|
|
||||||
return speed * lifetime / 2f;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Bullet b){
|
public void update(Bullet b){
|
||||||
super.update(b);
|
super.update(b);
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ android.useAndroidX=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
http.socketTimeout=80000
|
http.socketTimeout=80000
|
||||||
http.connectionTimeout=80000
|
http.connectionTimeout=80000
|
||||||
archash=e982971b17f48c13f3a18c344b8080b7498cccf6
|
archash=c6da2092c281d948c7864f22385575184f82e4b4
|
||||||
|
|||||||
Reference in New Issue
Block a user