2017-06-16 15:24:22 +00:00
|
|
|
//Player class header<
|
2017-04-29 18:43:17 +00:00
|
|
|
|
|
|
|
#ifndef __PLAYER_H_INCLUDED__
|
2017-05-05 14:19:44 +00:00
|
|
|
#define __PLAYER_H_INCLUDED__
|
2017-04-29 18:43:17 +00:00
|
|
|
|
2017-06-16 15:24:22 +00:00
|
|
|
#include<SDL.h>
|
2017-04-29 18:43:17 +00:00
|
|
|
#include<iostream>
|
2017-05-01 17:40:03 +00:00
|
|
|
#include<cmath>
|
2017-06-16 15:24:22 +00:00
|
|
|
#include"../dt.h"
|
2017-04-29 18:43:17 +00:00
|
|
|
#include"entity.h"
|
2017-06-16 15:24:22 +00:00
|
|
|
#include"../texture.h"
|
2017-04-29 18:43:17 +00:00
|
|
|
|
|
|
|
class Entity;
|
|
|
|
|
|
|
|
class Player: public Entity{
|
|
|
|
public:
|
2017-06-21 20:03:11 +00:00
|
|
|
Player(int x,int y,int lvlH,SDL_Renderer* render);
|
2017-06-17 16:02:03 +00:00
|
|
|
int print(int cameraX);
|
2017-05-05 14:19:44 +00:00
|
|
|
int check(SDL_Rect rectA,int type);
|
2017-04-29 18:43:17 +00:00
|
|
|
private:
|
2017-05-06 07:52:25 +00:00
|
|
|
void loadMedia();
|
2017-04-29 18:43:17 +00:00
|
|
|
void move();
|
2017-06-21 20:03:11 +00:00
|
|
|
void die();
|
2017-04-29 18:43:17 +00:00
|
|
|
int intVelX();
|
2017-06-17 17:12:59 +00:00
|
|
|
|
|
|
|
SDL_Rect plyFrame[3];
|
|
|
|
SDL_Rect plyRun;
|
2017-06-17 16:02:03 +00:00
|
|
|
SDL_Renderer* renderer;
|
2017-04-29 18:43:17 +00:00
|
|
|
DeltaTime dTime;
|
2017-06-17 17:12:59 +00:00
|
|
|
Texture ply;
|
2017-06-17 16:02:03 +00:00
|
|
|
|
2017-06-17 17:12:59 +00:00
|
|
|
bool ground, topCollision;
|
2017-06-17 16:02:03 +00:00
|
|
|
bool isRunning = false;
|
|
|
|
bool ifRunning = false;
|
|
|
|
|
2017-04-29 18:43:17 +00:00
|
|
|
float velocityX = 0;
|
|
|
|
float velocityY = 0;
|
2017-06-17 16:02:03 +00:00
|
|
|
|
2017-06-17 17:12:59 +00:00
|
|
|
//int posX, posY;
|
2017-06-21 20:03:11 +00:00
|
|
|
int initPosX, initPosY;
|
2017-04-29 18:43:17 +00:00
|
|
|
int oldPosX, oldPosY;
|
2017-06-17 17:12:59 +00:00
|
|
|
int power;
|
2017-06-17 16:02:03 +00:00
|
|
|
int levelHeight;
|
2017-04-29 18:43:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|