Commit 16f88e2a authored by Thomas Poimenidis's avatar Thomas Poimenidis
Browse files

updated Player implementation

parent b47377af
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -84,9 +84,7 @@ public class GameView extends SurfaceView implements Runnable{
        if(background2.yPos > screenHeight) {
            background2.yPos = -screenHeight;
        }
        p1.xVel = (int)joystick.XVelocity* p1.SPEED_MULTIPLIER;
        p1.yVel = (int)joystick.YVelocity* p1.SPEED_MULTIPLIER;
        p1.update();
        p1.update((int)joystick.XVelocity, (int)joystick.YVelocity);
        joystick.update(joystick);
    }

+5 −2
Original line number Diff line number Diff line
@@ -42,8 +42,11 @@ public class Player extends Sprite{
     * @param joyStickInputY Y input from joystick
     */
    public void update(int joyStickInputX, int joyStickInputY){
        xPos += joyStickInputX;
        yPos += joyStickInputY;
        xVel = joyStickInputX * SPEED_MULTIPLIER;
        yVel = joyStickInputY * SPEED_MULTIPLIER;

        update();

    }

    /**