summaryrefslogtreecommitdiffhomepage
path: root/Player.cpp
blob: 736f96ad376eb6a0298daf9f41956a5fa82184db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "Player.h"

#include <raylib.h>


Player::Player() :
    m_position {400, 450}
{
}


void
Player::update(const float dt)
{
    if (IsKeyDown(KEY_LEFT))
        m_position.x -= dt * 80;
    if (IsKeyDown(KEY_RIGHT))
        m_position.x += dt * 80;
}


void
Player::draw()
{
    DrawCircle(m_position.x, m_position.y, 10, LIGHTGRAY);
}