platform-test/player.h

44 lines
805 B
C
Raw Normal View History

2017-04-29 18:43:17 +00:00
//Player class header
#ifndef __PLAYER_H_INCLUDED__
#define __PLAYER_H_INCLUDED__
2017-04-29 18:43:17 +00:00
#include<SDL2/SDL.h>
#include<iostream>
2017-05-01 17:40:03 +00:00
#include<cmath>
2017-04-29 18:43:17 +00:00
#include"dt.h"
#include"entity.h"
2017-05-01 17:40:03 +00:00
#include"texture.h"
2017-04-29 18:43:17 +00:00
class Entity;
class Player: public Entity{
public:
void print(int cameraX);
int check(SDL_Rect rectA,int type);
Player(int x, int y,int w, int h,SDL_Renderer** render);
2017-04-29 18:43:17 +00:00
private:
int* coll;
2017-05-01 17:40:03 +00:00
bool 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;
int power = 0;
2017-05-01 17:40:03 +00:00
PosuTexture ply;
SDL_Rect* currentFrame;
const static int plyNum = 6;
SDL_Rect plyFrame[plyNum];
2017-04-29 18:43:17 +00:00
};
#endif