Example #1
0
        public static void Update(GameTime gametime, ContentManager contentmanager)
        {
            if (ActiveScene != null)
            {
                RenderContext.GameTime = gametime;
                ActiveScene.Update(RenderContext, contentmanager);

                // initialisasi scene
                if (!IsInitialized)
                {
                    var chosenscene = GameScenes.FirstOrDefault(scene =>
                                                                scene.SceneName.Equals("MainMenu"));
                    chosenscene.Update(RenderContext, contentmanager);

                    chosenscene = GameScenes.FirstOrDefault(scene =>
                                                            scene.SceneName.Equals("TitleScreen"));
                    chosenscene.Update(RenderContext, contentmanager);

                    chosenscene = GameScenes.FirstOrDefault(scene =>
                                                            scene.SceneName.Equals("LevelSelect"));
                    chosenscene.Update(RenderContext, contentmanager);

                    chosenscene = GameScenes.FirstOrDefault(scene =>
                                                            scene.SceneName.Equals("Level1"));
                    chosenscene.Update(RenderContext, contentmanager);

                    chosenscene = GameScenes.FirstOrDefault(scene =>
                                                            scene.SceneName.Equals("Archive"));
                    chosenscene.Update(RenderContext, contentmanager);

                    IsInitialized = true;
                }
            }
            RenderContext.TouchPanelState = TouchPanel.GetState();
        }
Example #2
0
        public static bool SetActiveScene(string name)
        {
            var chosenscene = GameScenes.FirstOrDefault(scene =>
                                                        scene.SceneName.Equals(name));

            if (chosenscene != null)
            {
                ActiveScene = chosenscene;
            }

            return(chosenscene != null);
        }