-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcPlayer.h
38 lines (34 loc) · 1.13 KB
/
cPlayer.h
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
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2015 Kelvin Chandra, Software Laboratory Center, Binus University. All Rights Reserved.
#pragma once
#include "Globals.h"
#include "cSprite.h"
#include "cAnimation.h"
#include "cAnimControl.h"
class cPlayer
{
private:
cAnimControl *animControl;
std::vector<cSprite*> *playerSheet;
float x, y;
int width, height;
bool keys[255];
public:
cPlayer(std::vector<cSprite*> *playerSheet, float x, float y, int width, int height)
:playerSheet(playerSheet), x(x), y(y), width(width), height(height) {}
cPlayer();
~cPlayer();
virtual void Render();
virtual void Init();
virtual void Update(float tpf = 0.0333);
virtual void ReadKeyboard(unsigned char key, int x, int y, bool press);
virtual void ReadSpecialKeyboard(unsigned char key, int x, int y, bool press);
virtual void ReadMouse(int button, int state, int x, int y);
int Height() const { return height; }
void Height(int val) { height = val; }
int Width() const { return width; }
void Width(int val) { width = val; }
float X() const { return x; }
void X(float val) { x = val; }
float Y() { return y; }
void Y(float val) { y = val; }
};