Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] player actually moves when walking

:)
  • Loading branch information...
commit 4d8064f7a7bc76861c94f4e44128abd9cb26dcd4 1 parent df5be0e
Carl Mäsak authored July 04, 2012

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  bin/crypt
13  bin/crypt
@@ -292,6 +292,9 @@ class Adventure::Engine {
292 292
             my $direction = .direction;
293 293
             %!exits{$room1}{$direction} = $room2;
294 294
         }
  295
+        when Adventure::PlayerWalked {
  296
+            $!player_location = .to;
  297
+        }
295 298
     }
296 299
 }
297 300
 
@@ -570,6 +573,16 @@ multi MAIN('test') {
570 573
             };
571 574
     }
572 575
 
  576
+    {
  577
+        my $game = Crypt::Game.new();
  578
+
  579
+        $game.walk('east');
  580
+        throws_exception
  581
+            { $game.walk('east') },
  582
+            X::Adventure::NoExitThere,
  583
+            'the player actually moves to the next room';
  584
+    }
  585
+
573 586
     done;
574 587
 }
575 588
 

0 notes on commit 4d8064f

Please sign in to comment.
Something went wrong with that request. Please try again.