コード例 #1
0
        public override void Update(GameTime gameTime, TouchCollection touchCollection)
        {
            if (touchCollection.Count() > 0)
            {
                //get the first touch
                TouchLocation touch = touchCollection.ElementAt(0);
                if (touch.State == TouchLocationState.Pressed)
                {
                    String command = Helper.GetFirstButtonPressCommand(listButtons, (int)touch.Position.X, (int)touch.Position.Y);

                    if (command.Equals("volcano"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureVenusVolcanoInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("rotate"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureVenusRotateInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("nasa"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureVenusNASAInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("earth"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureVenusEarthInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                }
            }
        }
コード例 #2
0
        public override void Update(GameTime gameTime, TouchCollection touchCollection)
        {
            if (touchCollection.Count() > 0)
            {
                //get the first touch
                TouchLocation touch = touchCollection.ElementAt(0);
                if (touch.State == TouchLocationState.Pressed)
                {
                    String command = Helper.GetFirstButtonPressCommand(listButtons, (int)touch.Position.X, (int)touch.Position.Y);

                    if (command.Equals("returnToSolarSystem"))
                    {
                        NextScreen = game.screenSolarSystem;
                    }
                    else if (command.Equals("nasa"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureMarsNASAInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("moon"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureMarsMoonInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("storm"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureMarsStormInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                }
            }
        }
コード例 #3
0
        public ScreenSolarSystem GetNewScreenSolarSystem()
        {
            AnimationFixed background = new AnimationFixed(textureGalaxy, 1, 0, 800, 480, 0, 0, 0);
            //currScreen = new ScreenMercury(this, new Background(background,null), null);
            int scaleMultiplier = 2;
            int centerX         = screenRectangle.Width / 2 * scaleMultiplier;
            int centerY         = screenRectangle.Height / 2 * scaleMultiplier;

            screenSolarSystem = new ScreenSolarSystem(this, new BackgroundScrollable(background, null, this, 400, 240, scaleMultiplier));
            return(screenSolarSystem);
        }
コード例 #4
0
 public BackgroundScrollable(AnimationFixed bgAnimation, List <AnimationFixed> extraAnimations, Game1 game, int initialCenterX, int initialCenterY, int scaleMultiplier)
     : base(bgAnimation, extraAnimations)
 {
     this.game       = game;
     this.centerX    = initialCenterX;
     this.centerY    = initialCenterY;
     this.cropWidth  = game.screenRectangle.Width / scaleMultiplier;
     this.cropHeight = game.screenRectangle.Height / scaleMultiplier;
     max_X           = bgAnimation.texture.Width;  //*scaleMultiplier;
     max_Y           = bgAnimation.texture.Height; // *scaleMultiplier;
     scale           = scaleMultiplier;
 }
コード例 #5
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);

            arialFont = Content.Load <SpriteFont>("arial");

            // TODO: use this.Content to load your game content here
            textureRocket          = Content.Load <Texture2D>("rocket");
            textureMercury         = Content.Load <Texture2D>("mercury");
            textureBack            = Content.Load <Texture2D>("back");
            texturePlay            = Content.Load <Texture2D>("button_play");
            textureAbout           = Content.Load <Texture2D>("button_about");
            textureMenu            = Content.Load <Texture2D>("background_main");
            textureAboutBackground = Content.Load <Texture2D>("background_about");
            textureGalaxy          = Content.Load <Texture2D>("galaxy");
            textureMiniMercury     = Content.Load <Texture2D>("mercury");
            textureMiniVenus       = Content.Load <Texture2D>("venus");
            //textureMiniEarth = Content.Load<Texture2D>("earth");
            textureMiniMars    = Content.Load <Texture2D>("mars");
            textureMiniJupiter = Content.Load <Texture2D>("jupiter");
            textureMiniSaturn  = Content.Load <Texture2D>("saturn");
            textureMiniUranus  = Content.Load <Texture2D>("uranus");
            textureMiniNeptune = Content.Load <Texture2D>("neptune");

            textureButtonEnterPlanet = Content.Load <Texture2D>("bomb");

            textureMercury = Content.Load <Texture2D>("background_mercury");
            textureVenus   = Content.Load <Texture2D>("background_venus");
            textureEarth   = Content.Load <Texture2D>("background_earth");
            textureMars    = Content.Load <Texture2D>("background_mars");
            textureJupiter = Content.Load <Texture2D>("background_jupiter");
            textureSaturn  = Content.Load <Texture2D>("background_saturn");
            textureUranus  = Content.Load <Texture2D>("background_uranus");
            textureNeptune = Content.Load <Texture2D>("background_neptune");


            //TEST
            textureButton      = Content.Load <Texture2D>("haha");
            textureBackground  = Content.Load <Texture2D>("bg");
            textureBackground2 = Content.Load <Texture2D>("bg2");

            //AnimationFixed background = new AnimationFixed(textureMercury, 1, 0, 800, 480, 0, 0, 0);
            //currScreen = new ScreenMercury(this, new Background(background,null), null);


            AnimationFixed background = new AnimationFixed(textureMenu, 1, 0, 800, 480, 0, 0, 0);

            currScreen = new ScreenMenu(this, new Background(background, null));
        }
コード例 #6
0
        public override void Update(GameTime gameTime, TouchCollection touchCollection)
        {
            if (touchCollection.Count() > 0)
            {
                //get the first touch
                TouchLocation touch = touchCollection.ElementAt(0);
                if (touch.State == TouchLocationState.Pressed)
                {
                    String command = Helper.GetFirstButtonPressCommand(listButtons, (int)touch.Position.X, (int)touch.Position.Y);

                    if (command.Equals("back"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureMercury, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = prevScreen;
                    }
                }
            }
        }
コード例 #7
0
        public override void Update(GameTime gameTime, TouchCollection touchCollection)
        {
            if (touchCollection.Count() > 0)
            {
                //get the first touch
                TouchLocation touch = touchCollection.ElementAt(0);
                if (touch.State == TouchLocationState.Pressed)
                {
                    String command = Helper.GetFirstButtonPressCommand(listButtons, (int)touch.Position.X, (int)touch.Position.Y);

                    if (command.Equals("moon"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureUranusMoonInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("ring"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureUranusRingInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("wind"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureUranusWindInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("ocean"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureUranusOceanInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                    else if (command.Equals("nasa"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureUranusNASAInfo, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                }
            }
        }
コード例 #8
0
        public override void Update(GameTime gameTime, TouchCollection touchCollection)
        {
            if (touchCollection.Count() > 0)
            {
                //get the first touch
                TouchLocation touch = touchCollection.ElementAt(0);
                if (touch.State == TouchLocationState.Pressed)
                {
                    String command = Helper.GetFirstButtonPressCommand(listButtons, (int)touch.Position.X, (int)touch.Position.Y);

                    if (command.Equals("play"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureMercury, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = game.GetNewScreenSolarSystem();
                    }

                    else if (command.Equals("about"))
                    {
                        AnimationFixed background = new AnimationFixed(game.textureAboutBackground, 1, 0, 800, 480, 0, 0, 0);
                        NextScreen = new ScreenInfo(game, new Background(background, null), null, this);
                    }
                }
            }
        }
コード例 #9
0
 public Background(AnimationFixed bgAnimation, List <AnimationFixed> extraAnimations)
 {
     this.bgAnimation     = bgAnimation;
     this.extraAnimations = extraAnimations;
 }
コード例 #10
0
        public ScreenNeptune GetNewScreenNeptune()
        {
            AnimationFixed background = new AnimationFixed(textureNeptune, 1, 0, 800, 480, 0, 0, 0);

            return(new ScreenNeptune(this, new Background(background, null), null));
        }
コード例 #11
0
        public ScreenUranus GetNewScreenUranus()
        {
            AnimationFixed background = new AnimationFixed(textureUranus, 1, 0, 800, 480, 0, 0, 0);

            return(new ScreenUranus(this, new Background(background, null), null));
        }
コード例 #12
0
        public ScreenSaturn GetNewScreenSaturn()
        {
            AnimationFixed background = new AnimationFixed(textureSaturn, 1, 0, 800, 480, 0, 0, 0);

            return(new ScreenSaturn(this, new Background(background, null), null));
        }
コード例 #13
0
        public ScreenJupiter GetNewScreenJupiter()
        {
            AnimationFixed background = new AnimationFixed(textureJupiter, 1, 0, 800, 480, 0, 0, 0);

            return(new ScreenJupiter(this, new Background(background, null), null));
        }
コード例 #14
0
        public ScreenEarth GetNewScreenEarth()
        {
            AnimationFixed background = new AnimationFixed(textureEarth, 1, 0, 800, 480, 0, 0, 0);

            return(new ScreenEarth(this, new Background(background, null), null));
        }
コード例 #15
0
        public ScreenMercury GetNewScreenMercury()
        {
            AnimationFixed background = new AnimationFixed(textureMercury, 1, 0, 800, 480, 0, 0, 0);

            return(new ScreenMercury(this, new Background(background, null), null));
        }