Ejemplo n.º 1
0
        public void updateLevelModel(IGameConfig gameConfig)
        {
            roomModel = new RoomModel();
            ILevelConfigVO levelConfigVO = gameConfig.levelConfig.getConfigById(levelId);

            roomModel.setHasEnemy(levelConfigVO.hasEnemy);

            roomModel.bgAssetInfo = gameConfig.assetConfig.getBgAssetById(levelId).clone();
            if (isRoomLevel)
            {
                Vector2 minXAndY = roomModel.bgAssetInfo.minXAndY;
                roomModel.bgAssetInfo.minXAndY = new Vector2(minXAndY.x + playerPosX, minXAndY.y);

                Vector2 maxXAndY = roomModel.bgAssetInfo.maxXAndY;
                roomModel.bgAssetInfo.maxXAndY = new Vector2(maxXAndY.x + playerPosX, maxXAndY.y);
            }
        }
Ejemplo n.º 2
0
        public void Reset()
        {
            levelId       = 1;
            playerId      = 0;
            waveId        = 0;
            createEnemyId = 0;
            resetPlayerPosX();
            roomNum = 0;
            if (roomModel == null)
            {
                roomModel = new RoomModel();
            }

            roomModel.Reset();

            if (playerModel != null)
            {
                playerModel.resetHp();
            }
        }