|
|
@ -5,12 +5,13 @@ |
|
|
|
#include "Entity.h" |
|
|
|
#include "Entity.h" |
|
|
|
#include <QPainter> |
|
|
|
#include <QPainter> |
|
|
|
|
|
|
|
|
|
|
|
class Player : public Entity, public GameListener, public InputListener { |
|
|
|
class Player : public Entity, public InputListener { |
|
|
|
QVector2D pos {50, 50}; |
|
|
|
QVector2D pos {50, 50}; |
|
|
|
QVector2D vel {}; |
|
|
|
QVector2D vel {}; |
|
|
|
QVector2D acc {0, 9.81 * 30}; |
|
|
|
QVector2D acc {0, 9.81 * 30}; |
|
|
|
|
|
|
|
|
|
|
|
float ground = 400; |
|
|
|
float ground = 400; |
|
|
|
|
|
|
|
void jump(); |
|
|
|
public: |
|
|
|
public: |
|
|
|
void draw(QPainter &painter); |
|
|
|
void draw(QPainter &painter); |
|
|
|
void update(float dTime); |
|
|
|
void update(float dTime); |
|
|
|