protected void tick(double theta) {
        scoreText.updateText((String.format("%06d", score)));
        lastCreated += theta;
        if (lastCreated > 1 && !Main.game.dead) {
            lastCreated = 0;
            Obstacle o = new Obstacle();
            o.obstacle.position.x = (float) Math.random() * 2 - 1;
            o.obstacle.velocity.y = (float) Math.random();
            o.obstacle.position.y = -1;
            objects.add(o);
        }
        
        smoothDirection = ((player.direction.x * 25f)*(float)theta*60 * 0.2f + smoothDirection * 0.8f);
        if(smoothDirection > 25) smoothDirection = 25.5f;
        if(smoothDirection < -25) smoothDirection = -25.5f;
        if (dead) return;
        player.update(theta);
        for (Obstacle o : objects) {
            o.update(theta);
        }
    }