Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #pragma once
  2. #include "SDL.h"
  3. #include "SDL_image.h"
  4. #include <string>
  5.  
  6. struct Game
  7. {
  8.   //frame regulation
  9.     int frame;
  10.     int fps;
  11.     int frame_start;
  12.  
  13.   //the screen's size
  14.     int screen_height;
  15.     int screen_width;
  16.  
  17.   //map info
  18.     int total_tiles;
  19.     int map_width;
  20.     int map_height;
  21.  
  22.   //the game's camera we see through
  23.     SDL_Rect camera;
  24.  
  25.   //tag for holding when the game ends
  26.     bool quit;
  27.  
  28.   //the buffer and event
  29.     SDL_Surface* buffer;
  30.     SDL_Event event;
  31.  
  32.   //constructor / destructor
  33.     Game();
  34.     ~Game();
  35.  
  36.   //functions for loading and applying surfaces
  37.     SDL_Surface* load_image( std::string filename );
  38.     void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL );
  39.  
  40.   //checks collision between to rectangles
  41.     bool check_collision( int ax, int ay, int aw, int ah, int bx, int by, int bw, int bh );
  42.  
  43.   //regualtes the frame rate
  44.     void regulate_frame();
  45.  
  46. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement