Commits

Allan Davis committed 04469a5

Added Game setup method to loop

  • Participants
  • Parent commits 0b9aa06

Comments (0)

Files changed (2)

code/HuntTheWumpus/HuntTheWumpus/Player.h

 //
 
 #import <Foundation/Foundation.h>
+#import "Entity.h"
 
 @interface Player : NSObject
 @property (strong) NSString *name;

code/HuntTheWumpus/HuntTheWumpus/models/Game.m

 + (void) startLoop{
     Game * game = [[Game alloc]init];
     game.gameRunning = YES;
+    //setup game
     while (game.gameRunning) {
         // update objects
         //draw the object
         //gather input
-        printf("Type exit to quit. \n");
-        NSString *input = [ADInput getString];
-        puts(input.UTF8String);
-        if ([input isEqualToString:@"exit"]) {
-            game.gameRunning = NO;
-        }
-        
+        [game exitGame];
     }
 }
 
+- (void) exitGame{
+    printf("Type exit to quit. \n");
+    NSString *input = [ADInput getString];
+    puts(input.UTF8String);
+    if ([input isEqualToString:@"exit"]) {
+        self.gameRunning = NO;
+    }
+
+}
+
+- (void) setup{
+    NSString *story = @"";
+}
 @end