internal WorldPart(MapItem data, MapInfo mapDataList, SencePart sencePart, int collusionLayer, MapManager.MapLoadingData loadingData) { m_data = loadingData; int count = data.List.Count; m_manager = WorldManager.GetInstance(); m_mapData = sencePart; m_collusionLayer = collusionLayer; //m_filepath = new string[count]; m_layers = new MapDrawer[count +1]; string path = "Maps/" + mapDataList.Name + "/"; m_locate = new Vector2(data.X * ImageSize, data.Y * ImageSize); foreach( var textureInfo in data.List) { DataReader.LoadAsync<Texture2D>( path + textureInfo.Texture, LoadingItemCallback, textureInfo.Layer ); m_data.LoadingLeft++; } }
public override void Initialize() { m_audioManager = AudioManager.GetInstance(); m_audioManager.LoadSound("SongOfWaterSpray",DataReader.Load<SoundEffect>("MusicAndSoundEffect/SoundEffect/SongOfWaterSpray")); m_audioManager.LoadSong("SongOfRunningGame", DataReader.Load<Song>("MusicAndSoundEffect/Song/MusicOfRunningGameState")); m_levels = MapManager.GetInstance(); m_world = WorldManager.GetInstance(); m_sence = SenceManager.GetInstance(); m_effect = GraphicsManager.GetInstance(); m_stateManager = StateManager.GetInstance(); //m_levels.Load( "Map6" ); m_levels.Goto( "Map0" ); //m_levels.Load("Map0"); player = m_world.Player; m_renderTarget2D = new RenderTarget2D( HealGame.Game.GraphicsDevice, 800, 600, false, HealGame.Game.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8 ); m_resolveTarget = new RenderTarget2D( HealGame.Game.GraphicsDevice, 800, 600, false, HealGame.Game.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8); //DataReader.Load<Effect>("Effect/Blur"); }
public MapManager() { m_instance = this; }
private void InternalLoad(MapManager.MapLoadingData data) { m_senceManager.Initialize(data.Size.X, data.Size.Y, WorldPart.ImageSize); EntityCreator.Load(data.Name); foreach (SencePart sencePart in data.Sence) { m_senceManager[sencePart.X, sencePart.Y] = sencePart; } Pieces = data.Pieces; m_part = data.Parts; m_layers = data.Layers; Player = m_entityCreator.Player; m_collusionLayer = data.CollusionLayer; m_layerCount = data.LayerCount; m_size = data.Size; m_worldSize = data.WorldSize; m_senceManager.CameraLocate = CheckLocation(data.Player); m_senceManager.CameraFollow = CheckLocation(data.Player); if(Player!=null)Player.Locate = data.Player; GameItemState.Set("currentmap", data.Name); GameItemState.Set( "locate", data.Player ); GameCommands.Enqueue(data.PostLoading); GameItemState.Save(); }
/// <summary> /// Loads the specified level from data. /// </summary> internal void Load(MapManager.MapLoadingData data, int x, int y) { SwitchTo(RunningState.Loading, data); data.Player.X = x; data.Player.Y = y; }
public override void Initialize() { Space = new Vector2(HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height); m_level = MapManager.GetInstance(); m_senceManager = SenceManager.GetInstance(); m_graphic = GraphicsManager.GetInstance(); m_entityCreator = EntityCreator.GetInstance(); m_dialog = DialogManager.GetInstance(); m_camera = CameraManager.GetInstance(); m_splash = new SplashTools(); m_splash.Initialize(); m_handbook = new HandbookTools(); m_handbook.Initialize(); }