Permalink
Browse files

added introduction

  • Loading branch information...
1 parent 688674e commit 2d8a452d20438997e602fc971a0388b9c1f69428 @jbohman jbohman committed Jan 11, 2012
Showing with 17 additions and 1 deletion.
  1. +1 −0 actor.h
  2. +15 −1 controller.cpp
  3. +1 −0 controller.h
View
@@ -26,6 +26,7 @@ class Actor {
inline bool is_alive() { return health > 0; }
inline Weapon * get_weapon() { return current_weapon; }
+ inline void set_weapon(Weapon * weapon) { current_weapon = weapon; }
Place & place();
View
@@ -52,6 +52,8 @@ void Controller::run_game()
{
load("maps/map.txt");
+ introduction();
+
while (is_running) {
run_output();
run_input();
@@ -62,6 +64,16 @@ void Controller::run_game()
}
/**
+ * Controller::introduction
+ *
+ * Print the game introduction.
+ */
+void Controller::introduction() const
+{
+ std::cout << "The kid wakes up from a nightmare, but where is he? He must find his home without getting killed..." << std::endl;
+}
+
+/**
* Controller::load
*
* Loads the game, every actor, object and place.
@@ -164,7 +176,9 @@ void Controller::kill(Actor & actor)
}
/******************************************************************************
- * Available player commands
+ *
+ * Available player commands
+ *
*****************************************************************************/
void Controller::command_quit(std::istream & is)
{
View
@@ -42,6 +42,7 @@ class Controller {
protected:
bool is_running;
+ void introduction() const;
void run_output() const;
void run_input();
void run_step();

0 comments on commit 2d8a452

Please sign in to comment.