diff --git a/app/src/main/java/jonathan/balljumper/GameSurfaceView.java b/app/src/main/java/jonathan/balljumper/GameSurfaceView.java index ee3fdac..129dd65 100644 --- a/app/src/main/java/jonathan/balljumper/GameSurfaceView.java +++ b/app/src/main/java/jonathan/balljumper/GameSurfaceView.java @@ -64,6 +64,7 @@ ball = new Ball(screenSize.x / 2 - ballRadius, (screenSize.y / 3) * 2 - ballRadius, ballRadius, + -.3f, 0.4f, Color.argb(255, 200, 34, 34)); @@ -115,9 +116,9 @@ pause(); } - ball.setY((ball.getY() + ball.getSpeed() * ball.getDirection().y) + ball.velocity); + ball.setY((ball.getY() + ball.getSpeed() * ball.getDirection().y) + ball.getVelocity()); - ball.velocity += ball.getResistance(); + ball.setVelocity(ball.getVelocity() + ball.getGravity()); for (int i = 0; i < panelHandler.getPanelList().length; ++i) { Panel panel = panelHandler.getPanelList()[i];