#include <iostream>
#include <windows.h>
usingnamespace System;
usingnamespace std;
int refreshDisplay(int , int);
constchar wHole = '@';
constchar sTar = '*';
constchar bHole = 'x';
constchar player = 'P';
struct Player;
int programinfo();
void refreshDisplay (int , int);
int main()
{
programinfo();
// map dimensions from user//
int max_X = 0;
int max_Y = 0;
cout << "What is the dimension of the field you want to play on?" << endl;
cout << "width: ";
cin >> max_X;
cout << " Height: " << endl;
cin >> max_Y;
cout << endl;
Player player;
player.x = 1;
player.y = 1;
do
{
cki = Console::ReadKey( true );
switch ( cki.Key )
{
case ConsoleKey::W: player.y--; DisplayMap(player); break;
case ConsoleKey::S: player.y++; DisplayMap(player); break;
case ConsoleKey::A: player.x--; DisplayMap(player); break;
case ConsoleKey::D: player.x++; DisplayMap(player); break;
}
}
while ( cki.Key != ConsoleKey::Escape );
return 0;
}
struct Player
{
int x;
int y;
}
void refreshDisplay (int max_X, int max_Y);
{
for (int x =1; x < max_X; i++)
{
for (int y =1; y< max_y; y++)
cout << '.';
}
}
int programinfo()
{
cout <<" The oblective of the game is for the player to move around a 2 dimensional playing field and capture the star withought falling into a black hole or walking off the edge of the playing field. The controls are W = up S= down A=Left D=Right" <<endl;
}
need to some how implement 3 black hole X characters and 2 wormhole characters on field @ and a star *. all these char has to be randomly generated.