diff --git a/database b/database new file mode 100644 index 0000000..9914190 --- /dev/null +++ b/database @@ -0,0 +1,21 @@ +#include "sqlite3.h" +#include "iostream" + +int DbConnectTest(int argc, char** argv) +{ + sqlite3* DB; + int exit = 0; + exit = sqlite3_open("allDB.db" , &DB); + + if (exit) + { + std::cerr << "Error open DB" << sqlite3_errmsg(DB) << std::endl; + return(-1); + } + else + std::cout << "Open Database Successfully!!!!" << std::endl; + sqlite3_close(DB); + return(0); + + +} diff --git a/maptile b/maptile new file mode 100644 index 0000000..9e5004c --- /dev/null +++ b/maptile @@ -0,0 +1,78 @@ +#include +#include +#include +#include +#include + +const int SCREEN_WIDTH = 640; +const int SCREEN_HEIGHT = 480; + +const int LEVEL_WIDTH = 1280; +const int LEVEL_WIDTH = 960; + +const int TILE_WIDTH = 80; +const int TILE_HEIGHT = 80; +const int TOTAL_TILES = 192; +const int TOTAL_TILE_SPRITES = 12; + + + +const int TILE_BROWN = 0; +const int TILE_GREEN = 1; +const int TILE_BLUE = 2; +const int TILE_WALL = 3; + + +class Tile +{ +public: + Tile(int x, int y, int tileType); + + void render(SDL_Rect & camera); + + int getType(); + + SDL_Rect getBox(); + +private: + SDL_Rect mBox; + + int mType; +}; + + +bool init(); + +bool loadMedia(Tile* tiles[]); + +void close(Tile* tiles[]); + + +bool setTiles(Tile *tiles[]); + +Tile::Tile(int x, int y, int tileType) +{ + mBox.x = x; + mBox.y = y; + + mBox.w = TILE_WIDTH; + mBox.h = TILE_HEIGHT; + + mType = tileType; + +} + +int Tile::getType() +{ + return mType; + +} + +bool loadMedia(Tile* tiles[]) +{ + bool success = true; + if (!gTileTexture.loadFromFile("Imagens/tiletect.png")) + { + printf( "Failed to load tile set texture!!!\n") + } +}