Repository navigation
Expand file tree
/
Copy pathtryingStuff.cpp
More file actions
100 lines (68 loc) · 1.59 KB
/
Copy pathtryingStuff.cpp
File metadata and controls
100 lines (68 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include <iostream>
#include <ctime>
#include <Windows.h>
#include "GameMap.h"
//#include "WORLD.h"
using namespace std;
int posx = 500; int posy = 500;
int main()
{
//srand(time(0));
//seed for map generator
int seed = 683575564;
seed = rand() % 10000000;
srand(seed);
//temporary environent to see the map in action!
MYRECT window;
window.tall = 80;
window.wide = 80;
HWND console = GetConsoleWindow();
MoveWindow(console, 0, 0, 1800, 1000, TRUE);
string name = "";
cout << "This is the Map generator test environment" << endl;
cout << "Created by Mitchell Marsh..." << endl;
cout << "Please enter the name of the map to generate: ";
cin >> name;
cout << endl << endl << endl;
GameMap myGame;
myGame.CreateNewMap(name);
//manage player position!
//pass player position into display funciton
// have an input collector to look for WASD or arrows
//display each positions contents to the screen next to it
//display the current position
bool quit = false;
char in;
while (!quit)
{
system("CLS");
myGame.displayMap(posx, posy, window);
cout << "Map Position: "; myGame.displayWorldCoords(); // only for debug
cin >> in;
if (in == 'w')
{
posy = posy - 5;
}
else if (in == 's')
{
posy = posy + 5;
}
else if (in == 'a')
{
posx = posx - 5;
}
else if (in == 'd')
{
posx = posx + 5;
}
else if (in == 'q' || in == 'Q')
{
quit = true;
}
}
cout << "Press Enter to End" << endl;
cin.ignore(256, '\n');
return 0;
}
/*
*/