Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include "GamePanel.h"
#include <iostream>
#include <conio.h>
//set up the game
GamePanel::GamePanel(string levelFileName) {
//Initialize the player stats
_player.init(1, 100, 20, 10, 0);
//load the level [map]
_level.load(levelFileName, _player);
printf("%s was loaded!\n", levelFileName.c_str());
system("PAUSE");
}
void GamePanel::playGame() {
bool isDone = false;
while (isDone != true) {
//prints the lvl
_level.print();
//get player input
playerMove();
}
}
//player input in order to move around
void GamePanel::playerMove() {
char input;
std::cout<<("Enter a move command (w/s/a/d): ")<<std::endl;
input = _getch();
_level.movePlayer(input, _player);
}