コード例 #1
0
ファイル: BaseBullet.cs プロジェクト: amidos2006/CleanEmUp
 public virtual void DestroyBulletCollision(BaseEntity entity)
 {
     OGE.CurrentWorld.RemoveEntity(this);
 }
コード例 #2
0
ファイル: GameplayWorld.cs プロジェクト: amidos2006/CleanEmUp
        public override void Intialize()
        {
            GC.Collect();
            base.Intialize();

            AddBackground(GlobalVariables.Background);

            levelData.LoadLevel();
            BaseEntity boss = levelData.GetBoss();
            if (boss != null)
            {
                AddEntity(boss);
                SoundManager.PlayMusic("boss");
            }
            else
            {
                if (GlobalVariables.CurrentDrive < 5)
                {
                    if (!SoundManager.CurrentRunningMusic.Contains("ingame"))
                    {
                        SoundManager.PlayMusic("ingame" + GlobalVariables.CurrentDrive + (OGE.Random.Next(3) + 1).ToString());
                    }
                }
                else
                {
                    SoundManager.PlayMusic("ingame" + GlobalVariables.CurrentDrive);
                }
            }

            TotalNumberOfZipFiles = levelData.NumberOfZip;
            if (TotalNumberOfZipFiles > 0)
            {
                AddEntity(HUDEntity.FileArrowEntity);
            }

            if (levelData.NumberOfDocumentFiles == 0)
            {
                //TotalNumberOfDocumentFiles = int.MaxValue;
            }
            else
            {
                TotalNumberOfDocumentFiles = levelData.NumberOfDocumentFiles;
            }
            if (levelData.TimeEndLevel > 0)
            {
                LevelAlarm = new Alarm(levelData.TimeEndLevel, TweenType.OneShot, ClearArea);
                BaseEntity e = new BaseEntity();
                e.AddTween(LevelAlarm, true);
                AddEntity(e);
            }

            foreach (BaseGenerator generator in levelData.Generator)
            {
                AddEntity(generator);
            }

            AddEntity(new PlayerEntity(levelData.StartPosition, GlobalVariables.TopPlayer, GlobalVariables.BottomPlayer));

            HUDEntity.GameScoreType = ScoreType.Points;
            OGE.CurrentWorld.AddOverLayer(new HUDEntity());
            CursorEntity.CursorView = CursorType.Aim;

            LevelNameAnnouncerEntity levelTitle = new LevelNameAnnouncerEntity(ShowTutorial, levelData.LevelName,
                GlobalVariables.CurrentLevel);
            levelTitle.TintColor = new Color(150, 255, 130);

            AddOverLayer(levelTitle);
        }