예제 #1
0
 public void reset()
 {
     timerGameOver = 0;
     myGameState.init("normal");
     if (panel_lever.isOn)
     {
         panel_lever.ForceInteraction();
     }
     if (panel_buttonCool.isOn)
     {
         panel_buttonCool.ForceInteraction();
     }
     if (panel_buttonElectricity.isOn)
     {
         panel_buttonElectricity.ForceInteraction();
     }
     if (panel_gpsLever.isOn)
     {
         panel_gpsLever.ForceInteraction();
     }
     if (panel_buttonOxygene.isOn)
     {
         panel_buttonOxygene.ForceInteraction();
     }
     if (panel_buttonRefuel.isOn)
     {
         panel_buttonRefuel.ForceInteraction();
     }
 }
예제 #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch      = new SpriteBatch(GraphicsDevice);
            resolutionFactor = (float)GraphicsDevice.Viewport.Width / 1920;
            //TODO: use this.Content to load your game content here

            myIntroduction = new Introduction();
            myGameover     = new Gameover();
            myWin          = new Win(GraphicsDevice);
            myEnd          = new End();

            myGameState = new GameState();
            myGameState.init("normal");

            mySystemGenerator = new SystemGenerator();
            myRandom          = new Random();

            myInterfaceManager = new InterfaceManager();

            fontDefault = Content.Load <SpriteFont>("defaultFont");
            fontTitle   = Content.Load <SpriteFont>("titleFont");
            fontMenu    = Content.Load <SpriteFont>("menuFont");
            fontIntro   = Content.Load <SpriteFont>("introFont");

            defaultEffect = new BasicEffect(GraphicsDevice);

            // -- LOAD ALL IMAGES
            img_launchPad     = Content.Load <Texture2D>("launchpad");
            img_rocket        = Content.Load <Texture2D>("rocket");
            img_controlpanel  = Content.Load <Texture2D>("controlpanel");
            img_jauge         = Content.Load <Texture2D>("jauge");
            img_ledOn         = Content.Load <Texture2D>("greenlight");
            img_ledOff        = Content.Load <Texture2D>("redlight");
            img_leverOff      = Content.Load <Texture2D>("leverOff");
            img_leverOn       = Content.Load <Texture2D>("leverOn");
            img_switchOff     = Content.Load <Texture2D>("switchOff");
            img_switchOn      = Content.Load <Texture2D>("switchOn");
            img_particleFire  = Content.Load <Texture2D>("particle");
            img_background    = Content.Load <Texture2D>("background");
            img_star          = Content.Load <Texture2D>("star");
            img_jaugeInverted = Content.Load <Texture2D>("jaugeinverted");
            img_fragment1     = Content.Load <Texture2D>("fragment1");
            img_fragment2     = Content.Load <Texture2D>("fragment2");
            img_fragment3     = Content.Load <Texture2D>("fragment3");
            img_fragment4     = Content.Load <Texture2D>("fragment4");
            img_fragment5     = Content.Load <Texture2D>("fragment5");
            img_fragment6     = Content.Load <Texture2D>("fragment6");
            img_fragment7     = Content.Load <Texture2D>("fragment7");
            fragmentArray     = new Texture2D[7];
            fragmentArray[0]  = img_fragment1;
            fragmentArray[1]  = img_fragment2;
            fragmentArray[2]  = img_fragment3;
            fragmentArray[3]  = img_fragment4;
            fragmentArray[4]  = img_fragment5;
            fragmentArray[5]  = img_fragment6;
            fragmentArray[6]  = img_fragment7;
            img_backgroundsky = Content.Load <Texture2D>("backgroundsky");
            img_cursor        = Content.Load <Texture2D>("White");
            MouseCursor.FromTexture2D(img_cursor, 0, 0);
            //-- LOAD ALL SOUNDS
            sound_clic      = Content.Load <SoundEffect>("clic");
            sound_engine    = Content.Load <SoundEffect>("engine");
            sound_refuel    = Content.Load <SoundEffect>("refuel");
            sound_explosion = Content.Load <SoundEffect>("explosion");
            sound_air       = Content.Load <SoundEffect>("air");
            sound_music     = Content.Load <SoundEffect>("music");
            sound_cool      = Content.Load <SoundEffect>("cool");
            sound_key       = Content.Load <SoundEffect>("key");
            sound_alarm     = Content.Load <SoundEffect>("alarm");
            sound_switchOn  = Content.Load <SoundEffect>("sd_switchOn");
            sound_switchOff = Content.Load <SoundEffect>("sd_switchOff");

            sound_refuelInstance         = sound_refuel.CreateInstance();
            sound_airInstance            = sound_air.CreateInstance();
            sound_musicInstance          = sound_music.CreateInstance();
            sound_musicInstance.IsLooped = true;
            sound_coolInstance           = sound_cool.CreateInstance();
            sound_alarmInstance          = sound_alarm.CreateInstance();
            InitMenuInterface();

            panelHeight           = GraphicsDevice.Viewport.Height - img_controlpanel.Height * resolutionFactor;
            myParticleStarManager = new ParticleManager(new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2));

            defaultRocketPosition = new Vector2(GraphicsDevice.Viewport.Width / 2, panelHeight - img_launchPad.Height + 8);
            InitGameplayInterface();
        }