Exemplo n.º 1
0
        public void LevelReady(ResourceDownloader rd)
        {
            level = new Level(levels[currentLevel].Name, game.world, game.foreground, game.background);

            Downloader foreground = rd.FindItem(levels[currentLevel].Name, "foreground.xaml");
            level.ForegroundSource = foreground.GetResponseText("");
            Downloader background = rd.FindItem(levels[currentLevel].Name, "background.xaml");
            level.BackgroundSource = background.GetResponseText("");
            Downloader entities = rd.FindItem(levels[currentLevel].Name, "entities.py");
            level.EntitiesSource = entities.GetResponseText("");
            Downloader logic = rd.FindItem(levels[currentLevel].Name, "logic.py");
            level.LogicSource = logic.GetResponseText("");

            RestartLevel();
            UpdateIDE();

            StartTimers();
        }
Exemplo n.º 2
0
            public Descriptor(ResourceDownloader parent, Downloader downloader, IProgressBar progress)
            {
                this.progress = progress;
                this.downloader = downloader;
                this.parent = parent;

                downloader.Completed += new EventHandler(Completed);
                downloader.DownloadFailed += new ErrorEventHandler(DownloadFailed);
                downloader.DownloadProgressChanged += new EventHandler(DownloadProgressChanged);
            }
Exemplo n.º 3
0
        // async
        public void DownloadLevel(LevelDescriptor ld)
        {
            ResourceDownloader rd = new ResourceDownloader("levels");
            rd.AddItem(ld.Name, "foreground.xaml");
            rd.AddItem(ld.Name, "background.xaml");
            rd.AddItem(ld.Name, "entities.py");
            rd.AddItem(ld.Name, "logic.py");
            rd.AllCompleted += new EventHandler(rd_AllCompleted);
            rd.AnyFailed += new EventHandler(rd_AnyFailed);

            rd.Start();
        }