/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. this.spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof(SpriteBatch), spriteBatch); this.scene1 = new OpeningScene(this); this.scene2 = new InstructionsScene(this, scene1); this.scene4 = new GameOverScene(this); this.scene3 = new GamePlayScene(this, scene4); this.scene1.Show(); Components.Add(scene1); Components.Add(scene2); Components.Add(scene3); Components.Add(scene4); // TODO: use this.Content to load your game content here }
// Use this for initialization void Start() { stringCutsceneMap = new Dictionary <string, IEnumerator> (); Cutscene openingCutScene = new OpeningScene("opening_scene"); stringCutsceneMap.Add(openingCutScene.myName, openingCutScene.MyCutscene()); Cutscene waterCanCutScene = new WaterCanScene("water_can_scene"); stringCutsceneMap.Add(waterCanCutScene.myName, waterCanCutScene.MyCutscene()); Cutscene coverManCutscene = new CoverManScene("cover_man_scene"); stringCutsceneMap.Add(coverManCutscene.myName, coverManCutscene.MyCutscene()); Cutscene toolboxCutscene = new ToolboxScene("technician_toolbox_scene"); stringCutsceneMap.Add(toolboxCutscene.myName, toolboxCutscene.MyCutscene()); Cutscene busToAsylumCutscene = new BusToAsylumScene("bus_to_asylum_scene"); stringCutsceneMap.Add(busToAsylumCutscene.myName, busToAsylumCutscene.MyCutscene()); Cutscene OpenGreenDoorScene = new OpenGreenDoorScene("open_green_door_scene"); stringCutsceneMap.Add(OpenGreenDoorScene.myName, OpenGreenDoorScene.MyCutscene()); Cutscene OpenGreenDoorMirrorScene = new OpenGreenDoorMirrorScene("open_green_door_mirror_scene"); stringCutsceneMap.Add(OpenGreenDoorMirrorScene.myName, OpenGreenDoorMirrorScene.MyCutscene()); Cutscene MeetgeMScene = new MeetgeMScene("meet_geM_scene"); stringCutsceneMap.Add(MeetgeMScene.myName, MeetgeMScene.MyCutscene()); }
protected override void _Update(GameStatus status) { base._Update(status); if (Mouse.Left || Mouse.Middle || Mouse.Right || Mouse.X != previousMouseX || Mouse.Y != previousMouseY) { previousActionTime = status.CurrentTimeInMillis; } UpdateBullet(status); if (Keyboard.GetHitPeriod(DX.KEY_INPUT_AT) == 1) { directShot = !directShot; } foreach (var obj in gameObjects) { obj.Update(status); } if (Keyboard.IsHit(DX.KEY_INPUT_ESCAPE)) { PauseScene s = new PauseScene(); s.Init(GameSettings); CallScene(s); } // 一定時間無操作なら、オープニング画面へ。 if ((status.CurrentTimeInMillis - previousActionTime) > 30 * 1000) { var s = new OpeningScene(); s.Init(GameSettings); s.SerialPort = SerialPort; GotoScene(s); } previousMouseX = Mouse.X; previousMouseY = Mouse.Y; }