コード例 #1
0
        public static void UpdateForLander05()
        {
            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown)
                {
                    Functions.ApplyDrag(Globals.SelectedShip.Accel * 2, Globals.SelectedShip, Enum.Axis.Vertical);
                }

                SoundClass.PlayLooping(Globals.SFXRocketInstance, Globals.UpKeyDown || Globals.LeftKeyDown || Globals.RightKeyDown || Globals.DownKeyDown || Globals.SpaceKeyDown);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, Globals.UpKeyDown || Globals.SpaceKeyDown || Globals.LeftKeyDown || Globals.RightKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, Globals.DownKeyDown, false);
            }
            else
            {
                SoundClass.Stop(Globals.SFXRocketInstance);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, false, false);
            }

            if (!Globals.LeftKeyDown && !Globals.RightKeyDown && (Globals.LeftKeyDownPrevious || Globals.RightKeyDownPrevious))
            {
                Globals.SelectedShip.TextureCurrent = Globals.SelectedShip.Textures[0];
            }
            else if (Globals.LeftKeyDown && !Globals.LeftKeyDownPrevious)
            {
                Globals.SelectedShip.TextureCurrent = Globals.SelectedShip.Textures[3];
            }
            else if (Globals.RightKeyDown && !Globals.RightKeyDownPrevious)
            {
                Globals.SelectedShip.TextureCurrent = Globals.SelectedShip.Textures[4];
            }
        }
コード例 #2
0
        public static void UpdateForLander03()
        {
            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown)
                {
                    Globals.SelectedShip.Accel = (Functions.ConvertMpSToVelocity(Globals.SelectedShip.AccelMpS, Globals.TimerInterval, Globals.PixelToMeter) / 2);
                }
                else
                {
                    Globals.SelectedShip.Accel = Functions.ConvertMpSToVelocity(Globals.SelectedShip.AccelMpS, Globals.TimerInterval, Globals.PixelToMeter);
                }

                SoundClass.PlayLooping(Globals.SFXRocketInstance, Globals.LeftKeyDown || Globals.RightKeyDown || Globals.UpKeyDown || Globals.DownKeyDown);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, Globals.UpKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, Globals.LeftKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, Globals.RightKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, Globals.DownKeyDown, false);
            }
            else
            {
                SoundClass.Stop(Globals.SFXRocketInstance);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, false, false);
            }
        }
コード例 #3
0
        public static void UpdateForLander02()
        {
            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown)
                {
                    Globals.SelectedShip.VerticalVelocity -= (Globals.SelectedShip.Accel * 2);
                }
                SoundClass.PlayLooping(Globals.SFXRocketInstance, Globals.LeftKeyDown || Globals.RightKeyDown || Globals.UpKeyDown || Globals.DownKeyDown || Globals.SpaceKeyDown);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, Globals.UpKeyDown || Globals.SpaceKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, Globals.LeftKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, Globals.RightKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, Globals.DownKeyDown, false);
            }
            else
            {
                SoundClass.Stop(Globals.SFXRocketInstance);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, false, false);
            }

            if (Globals.SpaceKeyDown && !Globals.SpaceKeyDownPrevious)
            {
                Globals.SelectedShip.SpriteBotton.TextureCurrent = Globals.SelectedShip.SpriteBotton.Textures[1];
            }
            else if (!Globals.SpaceKeyDown && Globals.SpaceKeyDownPrevious)
            {
                Globals.SelectedShip.SpriteBotton.TextureCurrent = Globals.SelectedShip.SpriteBotton.Textures[0];
            }
        }
コード例 #4
0
        public static void UpdateForLander01()
        {
            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown)
                {
                    Functions.ApplyDrag(Globals.SelectedShip.Accel * 2, Globals.SelectedShip, Enum.Axis.All);
                }

                SoundClass.PlayLooping(Globals.SFXRocketInstance, Globals.LeftKeyDown || Globals.RightKeyDown || Globals.UpKeyDown || Globals.DownKeyDown || Globals.SpaceKeyDown);

                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, Globals.UpKeyDown || Globals.SpaceKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, Globals.LeftKeyDown || Globals.SpaceKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, Globals.RightKeyDown || Globals.SpaceKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, Globals.DownKeyDown || Globals.SpaceKeyDown, false);
            }
            else
            {
                SoundClass.Stop(Globals.SFXRocketInstance);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, false, false);
            }
        }
コード例 #5
0
        public static void UpdateForLander06()
        {
            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown && !Globals.SpaceKeyDownPrevious)
                {
                    Globals.SelectedShip.HorizontalVelocity *= -0.3F;
                    Globals.SelectedShip.VerticalVelocity   *= -0.3F;
                }

                SoundClass.PlayLooping(Globals.SFXFloatInstance, Globals.LeftKeyDown || Globals.RightKeyDown || Globals.UpKeyDown || Globals.DownKeyDown);
            }
            else
            {
                SoundClass.Stop(Globals.SFXFloatInstance);
            }
        }
コード例 #6
0
        public static void UpdateForLander04()
        {
            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown)
                {
                    Globals.SelectedShip.VerticalVelocity   = 0;
                    Globals.SelectedShip.HorizontalVelocity = 0;
                }

                SoundClass.PlayLooping(Globals.SFXSpecialInstance, Globals.SpaceKeyDown);
                SoundClass.PlayLooping(Globals.SFXFloatInstance, Globals.LeftKeyDown || Globals.RightKeyDown || Globals.UpKeyDown || Globals.DownKeyDown);
            }
            else
            {
                SoundClass.Stop(Globals.SFXFloatInstance);
                SoundClass.Stop(Globals.SFXSpecialInstance);
            }
        }
コード例 #7
0
        public static void UpdateForLanderX1()
        {
            SoundClass.PlayLooping(Globals.SFXSpecialInstance, Globals.SpaceKeyDown);

            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown)
                {
                    //Cancela acelerações atribuidas
                    if (Globals.LeftKeyDown)
                    {
                        Globals.SelectedShip.HorizontalVelocity += Globals.SelectedShip.Accel;
                        Globals.SelectedShip.Fuel += Globals.SelectedShip.FuelConsumptionRate;
                    }
                    else if (Globals.RightKeyDown)
                    {
                        Globals.SelectedShip.HorizontalVelocity -= Globals.SelectedShip.Accel;
                        Globals.SelectedShip.Fuel += Globals.SelectedShip.FuelConsumptionRate;
                    }

                    if (Globals.UpKeyDown)
                    {
                        Globals.SelectedShip.VerticalVelocity += Globals.SelectedShip.Accel;
                        Globals.SelectedShip.Fuel             += Globals.SelectedShip.FuelConsumptionRate;
                    }
                    else if (Globals.DownKeyDown)
                    {
                        Globals.SelectedShip.VerticalVelocity -= Globals.SelectedShip.Accel;
                        Globals.SelectedShip.Fuel             += Globals.SelectedShip.FuelConsumptionRate;
                    }
                }

                SoundClass.PlayLooping(Globals.SFXFloatInstance, Globals.LeftKeyDown || Globals.RightKeyDown || Globals.UpKeyDown || Globals.DownKeyDown);
            }
            else
            {
                SoundClass.Stop(Globals.SFXFloatInstance);
            }
        }
コード例 #8
0
        public static void UpdateForLander07()
        {
            if (Globals.SelectedShip.Fuel > 0)
            {
                if (Globals.SpaceKeyDown)
                {
                    Globals.SelectedShip.VerticalVelocity -= Globals.SelectedStage.ConstVForce;
                }

                SoundClass.PlayLooping(Globals.SFXRocketInstance, Globals.LeftKeyDown || Globals.RightKeyDown || Globals.UpKeyDown || Globals.DownKeyDown);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, Globals.UpKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, Globals.LeftKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, Globals.RightKeyDown, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, Globals.DownKeyDown, false);
            }
            else
            {
                SoundClass.Stop(Globals.SFXRocketInstance);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteBotton, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteRight, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteLeft, false, false);
                Functions.ApplyFlicker(Globals.SelectedShip.SpriteTop, false, false);
            }
        }