-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCharacter.h
More file actions
57 lines (33 loc) · 759 Bytes
/
Character.h
File metadata and controls
57 lines (33 loc) · 759 Bytes
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Graphics.h"
#include "Animation/Animation.h"
#include "Chunks/Chunk.h"
#include "World.h"
class Character : public Animation
{
public:
Character(LPCTSTR bitmapPath, Graphics* graphics, float x, float y = 320, float xSpeed = 4,
float ySpeed = 0.2, float jumpHeight = 25, float gravity = 16.0, int acceleration = 500);
~Character();
void Render() override;
void Update() override;
private:
enum class Direction
{
null = 0,
Right = 'D',
Left = 'A',
Up = 0x20
};
bool jumping;
GameVector* feet;
GameVector* head;
GameVector* middle;
int acceleration;
void MoveRight() override;
void MoveLeft() override;
void UpdateCoordinates();
void Jump();
bool isOnLand();
Direction isNextToWall();
};