Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tilemap.h:
- **********
- #include <iostream>
- #include <windows.h>
- #include <ctime>
- #include <cstdlib>
- #include player.h
- using namespace std;
- class tileMap
- {
- public:
- double xCoords, yCoords, xCellSize, yCellSize;
- double xCheck[10];
- double yCheck[10];
- tileMap(double x, double y)
- {
- //NOTE: Set the x and y params with respect to the cell size;
- //eg. with a cell size of 10x10, a 200x100 map should be 2000x1000.
- xCoords = x;
- yCoords = y;
- xCellSize = 10;
- yCellSize = 10;
- }
- bool isOccupied(double x, double y)
- {
- for(int i = 0; i < 10; i++)
- {
- if(x == xCheck[i])
- {
- for(int j = 0; j < 10; j++)
- {
- if(y == yCheck[j])
- {
- return true;
- }
- else { continue; }
- }
- return false;
- }
- else { continue; }
- }
- return false;
- }
- };
- **********
- player.h
- **********
- #include <iostream>
- #include <windows.h>
- #include <ctime>
- #include <cstdlib>
- #include tileMap.h
- using namespace std;
- class player
- {
- public:
- double xPlay, yPlay, xSize, ySize;
- short health;
- player()
- {
- health = 100;
- xSize = 10;
- ySize = 20;
- xPlay =
- }
- };
- **********
- main.cpp
- **********
- #include <iostream>
- #include <windows.h>
- #include <ctime>
- #include <cstdlib>
- #include tileMap.h
- #include player.h
- using namespace std;
- int main()
- {
- tileMap rOne(2000,1000);
- }
- **********
Add Comment
Please, Sign In to add comment