Example #1
0
        public static void NewGame()
        {
            string pcName = "SCiENiDE_TESTING";

            //for testing purposes we set the char name manually;
            //else use the bottom row.
            //string pcName = UIElements.PromptForName();

            UIElements.InGameUI();

            messageLog = new MessageLog(0, Globals.CONSOLE_HEIGHT - 1, Globals.GAME_FIELD_BOTTOM_RIGHT.X,
                (Globals.CONSOLE_HEIGHT - (Globals.GAME_FIELD_BOTTOM_RIGHT.Y + 1)), true);
            MessageLog.SendMessage("~w13!Message ~W2!log ~l11!i~l3!n~s11!itialized.");
            MessageLog.DeleteLog();

            Units.Clear();
            gameField = SaveLoadTools.LoadMap();       //load map; change it to generate map!
            MapFileName = @"../../maps/0.wocm";
            Item.LastItemID = SaveLoadTools.LastItemID();
            Flags pcFlags = Flags.IsCollidable | Flags.IsMovable | Flags.IsPlayerControl;
            Unit pc = new Unit(10, 10, pcFlags, '@', ConsoleColor.White, pcName, new UnitAttributes());
            Units.Add(pc);
            GameTime = new GameTime();

            Initialize(pc);
        }
Example #2
0
        public static void LoadGame()
        {
            UIElements.InGameUI();

            messageLog = new MessageLog(0, Globals.CONSOLE_HEIGHT - 1, Globals.GAME_FIELD_BOTTOM_RIGHT.X,
                (Globals.CONSOLE_HEIGHT - (Globals.GAME_FIELD_BOTTOM_RIGHT.Y + 1)), true);
            MessageLog.SendMessage("Message log initialized.");

            Units.Clear();
            SaveLoadTools.LoadGame();
            
            foreach (var unit in Units)
                if (unit.Flags.HasFlag(Flags.IsPlayerControl))
                {
                    Initialize(unit);
                    break;
                }
        }