Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <conio.h>
- #include "gameboard.h"
- #include "hero.h"
- using namespace std;
- //person::person() {}
- //person::person(int h, int p, int x, int y) : hp(h), attackPwr(p), xCo(x), yCo(y) {}
- void person::move(){
- char dir = 'x';
- cout << "Type Enter to quit\n";
- while (dir != '\r'){
- cout << "\nYour location is x" << xCo <<",y" << yCo;
- cout << "\nPress direction key(n,s,e,w):";
- dir = getche();
- switch(dir){
- case 'n':
- yCo++;
- break;
- case 's':
- yCo--;
- break;
- case 'e':
- xCo++;
- break;
- case 'w':
- xCo--;
- break;
- }
- currentCords();
- show();
- }
- }
- void person::currentCords(){
- board[xCo][yCo] = 178;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement