예제 #1
0
        public CastleConsole() : base(40, 25)
        {
            currentTurnCount       = 0;
            this.mapReader         = new MapReader();
            GameResult             = GameResult.Quit;
            ItemManager            = new ItemManager(UpdateMap);
            this.gameOver          = false;
            this.IsVisible         = false;
            this.firstRelease      = true;
            RunTick                = false;
            keyboardHandlerObject  = new ClassicConsoleKeyboardHandler();
            VirtualCursor.Position = new Point(Room.MapWidth + 1, Room.MapHeight + 4);
            KeyboardHandler        = keyboardHandlerObject.HandleKeyboard;

            keyboardHandlerObject.EnterPressedAction = EnterPressedActionHandler;

            // Enable the keyboard and setup the prompt.
            CanUseKeyboard          = true;
            VirtualCursor.IsVisible = true;
            // Startup description
            CellData.Clear();
            _cellData.TimesShiftedUp = 0;
            VirtualCursor.Print(CastleAdventureResources.CommandPrompt);


            currentRoomIndex = 1;
            player           = new Player();
            player.Position  = new Microsoft.Xna.Framework.Point(_cellData.Width / 2, _cellData.Height / 2);



            DrawBorder();
            DrawRoom();
        }
예제 #2
0
        public CastleConsole()
            : base(40, 25)
        {
            currentTurnCount = 0;
            this.mapReader = new MapReader();
            GameResult = GameResult.Quit;
            ItemManager = new ItemManager(UpdateMap);
            this.gameOver = false;
            this.IsVisible = false;
            this.firstRelease = true;
            RunTick = false;
            keyboardHandlerObject = new ClassicConsoleKeyboardHandler();
            VirtualCursor.Position = new Point(Room.MapWidth + 1, Room.MapHeight + 4);
            KeyboardHandler = keyboardHandlerObject.HandleKeyboard;

            keyboardHandlerObject.EnterPressedAction = EnterPressedActionHandler;

            // Enable the keyboard and setup the prompt.
            CanUseKeyboard = true;
            VirtualCursor.IsVisible = true;
            String Prompt = "?";

            // Startup description
            Clear();
            TimesShiftedUp = 0;
            VirtualCursor.Print(Prompt);

            currentRoomIndex = 1;
            player = new Player();
            player.Position = new Microsoft.Xna.Framework.Point(Width / 2, Height / 2);

            DrawBorder();
            DrawRoom();
        }