42 lines
749 B
C++
42 lines
749 B
C++
//Player class header
|
|
|
|
#ifndef __PLAYER_H_INCLUDED__
|
|
#define __PLAYER_H_INCLUDED__
|
|
|
|
#include<SDL2/SDL.h>
|
|
#include<iostream>
|
|
#include<cmath>
|
|
#include"dt.h"
|
|
#include"entity.h"
|
|
#include"texture.h"
|
|
|
|
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);
|
|
private:
|
|
void loadMedia();
|
|
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;
|
|
bool ifRunning = false;
|
|
int oldPosX, oldPosY;
|
|
int power = 0;
|
|
|
|
PosuTexture ply;
|
|
SDL_Rect plyFrame[3];
|
|
SDL_Rect plyRun;
|
|
};
|
|
|
|
#endif
|