Implement default values and have annotated docs for what the default values are.
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
e9c5eee978
commit
4e0aaca35a
@ -20,12 +20,12 @@ public class Erinoah extends PhysicsObject{
|
||||
setAccelerationLimits(100, 100);
|
||||
setVelocityLimits(500, 500);
|
||||
setGroundDrag(2000);
|
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION);
|
||||
setGroundFriction(PhysicsObject.GROUND_FRICTION);
|
||||
setAirDrag(800);
|
||||
setAirFriction(180);
|
||||
setSlidingVelocity(164);
|
||||
setSlidingAcceleration(120);
|
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY);
|
||||
setJumpVelocity(PhysicsObject.JUMP_VELOCITY);
|
||||
setGravity(450);
|
||||
}
|
||||
|
||||
|
@ -60,16 +60,16 @@ public class Player extends PhysicsObject{
|
||||
super(Sprite.ERINA, 5, panel);
|
||||
setX(RabiClone.BASE_WIDTH / 2 - getAnimatedSpr().getWidth() / 2);
|
||||
setY(RabiClone.BASE_HEIGHT * (2 / 3d) - getAnimatedSpr().getHeight() / 2);
|
||||
setAccelerationLimits(100, 100);
|
||||
setVelocityLimits(246, 500);
|
||||
setGroundDrag(2000);
|
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION);
|
||||
setAirDrag(900);
|
||||
setAirFriction(180);
|
||||
setSlidingVelocity(164);
|
||||
setSlidingAcceleration(120);
|
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY);
|
||||
setGravity(1300);
|
||||
setAccelerationLimits_UseDefaultStrategy();
|
||||
setVelocityLimits_UseDefaultStrategy();
|
||||
setGroundDrag_UseDefaultStrategy();
|
||||
setGroundFriction_UseDefaultStrategy();
|
||||
setAirDrag_UseDefaultStrategy();
|
||||
setAirFriction_UseDefaultStrategy();
|
||||
setSlidingVelocity_UseDefaultStrategy();
|
||||
setSlidingAcceleration_UseDefaultStrategy();
|
||||
setJumpVelocity_UseDefaultStrategy();
|
||||
setGravity_UseDefaultStrategy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -117,8 +117,8 @@ public class Player extends PhysicsObject{
|
||||
break;
|
||||
}
|
||||
|
||||
jump_velocity = PhysicsObject.NORMAL_JUMP_VELOCITY;
|
||||
horizontal_friction = PhysicsObject.NORMAL_FRICTION;
|
||||
jump_velocity = PhysicsObject.JUMP_VELOCITY;
|
||||
horizontal_friction = PhysicsObject.GROUND_FRICTION;
|
||||
jump_slide_fall_StartAnimationTimer = -1;
|
||||
|
||||
if (x_velocity != 0) {
|
||||
|
@ -9,15 +9,36 @@ import sig.map.Tile;
|
||||
|
||||
public abstract class PhysicsObject extends AnimatedObject implements PhysicsObjectRequirements{
|
||||
final public static double GRAVITY = 1300;
|
||||
final public static double NORMAL_FRICTION = 6400;
|
||||
final public static double NORMAL_JUMP_VELOCITY = -300;
|
||||
final public static double WALKING_SPEED_LIMIT = 164;
|
||||
final public static double FALLING_SPEED_LIMIT = 500;
|
||||
final public static byte MAX_JUMP_COUNT = 2;
|
||||
final public static double GROUND_FRICTION = 6400;
|
||||
final public static double AIR_FRICTION = 180;
|
||||
final public static double JUMP_VELOCITY = -300;
|
||||
final public static double LAND_WALKING_SPEED_LIMIT = 164;
|
||||
final public static double LAND_FALLING_SPEED_LIMIT = 500;
|
||||
final public static double X_VELOCITY_LIMIT = 246;
|
||||
final public static double Y_VELOCITY_LIMIT = 500;
|
||||
final public static double X_ACCELERATION_LIMIT = 100;
|
||||
final public static double Y_ACCELERATION_LIMIT = 100;
|
||||
final public static double GROUND_DRAG = 2000;
|
||||
final public static double AIR_DRAG = 900;
|
||||
final public static double SLIDING_VELOCITY = 164;
|
||||
final public static double SLIDING_ACCELERATION = 120;
|
||||
|
||||
final public static double UNDERWATER_GRAVITY = 300;
|
||||
final public static double UNDERWATER_NORMAL_FRICTION = 3200;
|
||||
final public static double UNDERWATER_NORMAL_JUMP_VELOCITY = -900;
|
||||
final public static byte UNDERWATER_MAX_JUMP_COUNT = 3;
|
||||
final public static double UNDERWATER_GROUND_FRICTION = 3200;
|
||||
final public static double UNDERWATER_AIR_FRICTION = 120;
|
||||
final public static double UNDERWATER_JUMP_VELOCITY = -900;
|
||||
final public static double UNDERWATER_WALKING_SPEED_LIMIT = 76;
|
||||
final public static double UNDERWATER_FALLING_SPEED_LIMIT = 300;
|
||||
final public static double UNDERWATER_X_VELOCITY_LIMIT = 120;
|
||||
final public static double UNDERWATER_Y_VELOCITY_LIMIT = 250;
|
||||
final public static double UNDERWATER_X_ACCELERATION_LIMIT = 50;
|
||||
final public static double UNDERWATER_Y_ACCELERATION_LIMIT = 50;
|
||||
final public static double UNDERWATER_GROUND_DRAG = 1700;
|
||||
final public static double UNDERWATER_AIR_DRAG = 1100;
|
||||
final public static double UNDERWATER_SLIDING_VELOCITY = 192;
|
||||
final public static double UNDERWATER_SLIDING_ACCELERATION = 164;
|
||||
|
||||
public State state = State.IDLE;
|
||||
public double x_velocity;
|
||||
@ -37,6 +58,7 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj
|
||||
protected double horizontal_air_friction,horizontal_air_drag;
|
||||
protected double horizontal_friction,horizontal_drag;
|
||||
protected double sliding_velocity,sliding_acceleration;
|
||||
protected double walking_speed_limit,falling_speed_limit;
|
||||
|
||||
/* LAND is for all values pertaining to being on land. Stored because our active physics values CAN (and probably will) change!
|
||||
* Therefore these are storage containers for what the real values used are.
|
||||
@ -296,7 +318,7 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj
|
||||
}
|
||||
|
||||
private void handleKeyboardMovement(double updateMult, int movement, double friction, double drag) {
|
||||
if (movement != 0 && Math.abs(x_velocity) < WALKING_SPEED_LIMIT) {
|
||||
if (movement != 0 && Math.abs(x_velocity) < walking_speed_limit) {
|
||||
x_acceleration = drag * (movement);
|
||||
} else {
|
||||
if (x_velocity != 0) {
|
||||
@ -338,6 +360,8 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj
|
||||
horizontal_drag=UNDERWATER_horizontal_drag;
|
||||
sliding_velocity=UNDERWATER_sliding_velocity;
|
||||
sliding_acceleration=UNDERWATER_sliding_acceleration;
|
||||
walking_speed_limit=UNDERWATER_WALKING_SPEED_LIMIT;
|
||||
falling_speed_limit=UNDERWATER_FALLING_SPEED_LIMIT;
|
||||
underwaterState=true;
|
||||
} else
|
||||
if (!isUnderwater()&&underwaterState) {
|
||||
@ -352,6 +376,8 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj
|
||||
horizontal_drag=LAND_horizontal_drag;
|
||||
sliding_velocity=LAND_sliding_velocity;
|
||||
sliding_acceleration=LAND_sliding_acceleration;
|
||||
walking_speed_limit=LAND_WALKING_SPEED_LIMIT;
|
||||
falling_speed_limit=LAND_FALLING_SPEED_LIMIT;
|
||||
underwaterState=false;
|
||||
}
|
||||
}
|
||||
@ -364,6 +390,38 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj
|
||||
this.UNDERWATER_y_velocity_limit=underwaterYVelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param xVelocity The X velocity limit to set for land and water.
|
||||
* @param yVelocity The Y velocity limit to set for land and water.
|
||||
*/
|
||||
public void setVelocityLimits_UseCopyStrategy(double xVelocity,double yVelocity) {
|
||||
setVelocityLimits(xVelocity, yVelocity, xVelocity, yVelocity);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param xVelocity The X velocity limit to set for land.
|
||||
* @param yVelocity The Y velocity limit to set for land.
|
||||
*/
|
||||
public void setVelocityLimits_UseHalfStrategy(double xVelocity,double yVelocity) {
|
||||
setVelocityLimits(xVelocity, yVelocity, xVelocity/2, yVelocity/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>X Velocity Limit:</b> {@value #X_VELOCITY_LIMIT}</li>
|
||||
* <li><b>Y Velocity Limit:</b> {@value #Y_VELOCITY_LIMIT}</li>
|
||||
* <li><b>Underwater X Velocity Limit:</b> {@value #UNDERWATER_X_VELOCITY_LIMIT}</li>
|
||||
* <li><b>Underwater Y Velocity Limit:</b> {@value #UNDERWATER_Y_VELOCITY_LIMIT}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setVelocityLimits_UseDefaultStrategy() {
|
||||
setVelocityLimits(X_VELOCITY_LIMIT,Y_VELOCITY_LIMIT,UNDERWATER_X_VELOCITY_LIMIT,UNDERWATER_Y_VELOCITY_LIMIT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccelerationLimits(double xAccelerationLimit,double yAccelerationLimit,double underwaterXAccelerationLimit,double underwaterYAccelerationLimit) {
|
||||
this.LAND_x_acceleration_limit=xAccelerationLimit;
|
||||
@ -372,60 +430,345 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj
|
||||
this.UNDERWATER_y_acceleration_limit=underwaterYAccelerationLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param xAcceleration The X acceleration limit to set for land and water.
|
||||
* @param yAcceleration The Y acceleration limit to set for land and water.
|
||||
*/
|
||||
public void setAccelerationLimits_UseCopyStrategy(double xAcceleration,double yAcceleration) {
|
||||
setAccelerationLimits(xAcceleration, yAcceleration, xAcceleration, yAcceleration);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param xAcceleration The X acceleration limit to set for land.
|
||||
* @param yAcceleration The Y acceleration limit to set for land.
|
||||
*/
|
||||
public void setAccelerationLimits_UseHalfStrategy(double xAcceleration,double yAcceleration) {
|
||||
setAccelerationLimits(xAcceleration, yAcceleration, xAcceleration/2, yAcceleration/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>X Acceleration Limit:</b> {@value #X_ACCELERATION_LIMIT}</li>
|
||||
* <li><b>Y Acceleration Limit:</b> {@value #Y_ACCELERATION_LIMIT}</li>
|
||||
* <li><b>Underwater X Acceleration Limit:</b> {@value #UNDERWATER_X_ACCELERATION_LIMIT}</li>
|
||||
* <li><b>Underwater Y Acceleration Limit:</b> {@value #UNDERWATER_Y_ACCELERATION_LIMIT}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setAccelerationLimits_UseDefaultStrategy() {
|
||||
setAccelerationLimits(X_ACCELERATION_LIMIT,Y_ACCELERATION_LIMIT,UNDERWATER_X_ACCELERATION_LIMIT,UNDERWATER_Y_ACCELERATION_LIMIT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaxJumpCount(byte jumps,byte underwaterJumps) {
|
||||
this.LAND_maxJumpCount=jumps;
|
||||
this.UNDERWATER_maxJumpCount=underwaterJumps;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param maxJumpCount The max jump count to set for land and water.
|
||||
*/
|
||||
public void setMaxJumpCount_UseCopyStrategy(byte maxJumpCount) {
|
||||
setMaxJumpCount(maxJumpCount,maxJumpCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param maxJumpCount The max jump count to set for land.
|
||||
*/
|
||||
public void setMaxJumpCount_UseHalfStrategy(byte maxJumpCount) {
|
||||
setMaxJumpCount(maxJumpCount,(byte)(maxJumpCount/2));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Max Jump Count:</b> {@value #MAX_JUMP_COUNT}</li>
|
||||
* <li><b>Underwater Max Jump Count:</b> {@value #UNDERWATER_MAX_JUMP_COUNT}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setMaxJumpCount_UseDefaultStrategy() {
|
||||
setMaxJumpCount(MAX_JUMP_COUNT,UNDERWATER_MAX_JUMP_COUNT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroundFriction(double groundFriction,double underwaterGroundFriction) {
|
||||
this.LAND_horizontal_friction=groundFriction;
|
||||
this.UNDERWATER_horizontal_friction=underwaterGroundFriction;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param groundFriction The ground friction to set for land and water.
|
||||
*/
|
||||
public void setGroundFriction_UseCopyStrategy(double groundFriction) {
|
||||
setGroundFriction(groundFriction,groundFriction);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param groundFriction The ground friction to set for land.
|
||||
*/
|
||||
public void setGroundFriction_UseHalfStrategy(double groundFriction) {
|
||||
setGroundFriction(groundFriction,groundFriction/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Ground Friction</b> {@value #GROUND_FRICTION}</li>
|
||||
* <li><b>Underwater Ground Friction:</b> {@value #UNDERWATER_GROUND_FRICTION}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setGroundFriction_UseDefaultStrategy() {
|
||||
setGroundFriction(GROUND_FRICTION,UNDERWATER_GROUND_FRICTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAirFriction(double airFriction,double underwaterAirFriction) {
|
||||
this.LAND_horizontal_air_friction=airFriction;
|
||||
this.UNDERWATER_horizontal_air_friction=underwaterAirFriction;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param airFriction The air friction to set for land and water.
|
||||
*/
|
||||
public void setAirFriction_UseCopyStrategy(double airFriction) {
|
||||
setAirFriction(airFriction,airFriction);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param airFriction The air friction to set for land.
|
||||
*/
|
||||
public void setAirFriction_UseHalfStrategy(double airFriction) {
|
||||
setAirFriction(airFriction,airFriction/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Air Friction</b> {@value #AIR_FRICTION}</li>
|
||||
* <li><b>Underwater Air Friction:</b> {@value #UNDERWATER_AIR_FRICTION}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setAirFriction_UseDefaultStrategy() {
|
||||
setAirFriction(AIR_FRICTION,UNDERWATER_AIR_FRICTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGroundDrag(double groundDrag,double underwaterGroundDrag) {
|
||||
this.LAND_horizontal_drag=groundDrag;
|
||||
this.UNDERWATER_horizontal_drag=underwaterGroundDrag;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param groundDrag The ground drag to set for land and water.
|
||||
*/
|
||||
public void setGroundDrag_UseCopyStrategy(double groundDrag) {
|
||||
setGroundDrag(groundDrag,groundDrag);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param groundDrag The ground drag to set for land.
|
||||
*/
|
||||
public void setGroundDrag_UseHalfStrategy(double groundDrag) {
|
||||
setGroundDrag(groundDrag,groundDrag/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Ground Drag</b> {@value #GROUND_DRAG}</li>
|
||||
* <li><b>Underwater Ground Drag:</b> {@value #UNDERWATER_GROUND_DRAG}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setGroundDrag_UseDefaultStrategy() {
|
||||
setGroundDrag(GROUND_DRAG,UNDERWATER_GROUND_DRAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAirDrag(double airDrag,double underwaterAirDrag) {
|
||||
this.LAND_horizontal_air_drag=airDrag;
|
||||
this.UNDERWATER_horizontal_air_drag=underwaterAirDrag;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param airDrag The air drag to set for land and water.
|
||||
*/
|
||||
public void setAirDrag_UseCopyStrategy(double airDrag) {
|
||||
setAirDrag(airDrag,airDrag);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param airDrag The air drag to set for land.
|
||||
*/
|
||||
public void setAirDrag_UseHalfStrategy(double airDrag) {
|
||||
setAirDrag(airDrag,airDrag/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Air Drag</b> {@value #AIR_DRAG}</li>
|
||||
* <li><b>Underwater Air Drag:</b> {@value #UNDERWATER_AIR_DRAG}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setAirDrag_UseDefaultStrategy() {
|
||||
setAirDrag(AIR_DRAG,UNDERWATER_AIR_DRAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSlidingVelocity(double slidingVelocity,double underwaterSlidingVelocity) {
|
||||
this.LAND_sliding_velocity=slidingVelocity;
|
||||
this.UNDERWATER_sliding_velocity=underwaterSlidingVelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param slidingVelocity The sliding velocity to set for land and water.
|
||||
*/
|
||||
public void setSlidingVelocity_UseCopyStrategy(double slidingVelocity) {
|
||||
setSlidingVelocity(slidingVelocity,slidingVelocity);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param slidingVelocity The sliding velocity to set for land.
|
||||
*/
|
||||
public void setSlidingVelocity_UseHalfStrategy(double slidingVelocity) {
|
||||
setSlidingVelocity(slidingVelocity,slidingVelocity/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Sliding Velocity</b> {@value #SLIDING_VELOCITY}</li>
|
||||
* <li><b>Underwater Sliding Velocity:</b> {@value #UNDERWATER_SLIDING_VELOCITY}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setSlidingVelocity_UseDefaultStrategy() {
|
||||
setSlidingVelocity(SLIDING_VELOCITY,UNDERWATER_SLIDING_VELOCITY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSlidingAcceleration(double slidingAcceleration,double underwaterSlidingAcceleration) {
|
||||
this.LAND_sliding_acceleration=slidingAcceleration;
|
||||
this.UNDERWATER_sliding_acceleration=underwaterSlidingAcceleration;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param slidingAcceleration The sliding acceleration to set for land and water.
|
||||
*/
|
||||
public void setSlidingAcceleration_UseCopyStrategy(double slidingAcceleration) {
|
||||
setSlidingAcceleration(slidingAcceleration,slidingAcceleration);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param slidingAcceleration The sliding acceleration to set for land.
|
||||
*/
|
||||
public void setSlidingAcceleration_UseHalfStrategy(double slidingAcceleration) {
|
||||
setSlidingAcceleration(slidingAcceleration,slidingAcceleration/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Sliding Acceleration</b> {@value #SLIDING_ACCELERATION}</li>
|
||||
* <li><b>Underwater Sliding Acceleration:</b> {@value #UNDERWATER_SLIDING_ACCELERATION}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setSlidingAcceleration_UseDefaultStrategy() {
|
||||
setSlidingAcceleration(SLIDING_ACCELERATION,UNDERWATER_SLIDING_ACCELERATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setJumpVelocity(double jumpVelocity,double underwaterJumpVelocity) {
|
||||
this.LAND_jump_velocity=jumpVelocity;
|
||||
this.UNDERWATER_jump_velocity=underwaterJumpVelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param jumpVelocity The jump velocity to set for land and water.
|
||||
*/
|
||||
public void setJumpVelocity_UseCopyStrategy(double jumpVelocity) {
|
||||
setJumpVelocity(jumpVelocity,jumpVelocity);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param jumpVelocity The jump velocity to set for land.
|
||||
*/
|
||||
public void setJumpVelocity_UseHalfStrategy(double jumpVelocity) {
|
||||
setJumpVelocity(jumpVelocity,jumpVelocity/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Jump Velocity</b> {@value #JUMP_VELOCITY}</li>
|
||||
* <li><b>Underwater Jump Velocity:</b> {@value #UNDERWATER_JUMP_VELOCITY}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setJumpVelocity_UseDefaultStrategy() {
|
||||
setJumpVelocity(JUMP_VELOCITY,UNDERWATER_JUMP_VELOCITY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGravity(double gravity, double underwaterGravity) {
|
||||
this.LAND_gravity=gravity;
|
||||
this.UNDERWATER_gravity=underwaterGravity;
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Copy Strategy</b> uses the same values for both land and water.
|
||||
* @param gravity The gravity to set for land and water.
|
||||
*/
|
||||
public void setGravity_UseCopyStrategy(double gravity) {
|
||||
setGravity(gravity,gravity);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Half Strategy</b> uses halved values for water.
|
||||
* @param gravity The gravity to set for land.
|
||||
*/
|
||||
public void setGravity_UseHalfStrategy(double gravity) {
|
||||
setGravity(gravity,gravity/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>Default Strategy</b> uses the default values specified by the devs for "default physics" of any object.
|
||||
* <hr>The Defaults are:
|
||||
* <ul>
|
||||
* <li><b>Gravity</b> {@value #GRAVITY}</li>
|
||||
* <li><b>Underwater Gravity:</b> {@value #UNDERWATER_GRAVITY}</code></li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setGravity_UseDefaultStrategy() {
|
||||
setGravity(GRAVITY,UNDERWATER_GRAVITY);
|
||||
}
|
||||
|
||||
public double getGravity() {
|
||||
return gravity;
|
||||
}
|
||||
|
@ -14,12 +14,12 @@ public class BlueBun extends BunnyGirls{
|
||||
setAccelerationLimits(100, 100);
|
||||
setVelocityLimits(500, 500);
|
||||
setGroundDrag(2000);
|
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION);
|
||||
setGroundFriction(PhysicsObject.GROUND_FRICTION);
|
||||
setAirDrag(800);
|
||||
setAirFriction(180);
|
||||
setSlidingVelocity(164);
|
||||
setSlidingAcceleration(120);
|
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY);
|
||||
setJumpVelocity(PhysicsObject.JUMP_VELOCITY);
|
||||
setGravity(950);
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,12 @@ public class GreenBun extends BunnyGirls{
|
||||
setAccelerationLimits(100, 100);
|
||||
setVelocityLimits(500, 500);
|
||||
setGroundDrag(2000);
|
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION);
|
||||
setGroundFriction(PhysicsObject.GROUND_FRICTION);
|
||||
setAirDrag(800);
|
||||
setAirFriction(180);
|
||||
setSlidingVelocity(164);
|
||||
setSlidingAcceleration(120);
|
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY);
|
||||
setJumpVelocity(PhysicsObject.JUMP_VELOCITY);
|
||||
setGravity(1550);
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,12 @@ public class RedBun extends BunnyGirls{
|
||||
setAccelerationLimits(100, 100);
|
||||
setVelocityLimits(500, 500);
|
||||
setGroundDrag(2000);
|
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION);
|
||||
setGroundFriction(PhysicsObject.GROUND_FRICTION);
|
||||
setAirDrag(800);
|
||||
setAirFriction(180);
|
||||
setSlidingVelocity(164);
|
||||
setSlidingAcceleration(120);
|
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY);
|
||||
setJumpVelocity(PhysicsObject.JUMP_VELOCITY);
|
||||
setGravity(750);
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,12 @@ public class YellowBun extends BunnyGirls{
|
||||
setAccelerationLimits(100, 100);
|
||||
setVelocityLimits(500, 500);
|
||||
setGroundDrag(2000);
|
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION);
|
||||
setGroundFriction(PhysicsObject.GROUND_FRICTION);
|
||||
setAirDrag(800);
|
||||
setAirFriction(180);
|
||||
setSlidingVelocity(164);
|
||||
setSlidingAcceleration(120);
|
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY);
|
||||
setJumpVelocity(PhysicsObject.JUMP_VELOCITY);
|
||||
setGravity(150);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user