Skip to content

Commit

Permalink
fixed bouncing on falling blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriy Katkov committed Feb 9, 2014
1 parent 6eceae5 commit 351724b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 2 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.
5 changes: 3 additions & 2 deletions src/com/example/avalanchegame/CustomSurfaceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ public void restart()
* mCanvasHeight);
topHit = false;
bottomHit = false;
blocksAbovePlayer = 0;
}

private boolean topHit = false;
Expand Down Expand Up @@ -608,9 +609,9 @@ private void updateLogic()
{
player.fixIntersection(block, collisionIndicator);
// fix grounding within player
player.setYVelocity(block.getVy());
}
// TODO: is this really supposed to be x?
if (player.getX() < block.top)
if (player.getY() < block.top)
blocksAbovePlayer++;
}
if (topHit && bottomHit)
Expand Down
7 changes: 7 additions & 0 deletions src/com/example/avalanchegame/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,11 @@ public float getX()
{
return px;
}


public void setYVelocity(float blockVY)
{
// TODO Auto-generated method stub
vy = blockVY;
}
}

0 comments on commit 351724b

Please sign in to comment.