@Override
    public void run() {
        try {
            while (true) {



                timer++;

                move();


                if (outOfAmmo && timer == 250) {
                    outOfAmmo = false;
                    s.playSound("loading");
                    if (this.xDirection == 0) {

                        sprite = sprites.get(0);

                    }

                }
                if (misses >= 10) {
                    gameover = true;
                }
                if (score >= 20) {
                    wins = true;
                }

                Thread.sleep(8);
            }

        } catch (Exception e) {
            System.err.println(e.getMessage());
        }
    }