Esempio n. 1
0
            /// <summary>
            /// 반원 배치로 2단계 탄 발사
            /// </summary>
            private IEnumerator PatternD_2_HalfCirclePlaced()
            {
                // 반원 배치로 빠르게 진행하다가 하단으로 천천히 떨어짐
                const float speed1 = 0.05f;
                const float speed2 = 0.01f;
                const int phase1Duration = 30;
                const int count = 12;
                const float angleRange = 100.0f / 360.0f;
                const float startAngleOffset = (angleRange / (float)(count - 1)) / 2.0f;
                const int interval = 20;
                const string shape = "Common/Bullet_Blue";

                for (int frame = 0; frame < (_patternDPartDuration / 2); ++frame)
                {
                    if (frame % interval == 0)
                    {
                        float startAngle = 0.75f + GameSystem._Instance.GetRandomRange(-startAngleOffset, startAngleOffset);
                        for (int i = 0; i < count; ++i)
                        {
                            PlacedBullet b = GameSystem._Instance.CreateBullet<PlacedBullet>();
                            b.InitNoStop(shape, this._X, this._Y, startAngle + angleRange * ((float)i / (count - 1) - 0.5f), speed1
                                , phase1Duration, 0.75f, speed2);
                        }
                    }
                    yield return null;
                }
            }
Esempio n. 2
0
            /// <summary>
            /// 이후 패턴을 위한 안전선
            /// </summary>
            private void PatternD_2_SafetyLine()
            {
                const float speed1 = 0.0045f;
                const float speed2 = 0.01f;
                const int phase1Duration = 480;
                const int count = 10;
                const string shape = "Common/Bullet_Red";

                float startX = GameSystem._Instance._MinX;
                float gapX = (GameSystem._Instance._MaxX - GameSystem._Instance._MinX) / (count - 1);
                float y = GameSystem._Instance._MaxY;

                for (int i = 0; i < count; ++i)
                {
                    // 아래로 내려오다가
                    // 페이즈 2 때 절반은 왼쪽으로, 절반은 오른쪽으로 사라짐
                    PlacedBullet b = GameSystem._Instance.CreateBullet<PlacedBullet>();
                    b.InitNoStop(shape, startX + (i * gapX), y, 0.75f, speed1
                        , phase1Duration, (i < (count / 2) ? 0.5f : 0.0f), speed2);
                }
            }