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
|
int main()
{
//todo, make sure the x and y thing works, use demonstration file to work it.
int mapArray[8][8];
int currentCoords[8][8];
for(int j = 0; j < 8; j++)
{
for(int k = 0; k < 8; k++)
{
mapArray[j][k] = (k+1)+(j*8);
currentCoords[j][k] = (k+1)+(j*8);
}
}
//see array demonstration file at: https://onlinegdb.com/Hkss7xJo7
int x = 0; //increases moving rightwards, decreases leftwards.
int y = 0; //increases upwards, decreases downwards.
//64 if statements evaluate whether or not currentLocation[x][y] == mapArray[z][z]
//make graph of 8*8 on paper and use it for reference.
//[y] goes first, [x] goes second.
printInfo();
PLAYER mainCharacter;
//constructor sets basic variables/values.
//constructor now outputs max hp, hp, exp, name, class, and level.
//perhaps make a while loop which takes input every time an action is done, asking for user's next course of action.
//likely separate action inputs, one for combat, one for exploration, one for dialogue
char begin = beginAdventure();
bool playing = true;
int movementChoice = 0;
if(begin == 'b')
{
bool inCombat = false; //we will use RNG to determine whether a monster spawns. if one does, inCombat = true, and another while loop executes. we want
adventureText(); //we also want that rng to be based off of the environment/position on the mapArray.
while(playing == true)
{
//we have x and y, evaluate whether currentPositon[x][y] is equal to mapArray[x][y]
if(currentCoords[y][x] == mapArray[0][0])
{
//display environment details
//check to see whether a monster spawns
//if true, fight monster.
//generate loot/exp/etc
//if false, show movement options.
movementChoice = movementOptions(y, x); //eventually there should be tabs for these, if statement wise.
if(movementChoice == 1) { y++; }
else if(movementChoice == 2) { y--; }
else if(movementChoice == 3) { x--; }
else if(movementChoice == 4) { x++; } cout << currentCoords[y][x] << endl;
}
else if(currentCoords[y][x] == mapArray[0][1])
{
//display environment details
//check to see whether a monster spawns
//if true, fight monster.
//generate loot/exp/etc
//if false, show movement options.
movementChoice = movementOptions(y, x); //eventually there should be tabs for these, if statement wise.
if(movementChoice == 1) { y++; }
else if(movementChoice == 2) { y--; }
else if(movementChoice == 3) { x++; }
else if(movementChoice == 4) { x--; } cout << currentCoords[y][x] << endl;
}
|