public void UpdateGame(long gameTime, Point mousePosition) {
        // Move the car
        playerCar.Update();
        movingBg.Update();
        enemyCar.Update(playerCar.getSpeedY(), passedPoint[2]);

        for (int i = 0; i < courseList.size(); i++) {
            courseList.get(i).Update(playerCar.getSpeedY(), playerCar.getY());
        }

        // Checks where the player car is. Is it still in the space or is it raceWin or crashed?
        //AS LONG AS the Y of car is less than Y of the last course, finish line
        //has not been crossed
        //carImgHeight can be removed
        if (playerCar.y < courseList.get(courseList.size() - 1).y) {

            playerCar.raceWin = true;
            //change the gamestate, on next loop gameover will occur
            System.out.println(courseList.size());
            Framework.gameState = Framework.GameState.GAMEOVER;
        }
    }