mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 17:51:47 +01:00
Added basic player / collisions in player
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "Collision.h"
|
||||
|
||||
class WorldLevel;
|
||||
class Player
|
||||
@@ -6,8 +7,18 @@ class Player
|
||||
public:
|
||||
|
||||
Player(const Point2f& Position);
|
||||
void Update(float elapsedTime, const WorldLevel& level);
|
||||
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; }
|
||||
|
||||
private:
|
||||
Point2f m_Position{};
|
||||
@@ -15,6 +26,8 @@ private:
|
||||
|
||||
Point2f m_Vel{};
|
||||
|
||||
std::map<Collision::CollisionDirection, WorldTile*> m_ContactMap{};
|
||||
|
||||
Point2f m_Acc{};
|
||||
Point2f m_Gravity{ 0, -9.81f };
|
||||
float m_MaxSpeed{ 200 };
|
||||
|
||||
Reference in New Issue
Block a user