Archimedes/Dash Da Capo!
Loading...
Searching...
No Matches
gameEngine.h
1#pragma once
2
3#include "pch.h"
4#include "TileType.h"
5#include "Tile.h"
6#include "TextBox.h"
7#include "Color.h"
8#include "Font.h"
9#include "Timer.h"
10
13{
14public:
15 Archimedes(Uint32 flags, const char* title, int x, int y, int w, int h);
17 virtual void runGameLoop();
18
21
31 bool loadTiles(std::vector<Tile*>& tileMap,
32 const std::vector<int>& levelInfo,
33 std::map<std::pair<int, int>, TileType>& coordinateToTileTypeMap,
34 std::map<std::pair<int, int>, std::string>& coordinateToEventTypeMap,
35 int TILE_COUNT,
36 int TYPE_COUNT,
37 int TILE_LENGTH
38 );
39
44 bool loadImageAssets(SDL_Renderer* renderer,
45 std::unordered_map<TextureWrapper*, std::string> textureFilePaths
46 );
47
56 bool clipSheet(int ROWS,
57 int COLS,
58 int BLOCK_LENGTH,
59 int BLOCK_HEIGHT,
60 int TYPE_COUNT,
61 std::vector<SDL_Rect>& sheetClipped
62 );
63
66 SDL_Window* getWindow() const;
67
70 SDL_Renderer* getRenderer() const;
71
77 std::vector<int> convertMapToVector(std::string pathName);
78
79 bool getQuit() const;
80 int getWidth() const;
81 int getHeight() const;
82 void setToQuit();
83
84private:
85 SDL_Window* window = nullptr;
86 SDL_Renderer* renderer = nullptr;
87 bool quit = false;
88 int width;
89 int height;
90};
Where the engine gets implemented.
Definition: gameEngine.h:13
std::vector< int > convertMapToVector(std::string pathName)
Takes in a .map file and parses it into a vector in the format that we need it. It's an intermediate ...
bool clipSheet(int ROWS, int COLS, int BLOCK_LENGTH, int BLOCK_HEIGHT, int TYPE_COUNT, std::vector< SDL_Rect > &sheetClipped)
Given the sheet specs, will clip the sheet into SDL rectangles.
void stopGameLoop()
Quits the game.
SDL_Window * getWindow() const
the public method to access the window object pointer
bool loadTiles(std::vector< Tile * > &tileMap, const std::vector< int > &levelInfo, std::map< std::pair< int, int >, TileType > &coordinateToTileTypeMap, std::map< std::pair< int, int >, std::string > &coordinateToEventTypeMap, int TILE_COUNT, int TYPE_COUNT, int TILE_LENGTH)
loads tiles into tileMap. Additionally we have it loading coordinates and event maps.
SDL_Renderer * getRenderer() const
the public method to access the renderer object pointer
bool loadImageAssets(SDL_Renderer *renderer, std::unordered_map< TextureWrapper *, std::string > textureFilePaths)
Loads the image assets.