platform-test/source/entity/player.h

43 lines
748 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-05-21 07:22:25 +00:00
void print(int x, int y,int cameraX);
int check(SDL_Rect rectA,int type);
2017-05-21 07:22:25 +00:00
Player(SDL_Renderer** render);
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();
int intVelX();
SDL_Renderer** renderer;
DeltaTime dTime;
bool ground;
bool topCollision;
//int posX, posY;
float velocityX = 0;
float velocityY = 0;
bool isRunning = false;
2017-05-01 17:40:03 +00:00
bool ifRunning = false;
2017-04-29 18:43:17 +00:00
int oldPosX, oldPosY;
2017-05-21 07:22:25 +00:00
bool first;
int power = 0;
2017-05-01 17:40:03 +00:00
Texture ply;
2017-05-06 16:01:20 +00:00
SDL_Rect plyFrame[3];
SDL_Rect plyRun;
2017-04-29 18:43:17 +00:00
};
#endif