Skip to content

Commit

Permalink
made all jumping much more responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
treiter committed Feb 8, 2014
1 parent 8e1fb5b commit 57f5ea0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
Binary file modified bin/AvalancheGame.apk
Binary file not shown.
Binary file modified bin/classes.dex
Binary file not shown.
Binary file not shown.
Binary file modified bin/classes/com/example/avalanchegame/CustomSurfaceView.class
Binary file not shown.
Binary file modified bin/classes/com/example/avalanchegame/Player.class
Binary file not shown.
12 changes: 3 additions & 9 deletions src/com/example/avalanchegame/CustomSurfaceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public void generateBoxes(float startingHeight, float additionalHeight)
seededRandom.nextFloat() * mCanvasHeight / 2 + mCanvasHeight
/ 2)
{
Log.d("ass", spawnHeight + "");
int amountPerHeight = seededRandom.nextInt(2) + 1;
for (int i = 0; i < amountPerHeight; i++)
{
Expand All @@ -182,12 +181,10 @@ public void generateBoxes(float startingHeight, float additionalHeight)
collisions = false;
for (Box block : boxes)
{
if (box.intersects(block) > -1)
int temp = box.intersects(block);
if (temp > -1)
{
Log.d("lawl", "somehow collided");
x = randInt(0, mCanvasWidth);
collisions = true;
break;
box.fixIntersection(block, temp);
}
}
}
Expand Down Expand Up @@ -395,9 +392,6 @@ public void run()
sleepTime += FRAME_PERIOD;
framesSkipped++;
}
Log.d(
"asdf",
"thread is actually fucking running");
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/com/example/avalanchegame/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ else if (whichSide == 1) // right
vx = 0;
if (!midJump)
{
vy = 0;
vx = 20.0f;
vy = -230.0f;
px = playerRect.centerX();
canJumpFromRight = true;
}
Expand All @@ -212,7 +213,8 @@ else if (whichSide == 3) // left
vx = 0;
if (!midJump)
{
vy = 0;
vx = -20.0f;
vy = -230.0f;
px = playerRect.centerX();
canJumpFromLeft = true;
}
Expand Down

0 comments on commit 57f5ea0

Please sign in to comment.