43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#include <iostream>
|
|
|
|
#include "Dungeon.cpp"
|
|
#include "GameCharacter.cpp"
|
|
#include "Player.cpp"
|
|
#include "Item.cpp"
|
|
#include "Room.cpp"
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
cout << "Welcome to our dungeon crawler! What is your name?\n";
|
|
string name;
|
|
cin >> name;
|
|
|
|
Player player = Player(name, 100, 30, 5);
|
|
|
|
Item sword = Item("Sword", 0, 50, 0);
|
|
GameCharacter smallEnemy = GameCharacter("Pilon", 30, 10, 5);
|
|
GameCharacter bigEnemy = GameCharacter("Grand Pilon", 75, 60, 25);
|
|
|
|
Room rooms[] = {
|
|
Room(0, false, vector<Item>(), vector<GameCharacter>()),
|
|
Room(1, false, vector<Item>({ sword }), vector<GameCharacter>()),
|
|
Room(2, false, vector<Item>(), vector<GameCharacter>({ smallEnemy })),
|
|
Room(3, true, vector<Item>(), vector<GameCharacter>({ bigEnemy})),
|
|
};
|
|
|
|
Dungeon dungeon = Dungeon(player);
|
|
dungeon.rooms[0] = rooms[0];
|
|
dungeon.rooms[1] = rooms[1];
|
|
dungeon.rooms[2] = rooms[2];
|
|
dungeon.rooms[3] = rooms[3];
|
|
|
|
while (true) {
|
|
int result = dungeon.runDungeon();
|
|
if (result == 0) {
|
|
cout << "Goodbye!";
|
|
return 0;
|
|
}
|
|
}
|
|
}
|