Exemple #1
0
        public virtual void tick()
        {
            foreach (BackgroundMusic bgm in BackgroundMusic.getLoadedBackgroundMusics())
            {
                if (!bgm.isPlaying())
                {
                    continue;
                }
                bgm.tick();
            }

            foreach (Entity entity in this.getEntities())
            {
                if (entity == null)
                {
                    continue;
                }
                entity.tick();
            }

            if (fo)
            {
                foreach (Model m in this.getModels())
                {
                    m.getMaterial().getColor().a -= 0.01;
                    foreach (Model mo in m.getChildren(true))
                    {
                        mo.getMaterial().getColor().a -= 0.01;
                    }
                }
            }
        }
Exemple #2
0
        public void Dispose()
        {
            this.gameRunning = false;
            GameLogger.getLogger().log("Closing Game Thread");
            try { this.gameThread.Interrupt(); } catch (Exception e) {}

            GameLogger.getLogger().log("Unloading BGMs");
            foreach (BackgroundMusic bgm in BackgroundMusic.getLoadedBackgroundMusics())
            {
                try { bgm.Dispose(); } catch (Exception e) {}
            }

            GameLogger.getLogger().log("Destroying all GUIs");
            foreach (GUI gui in GUI.getGUIs())
            {
                try { gui.Dispose(); } catch (Exception e) {}
            }

            GameLogger.getLogger().log("Diposing Scene");
            try { Scene.getActiveScene().Dispose(); } catch (Exception e) {}

            getDisplayManager().Dispose();
        }