Exemple #1
0
        public override void Notify()
        {
            if (this.IsValidCollision())
            {
                if (this.isMissileHit == true)
                {
                    ExplosionManager.GetUFOExplosion(this.pUFO);
                }
                UFOManager.DeactiveUFO();

                float    time   = pRandom.Next(10, 16);
                SpawnUFO pSpawn = new SpawnUFO();
                TimerManager.Add(TimeEvent.Name.SpawnBomb, pSpawn, time);
            }
        }
Exemple #2
0
        public void initialPlayerSetup()
        {
            // HIERARCHY --------------------------------------------------------------------------
            setupRoots();

            // Wall creation
            Hierarchy wallTree = HierarchyFactory.create(Hierarchy.Walls.Walls, new Azul.Color(0.0f, 1.0f, 0.0f));

            WallFactory.attachTree(wallTree);
            WallFactory.create(TopWall.Side.Top);
            WallFactory.create(BottomWall.Side.Bottom);
            WallFactory.create(LeftWall.Side.Left);
            WallFactory.create(RightWall.Side.Right);

            // Shield row creation
            Hierarchy shield1 = HierarchyFactory.create(Hierarchy.Shields.Shields, new Azul.Color(1f, 1f, 0f));
            Hierarchy shield2 = HierarchyFactory.create(Hierarchy.Shields.Shields, new Azul.Color(1f, 1f, 0f));
            Hierarchy shield3 = HierarchyFactory.create(Hierarchy.Shields.Shields, new Azul.Color(1f, 1f, 0f));
            Hierarchy shield4 = HierarchyFactory.create(Hierarchy.Shields.Shields, new Azul.Color(1f, 1f, 0f));

            ShieldFactory.setRoot(shield1);
            ShieldFactory.createShield(GameObject.Name.Shields, 100f, 150f);
            ShieldFactory.setRoot(shield2);
            ShieldFactory.createShield(GameObject.Name.Shields, 350f, 150f);
            ShieldFactory.setRoot(shield3);
            ShieldFactory.createShield(GameObject.Name.Shields, 600f, 150f);
            ShieldFactory.setRoot(shield4);
            ShieldFactory.createShield(GameObject.Name.Shields, 850f, 150f);

            // Timer Events
            AnimatedSprite squidAni = new AnimatedSprite(SpriteEnum.Squid, ImageEnum.Squid_2);
            AnimatedSprite octoAni = new AnimatedSprite(SpriteEnum.Octo, ImageEnum.Octo_2);
            AnimatedSprite crabAni = new AnimatedSprite(SpriteEnum.Crab, ImageEnum.Crab_2);
            Movement gridMove = new Movement();
            SpawnBomb spawn = new SpawnBomb(GameObject.Name.Grid);
            SpawnUFO ufoSpawn = new SpawnUFO();

            CommandContainer.add(ufoSpawn, TimeEvent.EventType.BombSpawn);
            CommandContainer.add(spawn, TimeEvent.EventType.BombSpawn);
            CommandContainer.add(crabAni, TimeEvent.EventType.Animation, Index.Index_2);
            CommandContainer.add(squidAni, TimeEvent.EventType.Animation, Index.Index_1);
            CommandContainer.add(octoAni, TimeEvent.EventType.Animation, Index.Index_0);
            CommandContainer.add(gridMove, TimeEvent.EventType.Movement);

            float moveTime = GameManager.MoveFrameTime;

            TimeEventManager.add(moveTime, gridMove, TimeEvent.EventType.Movement);
            TimeEventManager.add(moveTime, octoAni, TimeEvent.EventType.Animation, Index.Index_0);
            TimeEventManager.add(moveTime, squidAni, TimeEvent.EventType.Animation, Index.Index_1);
            TimeEventManager.add(moveTime, crabAni, TimeEvent.EventType.Animation, Index.Index_2);
            TimeEventManager.add(2.0f, spawn, TimeEvent.EventType.BombSpawn);
            TimeEventManager.add(12f, ufoSpawn, TimeEvent.EventType.UFO);

            CollisionPairManager.setupCollisions();
        }