-
Notifications
You must be signed in to change notification settings - Fork 1
/
Player.h
44 lines (38 loc) · 867 Bytes
/
Player.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
39
40
41
42
43
44
#pragma once
#include "Object.h"
class Player :public Object
{
private:
double gravity = 0.2;
double Ypos = 256;
double Xpos;
double accelerator1 = 0;
double accelerator2 = 0;
bool inJump = false;
double jumpHeight = -10;
double jumpTimer;
double lastJump = 0;
int incY1 = 0;
int pipeDistance1 = 400;
int x, y;
int width, height;
int animationTimer;
SDL_Texture* Tex1;
SDL_Texture* Tex2;
SDL_Texture* Tex3;
public:
void Gravity();
void GetJumpTime();
void Jump();
int Ypo();
int Xpo();
bool JumpState();
void Render(SDL_Renderer* ren);
void RenderDead(SDL_Renderer* ren);
void CreateTexture1(const char* address, SDL_Renderer* ren);
void CreateTexture2(const char* address, SDL_Renderer* ren);
void CreateTexture3(const char* address, SDL_Renderer* ren);
bool PipeUpdate(int incY, int& score);
int getPipe1X();
int getPipe1Y();
};