Loading app/src/main/java/com/example/a8_bitinvader/GameView.java +4 −2 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ public class GameView extends SurfaceView implements Runnable{ private Background background1, background2; private Paint paint; Joystick joystick = new Joystick(0,0,0,0); Joystick joystick = new Joystick(450,1300,100,40); //undecided location Loading Loading @@ -72,6 +72,8 @@ public class GameView extends SurfaceView implements Runnable{ if(background2.yPos > screenHeight) { background2.yPos = -screenHeight; } joystick.update(joystick); } /* Loading @@ -82,7 +84,7 @@ public class GameView extends SurfaceView implements Runnable{ Canvas canvas = getHolder().lockCanvas(); canvas.drawBitmap(background1.background, background1.xPos, background1.yPos, paint); canvas.drawBitmap(background2.background, background2.xPos, background2.yPos, paint); joystick.draw(canvas); getHolder().unlockCanvasAndPost(canvas); } } Loading app/src/main/java/com/example/a8_bitinvader/Joystick.java +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class Joystick { public void update(Joystick joystick) { XVelocity = joystick.getActuatorX() * MAX_SPEED; YVelocity = joystick.getActuatorY() * MAX_SPEED; updateInnerCirclePosition(); } public void updateInnerCirclePosition() { Loading Loading
app/src/main/java/com/example/a8_bitinvader/GameView.java +4 −2 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ public class GameView extends SurfaceView implements Runnable{ private Background background1, background2; private Paint paint; Joystick joystick = new Joystick(0,0,0,0); Joystick joystick = new Joystick(450,1300,100,40); //undecided location Loading Loading @@ -72,6 +72,8 @@ public class GameView extends SurfaceView implements Runnable{ if(background2.yPos > screenHeight) { background2.yPos = -screenHeight; } joystick.update(joystick); } /* Loading @@ -82,7 +84,7 @@ public class GameView extends SurfaceView implements Runnable{ Canvas canvas = getHolder().lockCanvas(); canvas.drawBitmap(background1.background, background1.xPos, background1.yPos, paint); canvas.drawBitmap(background2.background, background2.xPos, background2.yPos, paint); joystick.draw(canvas); getHolder().unlockCanvasAndPost(canvas); } } Loading
app/src/main/java/com/example/a8_bitinvader/Joystick.java +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class Joystick { public void update(Joystick joystick) { XVelocity = joystick.getActuatorX() * MAX_SPEED; YVelocity = joystick.getActuatorY() * MAX_SPEED; updateInnerCirclePosition(); } public void updateInnerCirclePosition() { Loading