示例#1
0
        public static void Init()
        {
            gwinfo = GameDataFactory.CreateInitialWorldData();
            GameState.currentGameMode = GameState.GAME_MODE.WORLD;

            PlayUIWorldMap.Init(gwinfo.WorldMapInfo.MapInfo);

            PlayUITopItem.Init();
            PlayUIBottomItem.Init();
            PlayUILeftPanel.Init();
            PlayUIRightPanel.Init();

            //****************************************************************************
            ScreenManager.printInitScreen();
            //************************************************************************************

            ScreenManager.ClearScreen();

            PlayUITopItem.Update();
            PlayUIWorldMap.Update();
            PlayUIBottomItem.Update();
        }
示例#2
0
        public static void Update(float dt)
        {
            Point         pos;
            BoundaryPoint bpos;

            if (GameState.currentGameMode == GameState.GAME_MODE.WORLD)
            {
                PlayUIWorldMap.mapbox.MapInfo = gwinfo.WorldMapInfo.MapInfo;
                PlayUIWorldMap.Update();

                //**********************************************
                ScreenManager.upDatePassageLocation();
                //*********************************************

                if (GameState.subGameMode == GameState.GAME_SUBMODE.WORLD_DROPIN)       //Init Phase
                {
                    Random random       = ConfigManager.RandomGen;
                    int    randomNumber = random.Next(0, gwinfo.dropPointlist.Count - 1);
                    pos = gwinfo.dropPointlist.ElementAt(randomNumber);

                    col = pos.X + PlayUIWorldMap.mapBoxColPos;
                    row = pos.Y + PlayUIWorldMap.mapBoxRowPos;

                    gwinfo.The_Player.SetLocation(col, row);

                    processWorldNMapInput();
                }
                else if (GameState.subGameMode == GameState.GAME_SUBMODE.WORLD_PROCESSING)
                {
                    if (!backFromQuit)
                    {
                        //Susepend all Enemy
                        SuspendEnemies(GameState.currentRoom);

                        bpos = gwinfo.boundaryPointlist[GameState.currentRoom - 1].ElementAt((int)LastDirection);
                        col  = bpos.World.X + PlayUIWorldMap.mapBoxColPos;
                        row  = bpos.World.Y + PlayUIWorldMap.mapBoxRowPos;
                    }
                    else
                    {
                        //Do nothing
                        backFromQuit = false;
                    }

                    gwinfo.The_Player.SetLocation(col, row);
                    processWorldNMapInput();
                }
                else if (GameState.subGameMode == GameState.GAME_SUBMODE.WORLD_QUIT)
                {
                    HandleWorldQuit(col, row);
                }
                //processWorldNMapInput();
            }


            /*else if (GameState.currentGameMode == GameState.GAME_MODE.ROOM &&
            *    GameState.subGameMode == GameState.GAME_SUBMODE.WORLD_PROCESSING)*/
            if (GameState.currentGameMode == GameState.GAME_MODE.ROOM)
            {
                RoomMap roommap = null;

                if (GameState.subGameMode == GameState.GAME_SUBMODE.ROOM_PROCESSING)
                {
                    //Get the room data
                    roommap = gwinfo.RoomMapList.ElementAt(GameState.currentRoom - 1);

                    PlayUIWorldMap.mapbox.MapInfo = roommap.RoomInfo;
                    PlayUIWorldMap.Update();

                    //*********************************
                    PlayUILeftPanel.Update();
                    PlayUIRightPanel.Update();
                    PlayUIRightPanel.PaintLegendOption(GameState.currentRoom);

                    ScreenManager.upDateRoomLocation();
                    ScreenManager.printInitScreen4Room();
                    //*********************************

                    if (!backFromQuit)
                    {
                        bpos = gwinfo.boundaryPointlist[GameState.currentRoom - 1].ElementAt((int)LastDirection);
                        col  = bpos.Room.X + PlayUIWorldMap.mapBoxColPos;
                        row  = bpos.Room.Y + PlayUIWorldMap.mapBoxRowPos;
                        //Release the Enemy
                        ReleaseEnemies(GameState.currentRoom);
                    }
                    else
                    {
                        //Do nothing
                        //Release the Enemy
                        ReleaseEnemies(GameState.currentRoom);
                        backFromQuit = false;
                    }

                    gwinfo.The_Player.SetLocation(col, row);

                    processRoomMapInput(roommap);
                }
                else if (GameState.subGameMode == GameState.GAME_SUBMODE.ROOM_QUIT)
                {
                    HandleRoomQuit(col, row);
                }
            }
        }//End Fucnction
示例#3
0
 public static void switchMode(RoomMap roommap)
 {
     PlayUIWorldMap.mapbox.MapInfo = roommap.RoomInfo;
     PlayUIWorldMap.Update();
 }