public static void SetArena(Arena currentArena)
 {
     arenaName = currentArena.Name;
 }
 public static void ChangeToPlayScreen(Arena arenaToUse)
 {
     currentScreen = Screens.CurrentScreen.PlayScreen;
     GameEngine.Start(arenaToUse);
 }
Exemple #3
0
        public static void Start(Arena currentArena)
        {
            //Set the currentarena, and open it
            GameEngine.currentArena = currentArena;
            GameEngine.currentArena.Open();

            //Set the engineState
            engineState = EngineState.Starting;

            //Set the shader to full colour;
            fader.Color = Color.White;

            //Set the engine state to playing
            engineState = EngineState.Playing;

            #if WINDOWS
            //Code for debugging
            carsInGame = 2;
            #endif

            #if XBOX
            //Actual Code(for itiration is still nescecarry).
            //Code for determainating how many cars should be in the game
            carsInGame = 0;
            for (int i = 0; i < cars.Length; i++)
            {
                if (InfoPacket.PlayerProfiles[i] != null)
                {
                    carsInGame++;
                }
            }
            #endif

            //Set the positions for every car
            cars[0].Position = new Vector2(currentArena.Bounds.Left + wallOffSet, 720 / 2);
            cars[1].Position = new Vector2(currentArena.Bounds.Right - wallOffSet, 720 / 2);
            cars[2].Position = new Vector2(1280 / 2, currentArena.Bounds.Top + wallOffSet);
            cars[3].Position = new Vector2(1280 / 2, currentArena.Bounds.Bottom - wallOffSet);

            //Set the rotation for every car
            cars[0].Rotation = 0 * (float)(2 * Math.PI) / 4;
            cars[1].Rotation = 2 * (float)(2 * Math.PI) / 4;
            cars[2].Rotation = 1 * (float)(2 * Math.PI) / 4;
            cars[3].Rotation = 3 * (float)(2 * Math.PI) / 4;

            //Set up the cars in game
            for (int i = 0; i < carsInGame; i++)
            {
                //Actual appliance of the variables
                cars[i].Set();
            }

            ArenaPostProcessing.SetArena(currentArena);

            //Set up the EndingTexts array
            endingTexts = new string[carsInGame];
            moneyGainedTexts = new string[carsInGame];

            //Reset the total time playing
            totalTimePlayed = 0;

            //Go to playing immediatly for debugging
            StartPlay();

            //Clear the mine list
            mines.Clear();
            rockets.Clear();
            cRockets.Clear();
        }