diff --git a/bin/RabiClone.jar b/bin/RabiClone.jar index d4fc75b..896ee12 100644 Binary files a/bin/RabiClone.jar and b/bin/RabiClone.jar differ diff --git a/src/sig/RabiClone.java b/src/sig/RabiClone.java index 95966a1..3d46bdc 100644 --- a/src/sig/RabiClone.java +++ b/src/sig/RabiClone.java @@ -89,35 +89,7 @@ public class RabiClone{ double updateMult = Math.min(1/60d,timePassed/1000000000d); - //System.out.println(CONTROLLERS.length); - for (int i=0;ii?j-1:j)]=CONTROLLERS[i]; - } - } - CONTROLLERS=newArr; - } - /*EventQueue queue = controller_list[i].getEventQueue(); - - while (queue.getNextEvent(event)) { - Component c = event.getComponent(); - System.out.println(c.getName()+","+c.getIdentifier()+": "+c.getPollData()); - }*/ - } + handleGameControllers(); KeyBind.poll(); @@ -155,6 +127,23 @@ public class RabiClone{ } } + private static void handleGameControllers() { + for (int i=0;ii?j-1:j)]=CONTROLLERS[i]; + } + } + CONTROLLERS=newArr; + } + } + } + private static void ResetGame() { player=null; level_renderer=null; diff --git a/src/sig/engine/KeyBind.java b/src/sig/engine/KeyBind.java index a67e039..4651029 100644 --- a/src/sig/engine/KeyBind.java +++ b/src/sig/engine/KeyBind.java @@ -111,13 +111,13 @@ public class KeyBind { } private static void emitReleaseEvent(Action a) { - System.out.println("Release for "+a); + //System.out.println("Release for "+a); for (int i=0;i0 && spacebarReleased && (a==Action.JUMP)){ jumpCount=0; @@ -215,6 +220,18 @@ public class Player extends AnimatedObject{ } + private void performSlide() { + slide_time = System.currentTimeMillis(); + if(facing_direction){ + x_velocity=sliding_velocity; + } + else{ + x_velocity=-sliding_velocity; + } + state=State.SLIDE; + } + + private void handleCameraRoomMovement() { int tileX = (int)(getX())/Tile.TILE_WIDTH; int tileY = (int)(getY())/Tile.TILE_HEIGHT; @@ -340,8 +357,8 @@ public class Player extends AnimatedObject{ } } if (y_velocity==0) { - Tile checked_tile_bottom_right = RabiClone.CURRENT_MAP.getTile((int)(getX()+getAnimatedSpr().getWidth()/2-4)/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2+0.5)/Tile.TILE_HEIGHT); - Tile checked_tile_bottom_left = RabiClone.CURRENT_MAP.getTile((int)(getX()-getAnimatedSpr().getWidth()/2+4)/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2+0.5)/Tile.TILE_HEIGHT); + Tile checked_tile_bottom_right = RabiClone.CURRENT_MAP.getTile((int)(getX()+getAnimatedSpr().getWidth()/2-4)/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2+1)/Tile.TILE_HEIGHT); + Tile checked_tile_bottom_left = RabiClone.CURRENT_MAP.getTile((int)(getX()-getAnimatedSpr().getWidth()/2+4)/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2+1)/Tile.TILE_HEIGHT); if (!(checked_tile_bottom_right.getCollision()==CollisionType.BLOCK||checked_tile_bottom_left.getCollision()==CollisionType.BLOCK)) { groundCollision=false; } else {