Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/JacobSeto/RabBeat
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSeto committed Apr 14, 2024
2 parents 9611c66 + 5eb32ba commit 81e28e2
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 25 deletions.
1 change: 0 additions & 1 deletion core/src/edu/cornell/gdiac/rabbeat/GameCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,6 @@ protected void updateCamera(Player player, float worldWidth, float worldHeight)
player.getX() * 67f, 0, 0),
CAMERA_SPEED * Gdx.graphics.getDeltaTime()
);
System.out.println(player.getX());
camera.position.set(new Vector2(camera.position.x, player.getY() * 67f), 0);
camera.position.x = MathUtils.clamp(camera.position.x, minX, maxX);
camera.position.y = MathUtils.clamp(camera.position.y, minY, maxY);
Expand Down
5 changes: 0 additions & 5 deletions core/src/edu/cornell/gdiac/rabbeat/GameController.java
Original file line number Diff line number Diff line change
Expand Up @@ -629,16 +629,13 @@ public void beginContact(Contact contact) {
//TODO: implement lethal obstacle code which checks for the first obstacle being the player, then checking if the
if ((bd2 instanceof Player && bd1 instanceof SimpleGameObject)){
if (((SimpleGameObject) bd1).getType() == SimpleGameObject.ObjectType.LETHAL){
System.out.println("l2");
setFailure(true);
}
}
if ((bd1 instanceof WeightedPlatform) && (bd2 instanceof Player)){
System.out.println("yipee");
lastCollideWith = (WeightedPlatform) bd1;
}
if ((bd1 instanceof MovingPlatform) && (bd2 instanceof Player)){
System.out.println("yipee");
lastMCollideWith = (MovingPlatform) bd1;
}
// Check for collision with checkpoints and set new current checkpoint
Expand Down Expand Up @@ -683,14 +680,12 @@ public void endContact(Contact contact) {
}
}
if ((bd1 instanceof WeightedPlatform) && (bd2 instanceof Player)){
System.out.println("whoopee");
if (bd1 == lastCollideWith){
lastCollideWith = null;
}
objectController.player.setDisplace(new Vector2(0,0));
}
if ((bd1 instanceof MovingPlatform) && (bd2 instanceof Player)){
System.out.println("whoopee");
if (bd1 == lastMCollideWith){
lastMCollideWith = null;
}
Expand Down
1 change: 0 additions & 1 deletion core/src/edu/cornell/gdiac/rabbeat/InputController.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ private void readKeyboard(Rectangle bounds, Vector2 scale, boolean secondary) {

vertical = (secondary ? vertical : 0.0f);
if (Gdx.input.isKeyPressed(Input.Keys.UP) || Gdx.input.isKeyPressed(Input.Keys.W)) {
System.out.println("up");
vertical += 1.0f;
}
if (Gdx.input.isKeyPressed(Input.Keys.DOWN) || Gdx.input.isKeyPressed(Input.Keys.S)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,21 @@ public void switchState() {
if(curGenre.equals(Genre.JAZZ)) {
if(beatCount == 4) {
enemyState = EnemyState.ATTACKING;
System.out.println("ATTACKING Jazz");
}
} else if(curGenre.equals(Genre.SYNTH)) {
if(beatCount == 4 || beatCount == 2) {
enemyState = EnemyState.ATTACKING;
System.out.println("ATTACKING Synth");
}
}
break;
case ATTACKING:
if(curGenre.equals(Genre.JAZZ)) {
if(beatCount != 4) {
enemyState = EnemyState.IDLE;
System.out.println("IDLE Jazz");
}
} else if(curGenre.equals(Genre.SYNTH)) {
if(beatCount != 4 && beatCount != 2) {
enemyState = EnemyState.IDLE;
System.out.println("IDLE Synth");
}
}

Expand All @@ -113,8 +109,6 @@ public void beatAction() {
if(enemyState.equals(EnemyState.ATTACKING)) {
sendEcho();
}

//System.out.println("BEAT: " + beatCount);
}

ObjectController oc = GameController.getInstance().objectController;
Expand All @@ -132,7 +126,6 @@ public void sendEcho() {
if(Math.sqrt(Math.pow(horizontalDistanceBetweenEnemyAndPlayer(),2) + Math.pow(verticalDistanceBetweenEnemyAndPlayer(),2)) <= echoRadius) {
GameController.getInstance().setFailure(true);
}
System.out.println("Echo sent!");
//TODO: visualize the echo

// WheelGameObject w = new WheelGameObject(getX(), getY(), (float) 0.06);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ public void switchState() {
case IDLE:
if(horizontalDistanceBetweenEnemyAndPlayer()<8) {
enemyState = EnemyState.ATTACKING;
System.out.println("ATTACKING");
}
break;
case ATTACKING:
if(horizontalDistanceBetweenEnemyAndPlayer()>8) {
enemyState = EnemyState.IDLE;
System.out.println("not ATTACKING");
}
//TODO: make bear shoot
break;
Expand Down Expand Up @@ -118,7 +116,6 @@ public float getBeat() {
public void beatAction() {
if (enemyState == EnemyState.ATTACKING) {
makeBullet();
System.out.println("shoot");
}

flipEnemy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,21 @@ public void switchState() {
if(curGenre.equals(Genre.JAZZ)) {
if(beatCount == 4) {
enemyState = EnemyState.ATTACKING;
System.out.println("ATTACKING Jazz");
}
} else if(curGenre.equals(Genre.SYNTH)) {
if(beatCount == 4 || beatCount == 2) {
enemyState = EnemyState.ATTACKING;
System.out.println("ATTACKING Synth");
}
}
break;
case ATTACKING:
if(curGenre.equals(Genre.JAZZ)) {
if(beatCount != 4) {
enemyState = EnemyState.IDLE;
System.out.println("IDLE Jazz");
}
} else if(curGenre.equals(Genre.SYNTH)) {
if(beatCount != 4 && beatCount != 2) {
enemyState = EnemyState.IDLE;
System.out.println("IDLE Synth");
}
}
break;
Expand Down Expand Up @@ -125,8 +121,6 @@ public void update(float dt) {
//setAngle(angle);
} else {
setPosition(getX()-distance, getY());
System.out.println("X:" + getX());
System.out.println("point2" + point2);
//setAngle(angle);
}
}
Expand Down
3 changes: 1 addition & 2 deletions core/src/edu/cornell/gdiac/rabbeat/sync/SyncController.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void setSync(Music _synth, Music _jazz){
* */
public void addDelay(float _delay){
delay += _delay;
System.out.println(delay);
System.out.println("New Delay: " + delay);
}

/**The update function for everything synced in the world*/
Expand Down Expand Up @@ -63,7 +63,6 @@ public void addSync(ISynced syncedObject){
Interval interval = new Interval(syncedObject);
intervals.add(interval);
if(syncedObject instanceof ISyncedAnimated){
System.out.println("Animated object");;
animationSync.animatedObjects.add((ISyncedAnimated)(syncedObject));
}
}
Expand Down

0 comments on commit 81e28e2

Please sign in to comment.