Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "SDL.h"
- #include "SDL_image.h"
- #include <string>
- struct Game
- {
- //frame regulation
- int frame;
- int fps;
- int frame_start;
- //the screen's size
- int screen_height;
- int screen_width;
- //map info
- int total_tiles;
- int map_width;
- int map_height;
- //the game's camera we see through
- SDL_Rect camera;
- //tag for holding when the game ends
- bool quit;
- //the buffer and event
- SDL_Surface* buffer;
- SDL_Event event;
- //constructor / destructor
- Game();
- ~Game();
- //functions for loading and applying surfaces
- SDL_Surface* load_image( std::string filename );
- void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL );
- //checks collision between to rectangles
- bool check_collision( int ax, int ay, int aw, int ah, int bx, int by, int bw, int bh );
- //regualtes the frame rate
- void regulate_frame();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement