Exemple #1
0
        public override void LoadContent()
        {
            if (content == null)
            {
                content = SceneHandler.content;
            }

            gameFont = content.Load <SpriteFont>("Polices/gamefont");

            PackMap.LoadLevel(SceneHandler.level); // On injecte les donnés (unités, joueurs)

            // Bug de l'espace, si on ne reinit pas le body, il passe en statique!
            foreach (Unite u in Map.unites)
            {
                u.body          = BodyFactory.CreateRectangle(Map.world, ConvertUnits.ToSimUnits(25 * u.largeurPhysique), ConvertUnits.ToSimUnits(25 * u.largeurPhysique), 100f);
                u.body.Position = ConvertUnits.ToSimUnits(u.PositionTile * Map.TailleTiles + new Vector2(16, 16));
                if (!u.isApnj)
                {
                    u.body.IsStatic = false;
                }
            }

            timer = new System.Diagnostics.Stopwatch();
            timer.Start();
        }
Exemple #2
0
 public static void ResetGameplay(string map) // Si on change de map
 {
     // Oldmap
     PackMap.Sauvegarder();
     level = map;
     // Nouvelle map
     gameplayScene = new GamePlay();
     gameplayScene.Initialize();
     gameplayScene.LoadContent();
     defeatScene.firstTime  = true;
     victoryScene.firstTime = true;
 }
Exemple #3
0
 public static void ResetGameplay()
 {
     // Reinitialise les levels ET le joueur (il faudra ajouter un truc qui charge les infos du joueur a partir d'un fichier texte
     level = "level1";
     PackMap.LoadPlayers();
     PackMap.InitLevels();
     gameplayScene = new GamePlay();
     gameplayScene.Initialize();
     gameplayScene.LoadContent();
     defeatScene.firstTime  = true;
     victoryScene.firstTime = true;
 }
Exemple #4
0
 public void Load()
 {
     PackMap.Initialize();
     splashScreenScene.LoadContent();
     mainmenuScene.LoadContent();
     menuoptionScene.LoadContent();
     coopSettingsScene.LoadContent();
     coopConnexionScene.LoadContent();
     pauseScene.LoadContent();
     gameplayScene.LoadContent();
     victoryScene.LoadContent();
     defeatScene.LoadContent();
     creditsScene.LoadContent();
     championSelectionScene.LoadContent();
 }