#pragma once
#include "DangerousRacers/Label.h"
#include "DangerousRacers/Meter.h"
#include "DangerousRacers/Player.h"
#include "DangerousRacers/Scene.h"
#include "DangerousRacers/Obstacles/ObstacleManager.h"
#include "SFML/Graphics/Texture.hpp"
#include "SFML/Graphics/Sprite.hpp"

class LevelOneScene : public Scene {
    sf::Texture backgroundTexture;
    sf::Sprite backgroundSprite;

    float speed = 200.f;
    float bgYOffset = -720.f;

    float distanceTraveled = 0.f;

    Player player{405.f/2, 720.f/2};
    ObstacleManager obstacleManager{speed};

    Label scoreLabel{"KM: 0", {8,8}, false, true};

    float fuel = 1.f, health = 1.f;

    Meter fuelMeter{ 8, 712, 16.f, 320.f, {175, 198, 151} };
    Meter damageMeter{ 8, 384, 16.f, 320.f, {250,231,19} };
public:
    LevelOneScene(SceneManager& _sceneManager);

    void start();
    void reset();

    void leave();

    void update(float deltaTime);

    void render(sf::RenderWindow& window);

    void eventHandler(sf::Event& event);
};
