platform-test/player.h

40 lines
751 B
C++

//Player class header
#ifndef __PLAYER_H_INCLUDED__
#define __PLAYER_H_INLCUDED__
#include<SDL2/SDL.h>
#include<iostream>
#include"dt.h"
#include"entity.h"
#include<cmath>
class Entity;
class Player: public Entity{
public:
//Player(/*int* collision*/);
void print();
int check(SDL_Rect rectB);
void init(int x, int y,int w, int h,SDL_Renderer** render);
//SDL_Rect getRectangle();
private:
int* coll;
void move();
int intVelX();
SDL_Renderer** renderer;
DeltaTime dTime;
bool ground;
bool topCollision;
//int posX, posY;
//int cVelocity, oldVelX, oldVelY, newVelX, newVelY;
float velocityX = 0;
float velocityY = 0;
bool isRunning = false;
int oldPosX, oldPosY;
//int szW = 40;
//int szH = 40;
};
#endif