diff --git a/Java/scripts/build.sh b/Java/scripts/build.sh index 09d99a2..e176940 100755 --- a/Java/scripts/build.sh +++ b/Java/scripts/build.sh @@ -6,4 +6,4 @@ printf "\n\n\nRunning Program...\n\n" ORIGINAL_LOC=$(pwd) cd $OUT_DIR java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@" -#${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh \ No newline at end of file +${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh \ No newline at end of file diff --git a/Java/scripts/build2.sh b/Java/scripts/build2.sh index f9be65b..caa432e 100644 --- a/Java/scripts/build2.sh +++ b/Java/scripts/build2.sh @@ -6,4 +6,4 @@ printf "\n\n\nRunning Program...\n\n" ORIGINAL_LOC=$(pwd) cd $OUT_DIR java ${CUSTOM_PARAMS} -cp ".;../lib/bin/ " "-Djava.library.path=${LIBRARY_PATH}" ${MAIN_CLASS} "$@" -#${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh \ No newline at end of file +${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh \ No newline at end of file diff --git a/bin/sig/DrawLoop.class b/bin/sig/DrawLoop.class deleted file mode 100644 index e621c47..0000000 Binary files a/bin/sig/DrawLoop.class and /dev/null differ diff --git a/bin/sig/RabiClone.class b/bin/sig/RabiClone.class deleted file mode 100644 index 8112cef..0000000 Binary files a/bin/sig/RabiClone.class and /dev/null differ diff --git a/bin/sig/engine/Action.class b/bin/sig/engine/Action.class deleted file mode 100644 index b11c6f4..0000000 Binary files a/bin/sig/engine/Action.class and /dev/null differ diff --git a/bin/sig/engine/Alpha.class b/bin/sig/engine/Alpha.class deleted file mode 100644 index 3992038..0000000 Binary files a/bin/sig/engine/Alpha.class and /dev/null differ diff --git a/bin/sig/engine/AnimatedObject.class b/bin/sig/engine/AnimatedObject.class deleted file mode 100644 index d94ac6e..0000000 Binary files a/bin/sig/engine/AnimatedObject.class and /dev/null differ diff --git a/bin/sig/engine/AnimatedSprite.class b/bin/sig/engine/AnimatedSprite.class deleted file mode 100644 index 2e4c077..0000000 Binary files a/bin/sig/engine/AnimatedSprite.class and /dev/null differ diff --git a/bin/sig/engine/Color.class b/bin/sig/engine/Color.class deleted file mode 100644 index d22c5a9..0000000 Binary files a/bin/sig/engine/Color.class and /dev/null differ diff --git a/bin/sig/engine/Edge.class b/bin/sig/engine/Edge.class deleted file mode 100644 index 2021032..0000000 Binary files a/bin/sig/engine/Edge.class and /dev/null differ diff --git a/bin/sig/engine/Font.class b/bin/sig/engine/Font.class deleted file mode 100644 index b820d90..0000000 Binary files a/bin/sig/engine/Font.class and /dev/null differ diff --git a/bin/sig/engine/GameEntity.class b/bin/sig/engine/GameEntity.class deleted file mode 100644 index 0791c4c..0000000 Binary files a/bin/sig/engine/GameEntity.class and /dev/null differ diff --git a/bin/sig/engine/Key.class b/bin/sig/engine/Key.class deleted file mode 100644 index 1eb0344..0000000 Binary files a/bin/sig/engine/Key.class and /dev/null differ diff --git a/bin/sig/engine/KeyBind.class b/bin/sig/engine/KeyBind.class deleted file mode 100644 index 7febcf4..0000000 Binary files a/bin/sig/engine/KeyBind.class and /dev/null differ diff --git a/bin/sig/engine/MouseScrollValue.class b/bin/sig/engine/MouseScrollValue.class deleted file mode 100644 index 764332b..0000000 Binary files a/bin/sig/engine/MouseScrollValue.class and /dev/null differ diff --git a/bin/sig/engine/Object.class b/bin/sig/engine/Object.class deleted file mode 100644 index 8f753a3..0000000 Binary files a/bin/sig/engine/Object.class and /dev/null differ diff --git a/bin/sig/engine/PaletteColor.class b/bin/sig/engine/PaletteColor.class deleted file mode 100644 index 3d07ea3..0000000 Binary files a/bin/sig/engine/PaletteColor.class and /dev/null differ diff --git a/bin/sig/engine/Panel$1.class b/bin/sig/engine/Panel$1.class deleted file mode 100644 index 347a110..0000000 Binary files a/bin/sig/engine/Panel$1.class and /dev/null differ diff --git a/bin/sig/engine/Panel$2.class b/bin/sig/engine/Panel$2.class deleted file mode 100644 index 6bf9c10..0000000 Binary files a/bin/sig/engine/Panel$2.class and /dev/null differ diff --git a/bin/sig/engine/Panel$3.class b/bin/sig/engine/Panel$3.class deleted file mode 100644 index 087dd90..0000000 Binary files a/bin/sig/engine/Panel$3.class and /dev/null differ diff --git a/bin/sig/engine/Panel.class b/bin/sig/engine/Panel.class deleted file mode 100644 index efd9841..0000000 Binary files a/bin/sig/engine/Panel.class and /dev/null differ diff --git a/bin/sig/engine/Point.class b/bin/sig/engine/Point.class deleted file mode 100644 index 81cf6dd..0000000 Binary files a/bin/sig/engine/Point.class and /dev/null differ diff --git a/bin/sig/engine/Rectangle.class b/bin/sig/engine/Rectangle.class deleted file mode 100644 index 11a07e5..0000000 Binary files a/bin/sig/engine/Rectangle.class and /dev/null differ diff --git a/bin/sig/engine/Sprite.class b/bin/sig/engine/Sprite.class deleted file mode 100644 index 73deef8..0000000 Binary files a/bin/sig/engine/Sprite.class and /dev/null differ diff --git a/bin/sig/engine/String.class b/bin/sig/engine/String.class deleted file mode 100644 index 58ae64a..0000000 Binary files a/bin/sig/engine/String.class and /dev/null differ diff --git a/bin/sig/engine/Transform.class b/bin/sig/engine/Transform.class deleted file mode 100644 index 0ab741f..0000000 Binary files a/bin/sig/engine/Transform.class and /dev/null differ diff --git a/bin/sig/map/Background.class b/bin/sig/map/Background.class deleted file mode 100644 index 8fd10ee..0000000 Binary files a/bin/sig/map/Background.class and /dev/null differ diff --git a/bin/sig/map/CollisionType.class b/bin/sig/map/CollisionType.class deleted file mode 100644 index 187418a..0000000 Binary files a/bin/sig/map/CollisionType.class and /dev/null differ diff --git a/bin/sig/map/Map.class b/bin/sig/map/Map.class deleted file mode 100644 index 748d351..0000000 Binary files a/bin/sig/map/Map.class and /dev/null differ diff --git a/bin/sig/map/Maps.class b/bin/sig/map/Maps.class deleted file mode 100644 index 6c8dd0b..0000000 Binary files a/bin/sig/map/Maps.class and /dev/null differ diff --git a/bin/sig/map/Tile.class b/bin/sig/map/Tile.class deleted file mode 100644 index 6732950..0000000 Binary files a/bin/sig/map/Tile.class and /dev/null differ diff --git a/bin/sig/map/Type.class b/bin/sig/map/Type.class deleted file mode 100644 index e2137b3..0000000 Binary files a/bin/sig/map/Type.class and /dev/null differ diff --git a/bin/sig/map/View.class b/bin/sig/map/View.class deleted file mode 100644 index 0a259e9..0000000 Binary files a/bin/sig/map/View.class and /dev/null differ diff --git a/bin/sig/objects/ConfigureControls.class b/bin/sig/objects/ConfigureControls.class deleted file mode 100644 index 6a55434..0000000 Binary files a/bin/sig/objects/ConfigureControls.class and /dev/null differ diff --git a/bin/sig/objects/EditorRenderer$1.class b/bin/sig/objects/EditorRenderer$1.class deleted file mode 100644 index bec7f6d..0000000 Binary files a/bin/sig/objects/EditorRenderer$1.class and /dev/null differ diff --git a/bin/sig/objects/EditorRenderer.class b/bin/sig/objects/EditorRenderer.class deleted file mode 100644 index 2dec9ce..0000000 Binary files a/bin/sig/objects/EditorRenderer.class and /dev/null differ diff --git a/bin/sig/objects/LevelRenderer.class b/bin/sig/objects/LevelRenderer.class deleted file mode 100644 index be2fef6..0000000 Binary files a/bin/sig/objects/LevelRenderer.class and /dev/null differ diff --git a/bin/sig/objects/Player$1.class b/bin/sig/objects/Player$1.class deleted file mode 100644 index 05044e1..0000000 Binary files a/bin/sig/objects/Player$1.class and /dev/null differ diff --git a/bin/sig/objects/Player.class b/bin/sig/objects/Player.class deleted file mode 100644 index 9631b2c..0000000 Binary files a/bin/sig/objects/Player.class and /dev/null differ diff --git a/bin/sig/objects/actor/State.class b/bin/sig/objects/actor/State.class deleted file mode 100644 index 1869626..0000000 Binary files a/bin/sig/objects/actor/State.class and /dev/null differ diff --git a/bin/sig/utils/TimeUtils.class b/bin/sig/utils/TimeUtils.class deleted file mode 100644 index 7c4050e..0000000 Binary files a/bin/sig/utils/TimeUtils.class and /dev/null differ diff --git a/manifest b/manifest deleted file mode 100644 index 2b1dc38..0000000 --- a/manifest +++ /dev/null @@ -1 +0,0 @@ -Main-Class: sig.RabiClone diff --git a/maps/world1.map b/maps/world1.map index c175ddf..364c535 100644 Binary files a/maps/world1.map and b/maps/world1.map differ diff --git a/src/sig/objects/Player.java b/src/sig/objects/Player.java index e30ae26..d9fc489 100644 --- a/src/sig/objects/Player.java +++ b/src/sig/objects/Player.java @@ -375,16 +375,15 @@ public class Player extends AnimatedObject{ if(checked_tile_top_right.getCollision()==CollisionType.BLOCK||checked_tile_top_left.getCollision()==CollisionType.BLOCK){ //System.out.println(checked_tile_top_right.getCollision()+"//"+checked_tile_top_left.getCollision()); if(checked_tile_bottom_center.getCollision()==CollisionType.SLOPE){ - }else{ - - if (checked_tile_top_right.getCollision()==CollisionType.BLOCK) { - setX(((int)(getX()-getAnimatedSpr().getWidth()/2)/Tile.TILE_WIDTH)*Tile.TILE_WIDTH+Tile.TILE_WIDTH/2+3+check_distance_x); } else { - setX(((int)(getX()+getAnimatedSpr().getWidth())/Tile.TILE_WIDTH)*Tile.TILE_WIDTH-Tile.TILE_WIDTH/2-3+check_distance_x); - } - x_acceleration = 0; - x_velocity = Math.signum(x_velocity)*0.000001; - sideCollision=true; + if (checked_tile_top_right.getCollision()==CollisionType.BLOCK) { + setX(((int)(getX()-getAnimatedSpr().getWidth()/2)/Tile.TILE_WIDTH)*Tile.TILE_WIDTH+Tile.TILE_WIDTH/2+3+check_distance_x); + } else { + setX(((int)(getX()+getAnimatedSpr().getWidth())/Tile.TILE_WIDTH)*Tile.TILE_WIDTH-Tile.TILE_WIDTH/2-3+check_distance_x); + } + x_acceleration = 0; + x_velocity = Math.signum(x_velocity)*0.000001; + sideCollision=true; } } } @@ -399,7 +398,7 @@ public class Player extends AnimatedObject{ groundCollision=false; } else { if(checked_tile_bottom_center.getCollision()==CollisionType.SLOPE){ - setY(-(getX()%Tile.TILE_WIDTH)+(int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT+(getAnimatedSpr().getHeight()/2-4)); + moveUpSlope(checked_tile_bottom_center); } groundCollision=true; jumpCount=maxJumpCount; @@ -414,9 +413,9 @@ public class Player extends AnimatedObject{ Tile checked_tile_bottom_left = RabiClone.CURRENT_MAP.getTile((int)(getX()-getAnimatedSpr().getWidth()/2+4)/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2+check_distance_y)/Tile.TILE_HEIGHT); Tile checked_tile_bottom_center = RabiClone.CURRENT_MAP.getTile((int)(getX())/Tile.TILE_WIDTH, (int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT); if(checked_tile_bottom_center.getCollision()==CollisionType.SLOPE - && getY()+check_distance_y>(-(getX()%Tile.TILE_WIDTH)+(int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT+(getAnimatedSpr().getHeight()/2-4))) + && getY()+check_distance_y>ySlopeCollisionPoint(checked_tile_bottom_center)) { - setY(-(getX()%Tile.TILE_WIDTH)+(int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT+(getAnimatedSpr().getHeight()/2-4)); + moveUpSlope(checked_tile_bottom_center); collisionOccured = groundCollision(check_distance_y); System.out.println(checked_tile_bottom_center); break; @@ -450,6 +449,35 @@ public class Player extends AnimatedObject{ } + private double ySlopeCollisionPoint(Tile tile) { + switch(tile){ + case BIG_SLOPE_LEFT1: + return 0; + + case BIG_SLOPE_LEFT2: + return 0; + + case BIG_SLOPE_RIGHT1: + return 0; + + case BIG_SLOPE_RIGHT2: + return 0; + + case SMALL_SLOPE_LEFT: + return -(getX()%Tile.TILE_WIDTH)+(int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT+(getAnimatedSpr().getHeight()/2-4); + + case SMALL_SLOPE_RIGHT: + return Tile.TILE_WIDTH-(getX()%Tile.TILE_WIDTH)+(int)(getY()+getAnimatedSpr().getHeight()/2)/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT+(getAnimatedSpr().getHeight()/2-4); + } + return 0; + } + + + private void moveUpSlope(Tile checked_tile_bottom_center) { + setY(ySlopeCollisionPoint(checked_tile_bottom_center)); + } + + private boolean groundCollision(double check_distance_y) { boolean collisionOccured; setY((getY()-check_distance_y));