mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2026-02-04 14:49:20 +01:00
40 lines
858 B
C++
40 lines
858 B
C++
#pragma once
|
|
#include "Collision.h"
|
|
|
|
class WorldLevel;
|
|
class Player
|
|
{
|
|
public:
|
|
|
|
Player(const Point2f& Position);
|
|
Collision::CollisionRect GetCollisionRect();
|
|
void Update(float elapsedTime, WorldLevel& level);
|
|
void Draw() const;
|
|
|
|
void SetPosition(Point2f pos) { m_Position = pos; }
|
|
Point2f GetPosition() const { return m_Position; }
|
|
|
|
void SetVelocity(Point2f vel) { m_Vel = vel; }
|
|
Point2f GetVelocity() const { return m_Vel; }
|
|
|
|
auto GetContactMap(){ return m_ContactMap; }
|
|
void SetContactMap(Collision::CollisionDirection dir, WorldTile* tile) { m_ContactMap[dir] = tile; }
|
|
|
|
void ProcessImGui();
|
|
|
|
private:
|
|
Point2f m_Position;
|
|
Point2f m_Size;
|
|
|
|
Point2f m_Vel;
|
|
|
|
std::map<Collision::CollisionDirection, WorldTile*> m_ContactMap;
|
|
|
|
Point2f m_Acc;
|
|
Point2f m_Gravity{ 0, -9.81f };
|
|
|
|
bool m_Grounded{ false };
|
|
|
|
bool m_DidJustDigRight{ false };
|
|
};
|