#pragma once

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include "iostream"

#include <cute_headers-master/cute_c2.h>
//#include <cute_headers-master/cute_ani.h>
#include "spriteRenderer.h"
#include "resourceManager.h"
#include "animationManager.h"

class Player
{
public:
	enum State {
		IDLE,
		WALK,
		RUN,
		JUMP
	};

	

	int onGround = 0;

	glm::vec2 Position, Size;
	float gravity = 1600.0f, maxGravity = 2000.0f, hAcceleration = 1600.0f, hDeacceleration = 800.0f,  maxSpeed = 300.0f,
		  jumpStrength = -800.0f,				   maxWalkingSpeed = 300.0f ,maxRunningSpeed = 450.0f;
	float hSpeed = 0.0f;
	float vSpeed = 0.0f;
	//aniamtions
	float animTime = 0.0f;
	float animSpeed;
	int direction = 0;
	int index = 0;
	int numTiles;
	Texture Sprite;
	glm::vec4 spriteUVs;

	tileSet* spriteSheet = new tileSet(Sprite, glm::ivec2(10,12));

	int state;

	c2AABB playerBody;

	Player(glm::vec2 pos, glm::vec2 size);
	~Player();

	void drawPlayer(SpriteRenderer& renderer);
	void calcPos(float dt);
	void animSprite(float dt);
private:
};