platform-test/src/entity/player.h

47 lines
796 B
C
Raw Normal View History

//Player class header<
2017-04-29 18:43:17 +00:00
#ifndef __PLAYER_H_INCLUDED__
#define __PLAYER_H_INCLUDED__
2017-04-29 18:43:17 +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>
#include"../dt.h"
2017-04-29 18:43:17 +00:00
#include"entity.h"
#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);
int print(int cameraX);
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;
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 17:12:59 +00:00
bool ground, topCollision;
bool isRunning = false;
bool ifRunning = false;
2017-04-29 18:43:17 +00:00
float velocityX = 0;
float velocityY = 0;
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;
int levelHeight;
2017-04-29 18:43:17 +00:00
};
#endif