import processing.core.PVector;

public class Car extends GameObject {
    public void draw() {
        Game.getInstance().image(Resources.getCar(), position.x, position.y);

        if (Game.getInstance().keyPressed) {
            if (Game.getInstance().key == 'a') {
                position.x -= 5;
            }

            if (Game.getInstance().key == 'd') {
                position.x += 5;
            }

            if (position.x > Game.getInstance().width - Resources.getCar().width) {
                position.x = Game.getInstance().width - Resources.getCar().width;
            }

            if (position.x < 0) {
                position.x = 0;
            }
        }
    }

    public void start() {
        position = new PVector(Game.getInstance().width / 2 - (Resources.getCar().width / 2), Game.getInstance().height - Resources.getCar().height);
    }

    public void die() {
        Game.getInstance().reset();
    }
}

@@ -28,16 +28,38 @@
 tor;%0D%0A%0D%0A
+// Class for the car%0D%0A
 public c

Update Car.java