Exemple #1
0
        public static Metronome Create(CurveType type, double targetElapsedTimeMs, double frequencyMs)
        {
            Metronome metronome = new Metronome(targetElapsedTimeMs, frequencyMs);

            switch (type)
            {
                case CurveType.Linear:
                    metronome.Path.Initialize(new List<float>() { 0, 1 }, new List<float> { 0, 1 });
                    break;

                case CurveType.Exponential:
                    metronome.Path.Initialize(new List<float>() { 0, 0.1f, 1 }, new List<float> { 0, 0.8f, 1 });
                    break;

                case CurveType.Log:
                    metronome.Path.Initialize(new List<float>() { 0, 0.8f, 1 }, new List<float> { 0, 0.1f, 1 });
                    break;

                case CurveType.Sine:
                    metronome.Path.Initialize(new List<float>() { 0, 1f, 0 }, new List<float> { 0, 0.5f, 1 });
                    break;
            }

            return metronome;
        }
        public CelestialBodyNearHitAnimation(Simulator simulator)
        {
            Simulator = simulator;

            NearHitMasks = new Dictionary<Size, Image>()
            {
                { Size.Small, CreateMaskImage(GetMaskName(Size.Small)) },
                { Size.Normal, CreateMaskImage(GetMaskName(Size.Normal)) },
                { Size.Big, CreateMaskImage(GetMaskName(Size.Big)) },
            };

            Alpha = 0;
            MinEnemyPerc = 0.7;
            MinMaxFrequencyMs = new Vector2(500, 2000);
            Metronome = Metronome.Create(CurveType.Sine, Preferences.TargetElapsedTimeMs, Preferences.TargetElapsedTimeMs);
        }
Exemple #3
0
        public SimPlayer(Simulator simulator, Player player)
        {
            Simulator = simulator;
            BasePlayer = player;
            PowerUpInUse = PowerUpType.None;

            SpaceshipMove = new SpaceshipSpaceship(simulator)
            {
                Speed = 4,
                VisualPriority = VisualPriorities.Default.PlayerCursor
            };

            SpaceshipMove.Bounced += new NoneHandler(DoBouncing);

            TurretToPlaceChanged = false;
            GameOver = false;
            VibrationMetronome = new Metronome(Preferences.TargetElapsedTimeMs, 100);
        }
        public AlienNextWaveAnimation(Simulator simulator)
        {
            Simulator = simulator;

            NearHitMasks = new Dictionary<Size, Image>()
            {
                { Size.Small, CreateMaskImage(GetMaskName(Size.Small)) },
                { Size.Normal, CreateMaskImage(GetMaskName(Size.Normal)) },
                { Size.Big, CreateMaskImage(GetMaskName(Size.Big)) },
            };

            Alpha = 0;
            MinTimeKickIn = 10000;
            MinTimeFlash = 3000;
            TimeNextWave = double.MaxValue;
            MinMaxFrequencyMs = new Vector2(500, 2000);
            Metronome = Metronome.Create(CurveType.Sine, Preferences.TargetElapsedTimeMs, Preferences.TargetElapsedTimeMs);
        }