#include "player.h"
#include "debuggers.h"
#include "olcPGEX_Sound.h"
#include <iostream>

namespace pabloader {
Player::Player(Debuggers* game)
    : Programmer(game)
{
#ifdef _DEBUG
    DEBUG_COLOR = olc::BLUE;
#endif
}

void Player::Think()
{
    doJump = game->GetKey(olc::SPACE).bHeld;
    walkLeft = game->GetKey(olc::A).bHeld;
    walkRight = game->GetKey(olc::D).bHeld;
    moveDown = game->GetKey(olc::S).bHeld;
#ifdef _DEBUG
    if (game->debug) {
        // game->DrawString(1, 19, std::to_string(x) + " " + std::to_string(y));
        // game->DrawString(1, 28, std::to_string(xv) + " " + std::to_string(yv));

        if (game->GetKey(olc::J).bPressed) {
            tile.x = (tile.x + 1) % tileDim.x;
        }
    }
#endif
}
}