Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. #pragma once
  2. #include "SDL.h"
  3. #include "Tile.h"
  4. #include "Game.h"
  5.  
  6. class Player
  7. {
  8. public:
  9.   //the player's position and size
  10.     int xPos, yPos;
  11.     int width, height;
  12.  
  13.   //where the player starts
  14.     int starting_xPos;
  15.     int starting_yPos;
  16.  
  17.   //the player's current animation and clips for animation
  18.     int clip;
  19.     SDL_Rect clips[10];
  20.  
  21.   //the x and y forces
  22.     int yForce;
  23.     int xForce;
  24.     int delayed_yForce;
  25.  
  26.   //the direction the player is facing  (0 is left, 1 is right)
  27.     int direction;
  28.  
  29.   //if the player is on the ground, a collision has happened, player has double jumped, and key presses
  30.     bool onGround;
  31.     bool hit;
  32.     bool doubleJump;
  33.     bool left, right;
  34.  
  35.   //the player's image
  36.     SDL_Surface* imgPlayer;
  37.    
  38.   //constructor / destructor
  39.     Player();
  40.     ~Player();
  41.  
  42.   //handle the input, move, check collision, render etc.
  43.     void handle_input();
  44.     void logic( Tile* tiles[] );
  45.     void render();
  46.  
  47.   //move the camera over the player
  48.     void move( Tile* tiles[] );
  49.     void animate();
  50.     void respawn();
  51.     void set_camera();
  52. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement