コード例 #1
0
        public override void Activate(Level level)
        {
            // Make all the waiting enemies start fighting
            for (int i = 0; i < level.Actors.Count; i++)
            {
                //EnemyClose enemy = level.Actors[i] as EnemyClose;
                DeejayEnemy enemy_Deejay = level.Actors[i] as DeejayEnemy;

                if (enemy_Deejay != null)
                {
                    if (enemy_Deejay.GetState()) // If set to TRUE, enemy is laying down
                    {
                        enemy_Deejay.GetUpAnimation();
                    }
                    else
                    {
                        enemy_Deejay.ResetIdleGraphic();
                    }
                }

                AdonEnemy enemy_Adon = level.Actors[i] as AdonEnemy;

                if (enemy_Adon != null)
                {
                    enemy_Adon.SetIntro01TargetPosition(new Vector2(950, 550));
                    //enemy_Adon.ResetIdleGraphic();
                }
            }

            base.Activate(level);
        }
コード例 #2
0
        private void SetEffect(string effect, Actor who, DeejayEnemy p)
        {
            // Display Small Spark Effect on Hit
            SpecialEffects spark = new SpecialEffects(effect, who.Position, InLevel, p);

            InLevel.GameItems.Add(spark);
        }
コード例 #3
0
        public static void CreateLevels()
        {
            Levels.Clear();   // Removes all items from level, reset
            CurrentLevel = 0; // Reset GameManager's CurrentLevel to start a new game

            Level level;

            #region Level 01 - Outside of Jail

            level = new Level();

            Texture2D stage1BgBack     = TextureManager.GetTexure("Level01-bg");
            Texture2D stage1BgBackB    = TextureManager.GetTexure("Level01-bg2");
            Texture2D stage1BgMain     = TextureManager.GetTexure("Level01");
            Texture2D stage1BgMainB    = TextureManager.GetTexure("Level01-b");
            Texture2D stage1FgTreeBlur = TextureManager.GetTexure("TreeBlur");

            // Level 1 Backgrounds
            level.AddBackgroundItem(stage1BgBack, Vector2.Zero, 0.1f, 0.95f);
            level.AddBackgroundItem(stage1BgBackB, new Vector2(stage1BgBack.Width, 0), 0.1f, 0.95f);
            level.AddBackgroundItem(stage1BgMain, Vector2.Zero, 1f, 0.90f);
            level.AddBackgroundItem(stage1BgMainB, new Vector2(stage1BgMain.Width, 0), 1f, 0.90f);
            level.AddBackgroundItem(stage1FgTreeBlur, new Vector2(-274, 0), 1f, 0.1f);
            level.AddBackgroundItem(stage1FgTreeBlur, new Vector2(1476, 0), 1f, 0.1f);

            // Define Level 1 starting PlayBounds
            level.PlayBounds = new Rectangle(0, 480, Game1.SCREEN_WIDTH, 120);

            // Level 1 Actors
            level.Actors.Add(new Player(new Vector2(-150, 550),
                                        level, PlayerIndex.One));

            level.Player1           = level.Actors[level.Actors.Count - 1] as Player;
            level.Player1.FacingDir = DirectionTarget.Right;
            level.Player1.SetIntro01TargetPosition(new Vector2(270, 520));

            // Enemy
            AdonEnemy enemy_Adon;
            enemy_Adon = new AdonEnemy(new Vector2(650, 535), level);
            enemy_Adon.SetToWait(DirectionTarget.Left);
            level.Actors.Add(enemy_Adon);

            DeejayEnemy enemy;
            enemy = new DeejayEnemy(new Vector2(530, 500), level); // Laying Down Radio
            enemy.SetToLayingDown(DirectionTarget.Left);
            level.Actors.Add(enemy);

            enemy = new DeejayEnemy(new Vector2(710, 500), level); // Top
            enemy.SetToWait(DirectionTarget.Left);
            level.Actors.Add(enemy);

            enemy = new DeejayEnemy(new Vector2(710, 570), level); // Bottom
            enemy.SetToWait(DirectionTarget.Left);
            level.Actors.Add(enemy);

            /////////////////////////////////////////////////////////////////

            TrashCan tc = new TrashCan(level, new Vector2(30, 500),
                                       new PickUpStone(level, Vector2.Zero));
            level.GameItems.Add(tc);
            tc = new TrashCan(level, new Vector2(90, 500),
                              new PickUpHealthPack(level, Vector2.Zero, 40));
            level.GameItems.Add(tc);
            tc = new TrashCan(level, new Vector2(670, 500),
                              new PickUpHealthPack(level, Vector2.Zero, 40));
            level.GameItems.Add(tc);
            tc = new TrashCan(level, new Vector2(710, 500),
                              new PickUpHealthPack(level, Vector2.Zero, 40));
            level.GameItems.Add(tc);

            // Section 2
            tc = new TrashCan(level, new Vector2(1000, 485),
                              new PickUpHealthPack(level, Vector2.Zero, 40));
            level.GameItems.Add(tc);
            tc = new TrashCan(level, new Vector2(1060, 485),
                              new PickUpHealthPack(level, Vector2.Zero, 20));
            level.GameItems.Add(tc);
            tc = new TrashCan(level, new Vector2(1450, 490),
                              new PickUpHealthPack(level, Vector2.Zero, 30));
            level.GameItems.Add(tc);

            // Section 3
            tc = new TrashCan(level, new Vector2(1940, 540),
                              new PickUpHealthPack(level, Vector2.Zero, 60));
            level.GameItems.Add(tc);
            tc = new TrashCan(level, new Vector2(2460, 515),
                              new PickUpHealthPack(level, Vector2.Zero, 40));
            level.GameItems.Add(tc);
            tc = new TrashCan(level, new Vector2(2500, 515),
                              new PickUpHealthPack(level, Vector2.Zero, 10));
            level.GameItems.Add(tc);

            CreateLevel1CutScenes(level);

            Levels.Add(level);
            HUDManager.setLevel(level);

            Camera.Position = new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2);

            #endregion

            #region Level 02 - Train Stattion

            level = new Level();

            Texture2D stage2BgBack = TextureManager.GetTexure("Level02-bg");
            Texture2D stage2BgMain = TextureManager.GetTexure("Level02");

            // Level 2 Backgrounds
            level.AddBackgroundItem(stage2BgBack, Vector2.Zero, 0.1f, 0.95f);
            level.AddBackgroundItem(stage2BgMain, Vector2.Zero, 1f, 0.90f);

            // Define Level 2 starting PlayBounds
            level.PlayBounds = new Rectangle(0, 480, Game1.SCREEN_WIDTH, 120);

            // Create 2 enemies to the waiting for the players

            enemy = new DeejayEnemy(new Vector2(550, 480), level);
            enemy.SetToWait(DirectionTarget.Left);
            level.Actors.Add(enemy);

            enemy = new DeejayEnemy(new Vector2(660, 570), level);
            enemy.SetToWait(DirectionTarget.Left);
            level.Actors.Add(enemy);

            enemy = new DeejayEnemy(new Vector2(150, 490), level);
            enemy.SetToWait(DirectionTarget.Right);
            level.Actors.Add(enemy);

            enemy = new DeejayEnemy(new Vector2(170, 580), level);
            enemy.SetToWait(DirectionTarget.Right);
            level.Actors.Add(enemy);

            // Trash Can
            TrashCan tc_Level02 = new TrashCan(level, new Vector2(640, 480),
                                               new PickUpStone(level, Vector2.Zero));
            level.GameItems.Add(tc_Level02);
            TrashCan tc2_Level02 = new TrashCan(level, new Vector2(580, 475),
                                                new PickUpHealthPack(level, Vector2.Zero, 40));
            level.GameItems.Add(tc2_Level02);

            CreateLevel2CutScenes(level);

            Levels.Add(level);

            #endregion
        }