Esempio n. 1
0
 public void initialize(ContentUtil content, SceneActivationParameters parameters)
 {
     this.video = content.load<Video>(this.videoName);
     this.player = null;
     this.size = new Rectangle(0, 0, 0, 0);
     this.forceExit = false;
     this.firstUpdate = true;
 }
Esempio n. 2
0
        public void initialize(ContentUtil content, SceneActivationParameters parameters)
        {
            this.exit = false;
            this.content = content;
            this.scenes = new Dictionary<string,IScene>();
            this.defaultScene = "menu";

            this.scenes["story_01"] = new VideoScene("video/story_01");
            this.scenes["story_02"] = new VideoScene("video/story_02");
            this.scenes["story_03"] = new VideoScene("video/story_03");
            this.scenes["story_04"] = new VideoScene("video/story_04");
            this.scenes["credits"] = new VideoScene("video/credits");

            SceneChain storyMode = new SceneChain();
            storyMode.addToChain(
                "story_01",
                "level_01",
                "story_02",
                "level_02",
                "story_03",
                "level_03",
                "story_04",
                "level_04",
                "credits");
            this.scenes["story_mode"] = storyMode;

            MenuScene menu = new MenuScene();
            this.scenes["menu"] = menu;
            //menu.add(new MenuItem("story_mode", "Story Mode", this));

            this.addDanceScene("level_01", menu);
            this.addDanceScene("level_02", menu);
            this.addDanceScene("level_03", menu);
            this.addDanceScene("level_04", menu);
            //menu.add(new MenuItem("highscore", "Highscore", new HighscoreParams("T-Bone the Steak")));
            this.scenes["highscore"] = new HighscoreScene();

            //menu.add(new MenuItem("exit", "Quit Game"));

            menu.buildMenuStructure(this);

            this.initIntroScenes();
        }
Esempio n. 3
0
 public virtual void initialize(ContentUtil content, SceneActivationParameters parameters)
 {
     this.manager = (SceneManager) parameters.parameters;
     this.currentSceneIndex = -1;
     this.activateNext();
 }
Esempio n. 4
0
 private IScene initScene(SceneActivationParameters parameters)
 {
     IScene nextScene = this.scenes[parameters.sceneName];
     nextScene.initialize(this.content, parameters);
     return nextScene;
 }
Esempio n. 5
0
 private SceneActivationParameters initSceneParamsUsingDefaults(SceneActivationParameters sceneParams)
 {
     if (null == sceneParams)
         sceneParams = new SceneActivationParameters();
     if (null == sceneParams.sceneName)
         sceneParams.sceneName = this.defaultScene;
     return sceneParams;
 }
Esempio n. 6
0
        public void update(InputState input)
        {
            if (this.exit)
                return;

            if (null == this.activeScene) {
                SceneActivationParameters sceneParams =
                    this.initSceneParamsUsingDefaults(this.nextSceneParams);

                this.activeScene = this.initScene(sceneParams);
            }

            this.activeScene.update(input);

            if (this.activeScene.wantsToExit()) {
                this.nextSceneParams = this.initSceneParamsUsingDefaults(this.activeScene.nextScene());
                this.activeScene.cleanup();

                if ("exit".Equals(this.nextSceneParams.sceneName.ToLower())) {
                    this.exit = true;
                } else {
                    this.activeScene = null;
                }
            }
        }
Esempio n. 7
0
        private void initIntroScenes()
        {
            FadeInPictureScene sceneHairware = new FadeInPictureScene("intro/hairware", Color.White, 2000);
            FadeInPictureScene sceneGA = new FadeInPictureScene("intro/games_academy", Color.White, 2000);
            FadeInPictureScene sceneOmnom = new FadeInPictureScene("intro/omnom", Color.White, 4000);
            this.scenes["intro_ga"] = sceneGA;
            this.scenes["intro_hairware"] = sceneHairware;
            this.scenes["intro_omnom"] = sceneOmnom;

            MusicalSceneChain chain = new MusicalSceneChain("intro/introsound", 120f);
            chain.addToChain("intro_ga", "intro_hairware", "intro_omnom");
            this.scenes["intro"] = chain;

            this.nextSceneParams = new SceneActivationParameters("intro", this);
        }
Esempio n. 8
0
        public void initialize(ContentUtil content, SceneActivationParameters parameters)
        {
            this.exit = false;
            this.paused = false;
            this.textures.clear();
            this.currentSequence = null;
            this.input = new ExplicitInputState();

            script.reload();
            this.textures.loadTextures(content,
                "player_character", "btn_up", "btn_down", "btn_left", "btn_right", "btn_fail");

            //this.backgroundTexture = this.script.get("background");
            //this.textures.loadTextures(content, this.backgroundTexture);
            this.background.initialize(content, this.script);

            this.song = new Song(this.script, content);

            this.progress = new PlayerProgress();

            this.sequences.initialize(this.script);

            float uiSpeed = 1.0f;
            if (this.script.contains("ui_speed"))
                uiSpeed = this.script.asFloat["ui_speed"][0];
            this.ui.initialize(content, this.sequences, this.song.beatTimeInMs, uiSpeed);

            long beatTimeMs = (long) this.song.beatTimeInMs;
            this.enemy = new AnimatedCharacter(this.script.get("enemy"), content, beatTimeMs);
            this.player = new AnimatedCharacter("toasty/toasty", content, beatTimeMs);

            this.lastTime = 0;
            this.song.play();
        }
 public override void initialize(ContentUtil content, SceneActivationParameters parameters)
 {
     base.initialize(content, parameters);
     this.song = new Song(this.songName, content, this.bpm);
 }
Esempio n. 10
0
        public SceneActivationParameters nextScene()
        {
            SceneActivationParameters parameters = new SceneActivationParameters();

            MenuItem selected = this.getSelected();
            if (null == selected) {
                parameters.sceneName = "exit";
                parameters.parameters = null;
            } else {
                parameters.sceneName = selected.getSceneName();
                parameters.parameters = selected.getSceneParams();
            }
            return parameters;
        }
Esempio n. 11
0
        public void initialize(ContentUtil content, SceneActivationParameters parameters)
        {
            this.input = new ExplicitInputState();
            this.next = false;
            this.exit = false;
            this.firstUpdate = true;
            this.background = content.load<Texture2D>("menu/background01");
            this.clickSound = new Sound("menu/click", content);
            this.selectSound = new Sound("menu/select", content);
            if (null == this.backgroundSong || this.backgroundSong.stoppedPlaying())
                this.backgroundSong = new Song("menu/backgroundsong", content, 120f);

            ScaledTexture[][] buttonTextures = this.loadButtonTextures(content);

            foreach (MenuItem item in this.items) {
                int texIndex = SystemRef.nextRandomInt(0, 4);
                item.initialize(this.clickSound, this.selectSound,
                    buttonTextures[texIndex][0],
                    buttonTextures[texIndex][1]);
            }
            this.items[0].select();
        }
 public void initialize(ContentUtil content, SceneActivationParameters parameters)
 {
     this.picture = content.load<Texture2D>(this.pictureName);
     this.fadeAmount = 0.0f;
     this.runningTime = null;
 }