Beispiel #1
0
        public static void Act(UFO ufo)
        {
            ufo.setDir(new Vector2(2, 0));
            Sound Effect = SoundManager.getInstance().Find(SoundName.UFOMove);

            Effect.PlaySoundLooped();
        }
Beispiel #2
0
        public void Reset()
        {
            this.FlipSprite(SpriteName.Ufo);
            isDying = false;

            this.direction.X = 0;
            this.Position.X  = -70;

            Random X = new Random();
            int    s = X.Next(3);

            switch (s)
            {
            case 0:
                score = 50;
                break;

            case 1:
                score = 100;
                break;

            case 2:
                score = 150;
                break;
            }

            Sound Effect = SoundManager.getInstance().Find(SoundName.UFOMove);

            Effect.PauseSoundLooped();

            TimeSpan FrameInterval = new TimeSpan(0, 0, 20);
            UFO      ufo           = (UFO)GameObjMananger.getInstance().Find(GameObjName.UFO);

            TimeEventManager.getInstance().Add(TimeEventManager.getInstance().GetCurrentTime() + FrameInterval, ufo, delegate { Actions.Act(ufo); });
        }
        public void StartTimedEvents()
        {
            TimeSpan FrameInterval = new TimeSpan(5750000);
            Super    Super         = (Super)GameObjMananger.getInstance().Find(GameObjName.Super);

            TimeEventManager.getInstance().Add(TimeEventManager.getInstance().GetCurrentTime() + FrameInterval, Super, delegate { Actions.Act(Super); });

            FrameInterval = new TimeSpan(0, 0, 15);
            UFO ufo = (UFO)GameObjMananger.getInstance().Find(GameObjName.UFO);

            TimeEventManager.getInstance().Add(TimeEventManager.getInstance().GetCurrentTime() + FrameInterval, ufo, delegate { Actions.Act(ufo); });
        }
Beispiel #4
0
        private void LoadContent(ContentManager content)
        {
            this.content = content;

            //Insert the graphics into the static variables.
            Laser.playerLaser = content.Load <Texture2D>("Graphics/PlayerLaser");
            Laser.enemyLaser  = content.Load <Texture2D>("Graphics/Laser");
            destroyedTexture  = content.Load <Texture2D>("Graphics/Destroyed");

            Player.SetDeath = content.Load <Texture2D>("Graphics/PlayerDestroyed");

            UFO = new UFO("UFO", new Vector2(-50, 10), width);
            UFO.Reset();
        }
        public UFO CreateUfo()
        {
            Rectangle inRect = new Rectangle(-70, 120, 95 / 2, 46 / 2);

            TextureSprite Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Ufo);
            ColObj        _colobj = new ColObj(inRect, ColObjName.UFO, SpriteName.BBox);

            ColObjManager.getInstance().Add(_colobj);
            UFO Obj = new UFO(GameObjName.UFO, _colobj, new Vector2(inRect.X, inRect.Y), Text, 100);

            SpriteBatchManager.getInstance().Find(SpriteBatchName.Scene).Add(Text);

            ColGroup Invaders = ColGroupManager.getInstance().find(ColGroupName.Ufo);

            Invaders.Add(Obj);

            GameObjMananger.getInstance().Add(Obj);

            return(Obj);
        }
Beispiel #6
0
        public static void Animate(Animation Anim, UFO Ufo)
        {
            if (!Ufo.isDying)
            {
                Ufo.FlipSprite(Anim.getNextFrame());
                TimeSpan FrameInterval = new TimeSpan(1750000);
                TimeEventManager.getInstance().Add(TimeEventManager.getInstance().GetCurrentTime() + FrameInterval, Anim, delegate { Actions.Animate(Anim, Ufo); });
                Ufo.isDying = true;

                Sound Effect = SoundManager.getInstance().Find(SoundName.UFOKill);
                Effect.PlaySound();
            }
            else
            {
                Ufo.Reset();
                GameManager.getInstance().ScoreUp(Ufo.getScore());
                UI Score = (UI)GameObjMananger.getInstance().Find(GameObjName.Score);
                Score.ChangeText(GameManager.getInstance().getCurrentScore());
            }
        }
 public virtual void VisitUfo(UFO inUfo)
 {
 }
Beispiel #8
0
        private void LoadContent(ContentManager content)
        {
            this.content = content;

            //Insert the graphics into the static variables.
            Laser.playerLaser = content.Load<Texture2D>("Graphics/PlayerLaser");
            Laser.enemyLaser = content.Load<Texture2D>("Graphics/Laser");
            destroyedTexture = content.Load<Texture2D>("Graphics/Destroyed");

            Player.SetDeath = content.Load<Texture2D>("Graphics/PlayerDestroyed");

            UFO = new UFO("UFO", new Vector2(-50, 10), width);
            UFO.Reset();
        }
 public override void VisitUfo(UFO inUfo)
 {
     inUfo.Kill();
     ((Ship)(GameObjMananger.getInstance().Find(GameObjName.Ship))).ReloadMissile();
 }