Esempio n. 1
0
        public Duck(string name, int x, int y)
        {
            Name = name;

            _duckDeath = new Sprite("DuckDeath");
            _duckDeath.LoadContent("DuckDeath");

            _duckDive = new Sprite("DuckDive");
            _duckDive.LoadContent("DuckDive");

            _duck = new AnimatedSprite()
            {
                RenderBoundingBox = false,
                Name = name
            };

            _duck.LoadFrameTexture("DuckFrame1");
            _duck.LoadFrameTexture("DuckFrame2");
            _duck.LoadFrameTexture("DuckFrame3");

            _duck.Velocity       = new Vector2(7, 5);
            _duck.Flip           = false;
            _duck.Location       = new Vector2(x, y);
            _duck.IsVisible      = true;
            _duck.IsEnabled      = true;
            _duck.AnimationType  = AnimationTypeEnum.PingPong;
            _duck.AnimationSpeed = 5;
            _duck.Play();
            State = DuckStateEnum.Start;

            SoundEffectPlayer.LoadSoundEffect("death");
            SoundEffectPlayer.LoadSoundEffect("quaks");
            SoundEffectPlayer.LoadSoundEffect("falling");
            SoundEffectPlayer.LoadSoundEffect("flapping");
        }
Esempio n. 2
0
        public MenuCursor()
        {
            Name       = "crosshair";
            _crosshair = new Sprite();
            _crosshair.LoadContent("crosshair");

            SoundEffectPlayer.LoadSoundEffect("gunsound");
        }
Esempio n. 3
0
        public Duck(string name, int x, bool flip, float vx, float vy)
        {
            Name = name;

            _duckDeath = new Sprite("DuckDeath");
            _duckDeath.LoadContent("DuckDeath");

            _duckDive = new Sprite("DuckDive");
            _duckDive.LoadContent("DuckDive");

            _duck = new AnimatedSprite()
            {
                RenderBoundingBox = false,
                Name = name
            };

            _duck.LoadFrameTexture("DuckFrame1");
            _duck.LoadFrameTexture("DuckFrame2");
            _duck.LoadFrameTexture("DuckFrame3");

            if (vx > 0)
            {
                vx += DifficultySettings.CurrentDifficulty.SpeedDifference;
            }
            else
            {
                vx -= DifficultySettings.CurrentDifficulty.SpeedDifference;
            }

            if (vy > 0)
            {
                vy += DifficultySettings.CurrentDifficulty.SpeedDifference;
            }
            else
            {
                vy -= DifficultySettings.CurrentDifficulty.SpeedDifference;
            }

            _duck.Velocity       = new Vector2(vx, vy);
            _duck.Flip           = flip;
            _duck.Location       = new Vector2(x, 900);
            _duck.IsVisible      = true;
            _duck.IsEnabled      = true;
            _duck.AnimationType  = AnimationTypeEnum.PingPong;
            _duck.AnimationSpeed = 5;
            _duck.Play();
            State = DuckStateEnum.Start;

            SoundEffectPlayer.LoadSoundEffect("death");
            SoundEffectPlayer.LoadSoundEffect("quaks");
            SoundEffectPlayer.LoadSoundEffect("falling");
            SoundEffectPlayer.LoadSoundEffect("flapping");
        }