Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "SDL.h"
- #include "Tile.h"
- #include "Game.h"
- class Player
- {
- public:
- //the player's position and size
- int xPos, yPos;
- int width, height;
- //where the player starts
- int starting_xPos;
- int starting_yPos;
- //the player's current animation and clips for animation
- int clip;
- SDL_Rect clips[10];
- //the x and y forces
- int yForce;
- int xForce;
- int delayed_yForce;
- //the direction the player is facing (0 is left, 1 is right)
- int direction;
- //if the player is on the ground, a collision has happened, player has double jumped, and key presses
- bool onGround;
- bool hit;
- bool doubleJump;
- bool left, right;
- //the player's image
- SDL_Surface* imgPlayer;
- //constructor / destructor
- Player();
- ~Player();
- //handle the input, move, check collision, render etc.
- void handle_input();
- void logic( Tile* tiles[] );
- void render();
- //move the camera over the player
- void move( Tile* tiles[] );
- void animate();
- void respawn();
- void set_camera();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement