setup physics code needs to be put in the constructor as well.

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 2 years ago committed by GitHub
parent e67685ba47
commit 85e03eaab8
  1. BIN
      bin/RabiClone.jar
  2. 2
      src/sig/map/Map.java
  3. 1
      src/sig/objects/actor/PhysicsObject.java

Binary file not shown.

@ -37,7 +37,7 @@ public class Map {
byte[] types = new byte[MAP_SCREENS_X*MAP_SCREENS_Y]; byte[] types = new byte[MAP_SCREENS_X*MAP_SCREENS_Y];
char[] data = new char[MAP_WIDTH*MAP_HEIGHT]; //While it's stored in a char, the map format only reads 14 bits for this value!! Value is between 0-16384! char[] data = new char[MAP_WIDTH*MAP_HEIGHT]; //While it's stored in a char, the map format only reads 14 bits for this value!! Value is between 0-16384!
char waterLevel = 144; char waterLevel = (MAP_HEIGHT/2) * Tile.TILE_HEIGHT;
int eventTileCount=0; int eventTileCount=0;

@ -89,6 +89,7 @@ public abstract class PhysicsObject extends AnimatedObject implements PhysicsObj
protected PhysicsObject(AnimatedSprite spr, double animationSpd, Panel panel) { protected PhysicsObject(AnimatedSprite spr, double animationSpd, Panel panel) {
super(spr, animationSpd, panel); super(spr, animationSpd, panel);
setCollisionBox(setCollisionBounds()); setCollisionBox(setCollisionBounds());
setPhysicsBasedOnLandOrUnderwaterStatus();
} }
@Override @Override

Loading…
Cancel
Save