Ejemplo n.º 1
0
        public void Initialize()
        {
            Object o;
            minSize = double.Parse((o = parameters["minSize"]) != null ? (string)o : "0.2");
            maxSize = double.Parse((o = parameters["maxSize"]) != null ? (string)o : "0.2");
            double expandTime = double.Parse((o = parameters["expandTime"]) != null ? (string)o : "0.2");
            expandSpeed = (maxSize - minSize) / expandTime;
            double explosionTime = double.Parse((o = parameters["explosionTime"]) != null ? (string)o : "0.2");
            minColor = new Vector3(
                float.Parse((o = parameters["minColorX"]) != null ? (string)o : "1"),
                float.Parse((o = parameters["minColorY"]) != null ? (string)o : "1"),
                float.Parse((o = parameters["minColorZ"]) != null ? (string)o : "1")
                );
            maxColor = new Vector3(
               float.Parse((o = parameters["maxColorX"]) != null ? (string)o : "1"),
               float.Parse((o = parameters["maxColorY"]) != null ? (string)o : "1"),
               float.Parse((o = parameters["maxColorZ"]) != null ? (string)o : "1")
               );
            dColor = new Vector3(
                (float)((maxColor.X - minColor.X) / explosionTime),
                (float)((maxColor.Y - minColor.Y) / explosionTime),
                (float)((maxColor.Z - minColor.Z) / explosionTime)
                );
            color = minColor;
            power = double.Parse((o = parameters["attackPower"]) != null ? (string)o : "0.2");
            damage = double.Parse((o = parameters["attackDamage"]) != null ? (string)o : "0.2");

            velocity = Vector2.Zero;
            speed = double.Parse((o = parameters["speed"]) != null ? (string)o : "5");
            time = TimeSpan.Zero;

            MakeModel("");

            double ex = minSize / rect.Width;
            double ey = minSize / rect.Height;
            RectangleD.ExtendRect(rect, ex, ey, RecVisible);
            Depth = RecVisible.Width;
            RecCollision = RecVisible;

            attackMinSizeX = double.Parse((o = parameters["attackMinSizeX"]) != null ? (string)o : "1");
            attackMinSizeY = double.Parse((o = parameters["attackMinSizeY"]) != null ? (string)o : "1");
            attackMaxSizeX = double.Parse((o = parameters["attackMaxSizeX"]) != null ? (string)o : "1");
            attackMaxSizeY = double.Parse((o = parameters["attackMaxSizeY"]) != null ? (string)o : "1");
            attackTime = double.Parse((o = parameters["attackTime"]) != null ? (string)o : "1");
            attackExpandSpeedX = (attackMaxSizeX - attackMinSizeX) / attackTime;
            attackExpandSpeedY = (attackMaxSizeY - attackMinSizeY) / attackTime;

            EmissiveColor = minColor;

            // 自分を追尾するAttakAreaをつくる
            o = scene.Parameters["AttackArea"];
            if (o != null)
            {
                attackArea = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(RecVisible, 1, 1));
                attackArea.NotAttack(owner);
                attackArea.Power = power;
                attackArea.Damage = damage;
                scene.EntityList.Add(attackArea);
                scene.AttackerList.Add(attackArea);
            }

            if (owner != 0) target1 = scene.Character1P;
            if (owner != 1) target1 = scene.Character2P;

            stopTime = double.Parse((o = parameters["stopTime"]) != null ? (string)o : "0");
        }
Ejemplo n.º 2
0
        public override bool Update(GameTime gameTime)
        {
            double dt = gameTime.ElapsedGameTime.TotalSeconds;
            bool flg = true;

            if (RecVisible.Width < maxSize)
            {
                double ex = Math.Min(maxSize, RecVisible.Width + expandSpeed * dt) / RecVisible.Width;
                RectangleD.ExtendRect(RecVisible, ex, ex, RecVisible);
                time = TimeSpan.Zero;
                Chase();
                flg = false;
            }
            else if (color != maxColor)
            {
                color = new Vector3(
                    (float)Math.Min(color.X + dColor.X * dt, 1),
                    (float)Math.Min(color.Y + dColor.Y * dt, 1),
                    (float)Math.Min(color.Z + dColor.Z * dt, 1)
                    );
                EmissiveColor = color;

                if (velocity == Vector2.Zero)
                {
                    flg = false;
                    Hashtable ht = Collision.GetColState(this, scene.AttackerList);
                    foreach (DictionaryEntry de in ht)
                    {
                        Entity he = (Entity)(de.Key);
                        if (he.GetType() == typeof(AttackArea) && ((AttackArea)he).IsTarget[owner] == true)
                        {
                            flg = true;
                            break;
                        }
                        else
                        {
                            velocity = RecCollision.Center - he.RecCollision.Center;
                            if (velocity == Vector2.Zero)
                            {
                                velocity.X = 1;
                            }
                            velocity.Normalize();
                            velocity.X *= (float)speed;
                            velocity.Y *= (float)speed;
                            tmp = he;
                            Cue c = GLOBAL.soundBank.GetCue("B2");
                            c.Play();
                            break;
                        }
                    }
                }
                else
                {
                    RecVisible.Offset(velocity.X * dt, velocity.Y * dt);
                    flg = false;
                    ArrayList ls = new ArrayList(scene.SolidList);
                    if (owner != 0) ls.Add(scene.Character1P);
                    if (owner != 1) ls.Add(scene.Character2P);
                    Hashtable ht = Collision.GetColState(this, ls);
                    foreach (DictionaryEntry de in ht)
                    {
                        velocity = Vector2.Zero;
                        flg = true;
                        break;
                    }
                    if (flg == false)
                    {
                        ht = Collision.GetColState(this, scene.AttackerList);
                        foreach (DictionaryEntry de in ht)
                        {
                            if (de.Key == tmp)
                            {
                                continue;
                            }
                            velocity = Vector2.Zero;
                            flg = true;
                            break;
                        }
                    }
                }
            }
            else
            {
                flg = true;
            }

            Depth = RecVisible.Width;

            if (flg)
            {
                Object o = scene.Parameters["AttackArea"];
                AttackArea attackArea = null;
                if (o != null)
                {
                    Vector2 v = RecVisible.Center;
                    attackArea = new AttackArea(scene, (Hashtable)o, new RectangleD(v.X - attackMinSizeX * 0.5, v.Y - attackMinSizeY * 0.5, attackMinSizeX, attackMinSizeY));
                    attackArea.NotAttack(owner);
                    attackArea.SetExpandSpeed(attackExpandSpeedX, attackExpandSpeedY);
                    attackArea.SetTime(attackTime);
                    attackArea.Power = attackPower;
                    attackArea.Damage = attackDamage;
                    scene.EntityList.Add(attackArea);
                    scene.AttackerList.Add(attackArea);

                    Cue sound = GLOBAL.soundBank.GetCue("bomb");
                    sound.Play();
                }

                scene.EntityList.Add(new ParticleManager(scene, "ExplosionParticles", RecCollision.Center));

                Dispose();
            }

            return base.Update(gameTime);
        }
Ejemplo n.º 3
0
        public override bool Update(GameTime gameTime)
        {
            double dt = gameTime.ElapsedGameTime.TotalSeconds;
            bool flg = true;
            time += gameTime.ElapsedGameTime;

            if (RecVisible.Width < maxSize)
            {
                double ex = Math.Min(maxSize, RecVisible.Width + expandSpeed * dt) / RecVisible.Width;
                RectangleD.ExtendRect(RecVisible, ex, ex, RecVisible);
                time = TimeSpan.Zero;
                Chase();
                flg = false;
            }
            else if (color != maxColor)
            {
                color = new Vector3(
                    (float)Math.Min(color.X + dColor.X * dt, 1),
                    (float)Math.Min(color.Y + dColor.Y * dt, 1),
                    (float)Math.Min(color.Z + dColor.Z * dt, 1)
                    );
                EmissiveColor = color;

                if (time > TimeSpan.FromSeconds(stopTime))
                {
                    // 敵(target1)を追尾する
                    velocity = target1.RecCollision.Center;
                    velocity -= RecVisible.Center;
                    if (velocity == Vector2.Zero)
                    {
                        velocity.X = 1;
                    }
                    velocity.Normalize();
                    velocity.X *= (float)speed;
                    velocity.Y *= (float)speed;
                    RecVisible.Offset(velocity.X * dt, velocity.Y * dt);

                    // 何かにあたったら爆発
                    flg = false;
                    ArrayList ls = new ArrayList(scene.SolidList);
                    if (owner != 0) ls.Add(scene.Character1P);
                    if (owner != 1) ls.Add(scene.Character2P);
                    Hashtable ht = Collision.GetColState(this, ls);
                    foreach (DictionaryEntry de in ht)
                    {
                        velocity = Vector2.Zero;
                        flg = true;
                        break;
                    }
                    if (flg == false)
                    {
                        ht = Collision.GetColState(this, scene.AttackerList);
                        foreach (DictionaryEntry de in ht)
                        {
                            if ((de.Key).GetType() == typeof(AttackArea))
                            {
                                AttackArea a = (AttackArea)(de.Key);
                                if (a.IsTarget[owner] == false)
                                {
                                    continue;
                                }
                            }
                            velocity = Vector2.Zero;
                            flg = true;
                            break;
                        }
                    }
                }
                else
                {
                    flg = false;
                }
            }
            else
            {
                flg = true;
            }

            Depth = RecVisible.Width;
            attackArea.RecCollision.Copy(RecVisible);

            if (flg)
            {
                Object o = scene.Parameters["AttackArea"];
                AttackArea tmp = null;
                if (o != null)
                {
                    tmp = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(RecVisible, eX, eY));
                    tmp.NotAttack(owner);
                    tmp.SetExpandSpeed(attackExpandSpeedX, attackExpandSpeedY);
                    tmp.SetTime(attackTime);
                    tmp.Power = power;
                    tmp.Damage = damage;
                    scene.EntityList.Add(tmp);
                    scene.AttackerList.Add(tmp);

                    Cue sound = GLOBAL.soundBank.GetCue("bomb");
                    sound.Play();
                }
                o = scene.Parameters["ExplosionParticles"];
                if (o != null)
                {
                    scene.EntityList.Add(new ParticleManager(scene, "ExplosionParticles", RecCollision.Center));
                }
                attackArea.Dispose();
                Dispose();
            }

            return base.Update(gameTime);
        }
Ejemplo n.º 4
0
        bool UpAAnimation(GameTime gameTime)
        {
            #region 1.初期化
            if (time <= gameTime.ElapsedGameTime)
            {
                mi.recVisible.Copy(normalRectangle);

                normalizeRectangle = false;

                attackArea = null;
                Object o = scene.Parameters["AttackArea"];
                if (o != null)
                {
                    attackArea = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(mi.recCollision, upAeX, upAeY));
                    attackArea.Follow(this);
                    attackArea.NotAttack(player.id);
                    attackArea.Power = upAPower;
                    attackArea.Damage = upADamage;
                    attackArea.manual = true;
                    scene.EntityList.Add(attackArea);
                    scene.AttackerList.Add(attackArea);
                }

                ex = ey = 1.0;
                ox = oy = 0;
                Cue c = GLOBAL.soundBank.GetCue("SA");
                c.Play();
            }

            #endregion

            #region 2.アニメーション

            double dt = gameTime.ElapsedGameTime.TotalSeconds;

            // Write your logic

            // モデルを伸縮
            if (time < TimeSpan.FromSeconds(upATime1))          // 伸ばす
            {
                ey += upAExtendSpeed * dt;
                double s = 1 / Math.Sqrt(ey);
                mi.depth = mi.defaultDepth * s;
                ex = s;
            }
            else if (time < TimeSpan.FromSeconds(upATime2 + upATime1))
            {

            }
            else if (time < TimeSpan.FromSeconds(upATime3 + upATime2 + upATime1))  // 縮める
            {
                ey -= upAExtendSpeed * dt;
                double s = 1 / Math.Sqrt(ex);
                mi.depth = mi.defaultDepth * s;
                ex = s;
            }
            else
            {
                endAnimation = true;
            }

            RectangleD.ExtendRect(normalRectangle, ex, ey, mi.recVisible);

            // ちょっと上下にずらす
            oy = mi.recVisible.Height - normalRectangle.Height;
            oy *= 0.5;
            mi.recVisible.Y += oy;
            RectangleD.ExtendRect(mi.recVisible, AeX, AeY, attackArea.RecCollision);

            if (CheckFloat(gameTime))
            {
                AnimFloat(gameTime);
            }
            else
            {
                AnimStop(gameTime);
            }

            mi.rotation = new Vector3(0, 0, 0);

            #endregion

            #region 3、次のアニメーションへの遷移判定
            Animation prevAnim = anim;
            NextAnimation[] nextAnim = new NextAnimation[]{
                new NextAnimation(Animation.Dead,false,CheckDead,true),
                new NextAnimation(Animation.Attacked,false,CheckAttacked,true),
                new NextAnimation(Animation.Ground,false,CheckGround,endAnimation),
                new NextAnimation(Animation.Float,false,CheckFloat,endAnimation),
                new NextAnimation(Animation.Run,true,null,endAnimation),
                new NextAnimation(Animation.Walk,true,null,endAnimation),
                new NextAnimation(Animation.Stop,false,null,endAnimation),
                new NextAnimation(Animation.UpA,false,null,true),
            };

            anim = FindNextAnimation(nextAnim, gameTime);
            if (anim == Animation.None)
            {
                anim = prevAnim;
            }

            #endregion

            #region 4、アニメーションが遷移するときの処理
            if (anim != prevAnim)
            {
                mi.recCollision = mi.recVisible;
                commandFlg[(int)Animation.A] = false;
                commandFlg[(int)Animation.UpA] = false;
                commandFlg[(int)Animation.DownA] = false;
                commandFlg[(int)Animation.SideA] = false;
                commandFlg[(int)Animation.SideSmash] = false;
                commandFlg[(int)Animation.UpSmash] = false;
                commandFlg[(int)Animation.DownSmash] = false;
                normalizeRectangle = true;
                if (attackArea != null) attackArea.Dispose();
            }

            #endregion

            return true;
        }
Ejemplo n.º 5
0
        bool UpSmashAnimation(GameTime gameTime)
        {
            #region 1.初期化
            if (time <= gameTime.ElapsedGameTime)
            {
                mi.recVisible.Copy(normalRectangle);
                mi.depth = 1;

                normalizeRectangle = false;

                pileFlg = piling;
                upSmashRot = upSmashRotSpeed = 0;
                upSmashRotAccel = Math.Abs(upSmashRotAccel) * (direction.X > 0 ? -1 : 1);
                upSmashA = 0;

                tmpEmissiveColor = mi.emissiveColor;
                upSmashTime = 0;
            }

            #endregion

            #region 2.アニメーション

            double dt = gameTime.ElapsedGameTime.TotalSeconds;

            // Write your logic
            switch (pileFlg)
            {
                case piling:
                    if (time.TotalSeconds >= maxPileTime || input.isOn(BUTTON.A, player.dev) == false)
                    {
                        pileFlg = finishPiling;
                    }

                    upSmashRotSpeed += upSmashRotAccel * dt;
                    upSmashRot += upSmashRotSpeed * dt;

                    mi.recVisible.Top3D = normalRectangle.Top3D - maxUpSmashA * Math.Sin((float)(0.5 * MathHelper.Pi * time.TotalSeconds / maxPileTime));
                    break;
                case finishPiling:
                    pileFlg = afterPiling;
                    upSmashTime = time.TotalSeconds + GetSmashPower(minUpSmashTime, maxUpSmashTime);
                    upSmashA = GetSmashPower(0, maxUpSmashA);

                    Object o = scene.Parameters["AttackArea"];
                    if (o != null)
                    {
                        attackArea = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(mi.recCollision, upSmasheX, upSmasheY));
                        attackArea.Follow(this);
                        attackArea.NotAttack(player.id);
                        attackArea.Power = GetSmashPower(minUpSmashPower, maxUpSmashPower);
                        attackArea.Damage = GetSmashPower(minUpSmashDamage, maxUpSmashDamage);
                        scene.EntityList.Add(attackArea);
                        scene.AttackerList.Add(attackArea);
                    }
                    Cue c = GLOBAL.soundBank.GetCue("smash");
                    c.Play();
                    break;
                case afterPiling:
                    if (mi.recVisible.Top3D < normalRectangle.Top3D + upSmashA)
                    {
                        mi.recVisible.Top3D += upSmashExtendSpeed * dt;
                    }
                    if (time.TotalSeconds > upSmashTime)
                    {
                        endAnimation = true;
                    }
                    break;
                default:
                    break;
            }

            upSmashRot += upSmashRotSpeed * dt;

            // 横方向の拡大
            ey = mi.recVisible.Height / normalRectangle.Height;
            ex = 1 / Math.Sqrt(ey);
            double t = mi.recVisible.Top3D;
            RectangleD.ExtendRect(normalRectangle, ex, ey, mi.recVisible);
            mi.depth = mi.defaultDepth * ex;
            mi.recVisible.Offset(0, (mi.recVisible.Height - normalRectangle.Height) * 0.5);
            if (attackArea != null)
            {
                RectangleD.ExtendRect(mi.recVisible, upSmasheX, upSmasheY, attackArea.RecCollision);
            }
            mi.depth = ex;

            if (CheckFloat(gameTime))
            {
                AnimFloat(gameTime);
            }
            else
            {
                if (pileFlg == piling)
                {
                    AnimStop(gameTime);
                }
            }

            mi.rotation = new Vector3(0, (float)upSmashRot, 0);
            mi.emissiveColor = new Vector3(
                (float)Math.Min(mi.emissiveColor.X + 1.0 * dt / maxPileTime, 1),
                (float)Math.Min(mi.emissiveColor.Y + 1.0 * dt / maxPileTime, 1),
                (float)Math.Min(mi.emissiveColor.Z + 1.0 * dt / maxPileTime, 1));

            #endregion

            #region 3、次のアニメーションへの遷移判定
            Animation prevAnim = anim;
            NextAnimation[] nextAnim = new NextAnimation[]{
                new NextAnimation(Animation.Dead,false,CheckDead,true),
                new NextAnimation(Animation.Attacked,false,CheckAttacked,true),
                new NextAnimation(Animation.Ground,false,CheckGround,endAnimation),
                new NextAnimation(Animation.Float,false,CheckFloat,endAnimation),
                new NextAnimation(Animation.Run,true,null,endAnimation),
                new NextAnimation(Animation.Walk,true,null,endAnimation),
                new NextAnimation(Animation.Stop,false,null,endAnimation),
                new NextAnimation(Animation.UpSmash,false,null,true),
            };

            anim = FindNextAnimation(nextAnim, gameTime);
            if (anim == Animation.None)
            {
                anim = prevAnim;
            }

            #endregion

            #region 4、アニメーションが遷移するときの処理
            if (anim != prevAnim)
            {
                commandFlg[(int)Animation.A] = false;
                commandFlg[(int)Animation.UpA] = false;
                commandFlg[(int)Animation.DownA] = false;
                commandFlg[(int)Animation.UpA] = false;
                commandFlg[(int)Animation.UpSmash] = false;
                commandFlg[(int)Animation.UpSmash] = false;
                commandFlg[(int)Animation.DownSmash] = false;
                normalizeRectangle = true;
                if (attackArea != null) attackArea.Dispose();
                mi.emissiveColor = tmpEmissiveColor;
                mi.rotation = Vector3.Zero;
            }

            #endregion

            return true;
        }
Ejemplo n.º 6
0
        bool SideSmashAnimation(GameTime gameTime)
        {
            #region 1.初期化
            if (time <= gameTime.ElapsedGameTime)
            {
                mi.recVisible.Copy(normalRectangle);

                normalizeRectangle = false;

                pileFlg = piling;
                sideSmashRot = sideSmashRotSpeed = sideSmashSpeed = 0;
                sideSmashRotAccel = Math.Abs(sideSmashRotAccel) * (direction.X > 0 ? -1 : 1);

                tmpEmissiveColor = mi.emissiveColor;
                sideSmashTime1 = 0;
            }

            #endregion

            #region 2.アニメーション

            double dt = gameTime.ElapsedGameTime.TotalSeconds;

            // Write your logic
            switch (pileFlg)
            {
                case piling:
                    if (time.TotalSeconds >= maxPileTime || input.isOn(BUTTON.A, player.dev) == false)
                    {
                        pileFlg = finishPiling;
                    }

                    sideSmashSpeed = 0;
                    sideSmashRotSpeed += sideSmashRotAccel * dt;
                    break;
                case finishPiling:
                    pileFlg = afterPiling;
                    sideSmashTime = time.TotalSeconds + GetSmashPower(minSideSmashTime, maxSideSmashTime);

                    sideSmashSpeed = GetSmashPower(minSideSmashSpeed, maxSideSmashSpeed);
                    sideSmashSpeed *= direction.X > 0 ? 1 : -1;
                    velocity.X += (float)sideSmashSpeed;

                    Object o = scene.Parameters["AttackArea"];
                    if (o != null)
                    {
                        attackArea = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(mi.recCollision, sideSmasheX, sideSmasheY));
                        attackArea.Follow(this);
                        attackArea.NotAttack(player.id);
                        attackArea.Power = GetSmashPower(minSideSmashPower, maxSideSmashPower);
                        attackArea.Damage = GetSmashPower(minSideSmashDamage, maxSideSmashDamage);
                        scene.EntityList.Add(attackArea);
                        scene.AttackerList.Add(attackArea);
                    }
                    Cue c = GLOBAL.soundBank.GetCue("smash");
                    c.Play();
                    break;
                case afterPiling:
                    if (time.TotalSeconds >= sideSmashTime)
                    {
                        endAnimation = true;
                    }
                    break;
                default:
                    break;
            }

            sideSmashRot += sideSmashRotSpeed * dt;

            if (CheckFloat(gameTime))
            {
                AnimFloat(gameTime);
            }
            else
            {
                if (pileFlg == piling)
                {
                    AnimStop(gameTime);
                }
                else
                {
                    // 速度のy方向は0に
                    velocity.Y = 0;

                    // 速度*時間だけ動かす
                    OffsetWithAdjust(gameTime);
                }
            }

            mi.rotation = new Vector3(0, 0, (float)sideSmashRot);
            mi.emissiveColor = new Vector3(
                (float)Math.Min(mi.emissiveColor.X + 1.0 * dt / maxPileTime, 1),
                (float)Math.Min(mi.emissiveColor.Y + 1.0 * dt / maxPileTime, 1),
                (float)Math.Min(mi.emissiveColor.Z + 1.0 * dt / maxPileTime, 1));

            #endregion

            #region 3、次のアニメーションへの遷移判定
            Animation prevAnim = anim;
            NextAnimation[] nextAnim = new NextAnimation[]{
                new NextAnimation(Animation.Dead,false,CheckDead,true),
                new NextAnimation(Animation.Attacked,false,CheckAttacked,true),
                new NextAnimation(Animation.Jump,true,CheckJump,true),
                new NextAnimation(Animation.Ground,false,CheckGround,endAnimation),
                new NextAnimation(Animation.Float,false,CheckFloat,endAnimation),
                new NextAnimation(Animation.Run,true,null,endAnimation),
                new NextAnimation(Animation.Walk,true,null,endAnimation),
                new NextAnimation(Animation.Stop,false,null,endAnimation),
                new NextAnimation(Animation.SideSmash,false,null,true),
            };

            anim = FindNextAnimation(nextAnim, gameTime);
            if (anim == Animation.None)
            {
                anim = prevAnim;
            }

            #endregion

            #region 4、アニメーションが遷移するときの処理
            if (anim != prevAnim)
            {
                commandFlg[(int)Animation.A] = false;
                commandFlg[(int)Animation.UpA] = false;
                commandFlg[(int)Animation.DownA] = false;
                commandFlg[(int)Animation.SideA] = false;
                commandFlg[(int)Animation.SideSmash] = false;
                commandFlg[(int)Animation.UpSmash] = false;
                commandFlg[(int)Animation.DownSmash] = false;
                normalizeRectangle = true;
                if (attackArea != null) attackArea.Dispose();
                mi.emissiveColor = tmpEmissiveColor;
                mi.rotation = Vector3.Zero;
                velocity.X -= (float)sideSmashSpeed;
                if (direction.X > 0)
                {
                    velocity.X = Math.Max(velocity.X, 0.0f);
                }
                else
                {
                    velocity.X = Math.Min(velocity.X, 0.0f);
                }
            }

            #endregion

            return true;
        }
Ejemplo n.º 7
0
        bool SideAAnimation(GameTime gameTime)
        {
            #region 1.初期化
            if (time <= gameTime.ElapsedGameTime)
            {
                mi.recVisible.Copy(normalRectangle);

                normalizeRectangle = false;

                attackArea = null;
                Object o = scene.Parameters["AttackArea"];
                if (o != null)
                {
                    attackArea = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(mi.recCollision, sideAeX, sideAeY));
                    attackArea.Follow(this);
                    attackArea.NotAttack(player.id);
                    attackArea.Power = sideAPower;
                    attackArea.Damage = sideADamage;
                    attackArea.manual = true;
                    scene.EntityList.Add(attackArea);
                    scene.AttackerList.Add(attackArea);
                }

                if (input.isOn(BUTTON.LEFT, player.dev))
                {
                    direction = new Vector3(-1, 0, 0);
                    tmpVelocity = new Vector2(-(float)sideASpeed, 0);
                }
                else
                {
                    direction = new Vector3(1, 0, 0);
                    tmpVelocity = new Vector2((float)sideASpeed, 0);
                }
                velocity += tmpVelocity;

                ex = ey = 1.0;
                Cue c = GLOBAL.soundBank.GetCue("SA");
                c.Play();
            }

            #endregion

            #region 2.アニメーション

            double dt = gameTime.ElapsedGameTime.TotalSeconds;

            // Write your logic

            // モデルを伸縮
            if (time < TimeSpan.FromSeconds(sideATime1))
            {
                ex += sideAExtendSpeed * dt;
                double s = 1 / Math.Sqrt(ex);
                mi.depth = mi.defaultDepth * s;
                ey = s;
            }
            else if (time < TimeSpan.FromSeconds(sideATime2 + sideATime1))
            {

            }
            else if (time < TimeSpan.FromSeconds(sideATime3 + sideATime2 + sideATime1))
            {
                ex -= sideAExtendSpeed * dt;
                double s = 1 / Math.Sqrt(ex);
                mi.depth = mi.defaultDepth * s;
                ey = s;
            }
            else
            {
                endAnimation = true;
            }

            RectangleD.ExtendRect(normalRectangle, ex, ey, mi.recVisible);
            RectangleD.ExtendRect(mi.recVisible, AeX, AeY, attackArea.RecCollision);

            mi.recCollision = new RectangleD(RecVisible.X, normalRectangle.Y, RecVisible.Width, normalRectangle.Height);

            if (CheckFloat(gameTime))
            {
                AnimFloat(gameTime);
            }
            else
            {
                // 速度のy方向は0に
                velocity.Y = 0;

                // 速度*時間だけ動かす
                OffsetWithAdjust(gameTime);
            }

            mi.rotation = new Vector3(0, 0, 0);

            #endregion

            #region 3、次のアニメーションへの遷移判定
            Animation prevAnim = anim;
            NextAnimation[] nextAnim = new NextAnimation[]{
                new NextAnimation(Animation.Dead,false,CheckDead,true),
                new NextAnimation(Animation.Attacked,false,CheckAttacked,true),
                new NextAnimation(Animation.Float,false,CheckFloat,endAnimation),
                new NextAnimation(Animation.Run,true,null,endAnimation),
                new NextAnimation(Animation.Walk,true,null,endAnimation),
                new NextAnimation(Animation.Stop,false,null,endAnimation),
                new NextAnimation(Animation.SideA,false,null,true),
            };

            anim = FindNextAnimation(nextAnim, gameTime);
            if (anim == Animation.None)
            {
                anim = prevAnim;
            }

            #endregion

            #region 4、アニメーションが遷移するときの処理
            if (anim != prevAnim)
            {
                commandFlg[(int)Animation.A] = false;
                commandFlg[(int)Animation.UpA] = false;
                commandFlg[(int)Animation.DownA] = false;
                commandFlg[(int)Animation.SideA] = false;
                commandFlg[(int)Animation.SideSmash] = false;
                commandFlg[(int)Animation.UpSmash] = false;
                commandFlg[(int)Animation.DownSmash] = false;
                normalizeRectangle = true;
                mi.recVisible.Copy(normalRectangle);
                mi.recCollision = mi.recVisible;
                if (attackArea != null) attackArea.Dispose();
                velocity -= tmpVelocity;
                if (direction.X > 0)
                {
                    velocity.X = Math.Max(velocity.X, 0.0f);
                }
                else
                {
                    velocity.X = Math.Min(velocity.X, 0.0f);
                }
            }

            #endregion

            return true;
        }
Ejemplo n.º 8
0
        bool CubeUpBAnimation(GameTime gameTime)
        {
            #region 1.初期化
            if (time <= gameTime.ElapsedGameTime)
            {
                mi.recVisible.Copy(normalRectangle);
                mi.depth = 1;

                normalizeRectangle = false;

                attackArea = null;
                Object o = scene.Parameters["AttackArea"];
                if (o != null)
                {
                    attackArea = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(mi.recVisible, AeX, AeY));
                    attackArea.NotAttack(player.id);
                    attackArea.Follow(this);
                    attackArea.Power = APower;
                    attackArea.Damage = ADamage;
                    scene.EntityList.Add(attackArea);
                    scene.AttackerList.Add(attackArea);
                    Cue c = GLOBAL.soundBank.GetCue("UpB");
                    c.Play();
                }
            }

            #endregion

            #region 2.アニメーション

            double dt = gameTime.ElapsedGameTime.TotalSeconds;

            // Write your logic
            if (time < TimeSpan.FromSeconds(cubeUpBTime1))
            {
                mi.recVisible.Top3D = normalRectangle.Top3D - cubeUpBA * Math.Sin(MathHelper.Pi * time.TotalSeconds / cubeUpBTime1);
                OffsetWithAdjust(gameTime);
                cubeUpBBottom3D = cubeUpBBottom3D2 = mi.recVisible.Bottom3D;
            }
            else if (time < TimeSpan.FromSeconds(cubeUpBTime1 + cubeUpBTime2))
            {
                mi.recCollision = normalRectangle;
                velocity.X = 0;
                velocity.Y = (float)cubeUpBSpeed1;
                OffsetWithAdjust(gameTime);
                mi.recVisible.Bottom3D = cubeUpBBottom3D;
            }
            else if (time < TimeSpan.FromSeconds(cubeUpBTime1 + cubeUpBTime2 + cubeUpBTime3))
            {
                double A = normalRectangle.Bottom3D - cubeUpBBottom3D2;
                double t = MathHelper.PiOver2 * (time.TotalSeconds - cubeUpBTime1 - cubeUpBTime2) / cubeUpBTime3;
                mi.recVisible.Bottom3D = normalRectangle.Bottom3D - A * Math.Cos(t);
            }
            else
            {
                velocity = new Vector2(0, (float)cubeUpBSpeed2);
                endAnimation = true;
            }

            attackArea.RecVisible = RectangleD.ExtendRect(mi.recVisible, AeX, AeY);

            #endregion

            #region 3、次のアニメーションへの遷移判定
            Animation prevAnim = anim;
            NextAnimation[] nextAnim = new NextAnimation[]{
                new NextAnimation(Animation.Dead,false,CheckDead,true),
                new NextAnimation(Animation.Attacked,false,CheckAttacked,true),
                new NextAnimation(Animation.Ground,false,CheckGround,endAnimation),
                new NextAnimation(Animation.Float,false,CheckFloat,endAnimation),
                new NextAnimation(Animation.Run,true,null,endAnimation),
                new NextAnimation(Animation.Walk,true,null,endAnimation),
                new NextAnimation(Animation.Stop,false,null,endAnimation),
                new NextAnimation(Animation.UpB,false,null,true),
            };

            anim = FindNextAnimation(nextAnim, gameTime);
            if (anim == Animation.None)
            {
                anim = prevAnim;
            }

            #endregion

            #region 4、アニメーションが遷移するときの処理
            if (anim != prevAnim)
            {
                commandFlg[(int)Animation.B] = false;
                commandFlg[(int)Animation.UpB] = false;
                commandFlg[(int)Animation.DownB] = false;
                commandFlg[(int)Animation.SpecialB] = false;

                mi.recCollision = mi.recVisible;
                mi.recVisible.Copy(normalRectangle);
                Depth = 1;
                normalizeRectangle = true;
                upBFlg = false;

                if (attackArea != null) attackArea.Dispose();
            }

            #endregion

            return true;
        }
Ejemplo n.º 9
0
        bool AAnimation(GameTime gameTime)
        {
            #region 1.初期化
            if (time <= gameTime.ElapsedGameTime)
            {
                mi.recVisible.Copy(normalRectangle);
                ARot = 0;

                attackArea = null;
                Object o = scene.Parameters["AttackArea"];
                if (o != null)
                {
                    attackArea = new AttackArea(scene, (Hashtable)o, RectangleD.ExtendRect(mi.recCollision, AeX, AeY));
                    attackArea.NotAttack(player.id);
                    attackArea.Follow(this);
                    attackArea.Power = APower;
                    attackArea.Damage = ADamage;
                    scene.EntityList.Add(attackArea);
                    scene.AttackerList.Add(attackArea);
                }
                Cue c = GLOBAL.soundBank.GetCue("A");
                c.Play();
            }

            #endregion

            #region 2.アニメーション

            double dt = gameTime.ElapsedGameTime.TotalSeconds;

            if (-360 < ARot && ARot < 360)
            {
                ARot += ARotSpeed * dt * (direction.X > 0 ? 1 : -1);
            }
            else
            {
                ARot = 0;
                endAnimation = true;
            }

            if (CheckFloat(gameTime))
            {
                AnimFloat(gameTime);
            }
            else
            {
                AnimStop(gameTime);
            }

            mi.rotation = new Vector3(0, (float)ARot, 0);

            #endregion

            #region 3、次のアニメーションへの遷移判定
            Animation prevAnim = anim;
            NextAnimation[] nextAnim = new NextAnimation[]{
                new NextAnimation(Animation.Dead,false,CheckDead,true),
                new NextAnimation(Animation.Attacked,false,CheckAttacked,true),
                new NextAnimation(Animation.Ground,false,CheckGround,endAnimation),
                new NextAnimation(Animation.Float,false,CheckFloat,endAnimation),
                new NextAnimation(Animation.Run,true,null,endAnimation),
                new NextAnimation(Animation.Walk,true,null,endAnimation),
                new NextAnimation(Animation.Stop,false,null,endAnimation),
                new NextAnimation(Animation.A,false,null,true),
            };

            anim = FindNextAnimation(nextAnim, gameTime);
            if (anim == Animation.None)
            {
                anim = prevAnim;
            }

            #endregion

            #region 4、アニメーションが遷移するときの処理
            if (anim != prevAnim)
            {
                commandFlg[(int)Animation.A] = false;
                commandFlg[(int)Animation.UpA] = false;
                commandFlg[(int)Animation.DownA] = false;
                commandFlg[(int)Animation.SideA] = false;
                commandFlg[(int)Animation.SideSmash] = false;
                commandFlg[(int)Animation.UpSmash] = false;
                commandFlg[(int)Animation.DownSmash] = false;
                if (attackArea != null)
                {
                    attackArea.Dispose();
                    attackArea = null;
                }
            }

            #endregion

            return true;
        }
Ejemplo n.º 10
0
        void InitializePrameters()
        {
            Object o = null;

            time = TimeSpan.Zero;
            input = GLOBAL.inputManager;

            // モデルの作成とパラメータの設定
            string ch = (player.character == CHARACTER.CUBE ? "ModelCube" : "ModelSphere");
            MakeModel(ch);

            string name = (o = parameters["DirectionIndicator_name"]) != null ? (string)o : "";
            Vector3 originalSize = new Vector3(
                float.Parse((o = parameters["DirectionIndicator_originalSizeX"]) != null ? (string)o : "0.0"),
                float.Parse((o = parameters["DirectionIndicator_originalSizeY"]) != null ? (string)o : "0.0"),
                float.Parse((o = parameters["DirectionIndicator_originalSizeZ"]) != null ? (string)o : "0.0")
                );
            RectangleD recVisible = new RectangleD(
                double.Parse((o = parameters["DirectionIndicator_recVisibleX"]) != null ? (string)o : "0.0"),
                double.Parse((o = parameters["DirectionIndicator_recVisibleY"]) != null ? (string)o : "0.0"),
                double.Parse((o = parameters["DirectionIndicator_recVisibleW"]) != null ? (string)o : "0.0"),
                double.Parse((o = parameters["DirectionIndicator_recVisibleH"]) != null ? (string)o : "0.0")
                );
            float depth = float.Parse((o = parameters["DirectionIndicator_depth"]) != null ? (string)o : "1.0");
            Vector3 rotation = Vector3.Zero;
            Vector3 emissiveColor;

            mi = ((ModelInfo)model["model"]);
            if (player.id == 0)
            {
                mi.emissiveColor = new Vector3(
                    float.Parse((o = parameters["1P_emissiveColorX"]) != null ? (string)o : "1.0"),
                    float.Parse((o = parameters["1P_emissiveColorY"]) != null ? (string)o : "1.0"),
                    float.Parse((o = parameters["1P_emissiveColorZ"]) != null ? (string)o : "1.0")
                    );
                mi.recVisible = new RectangleD(
                    double.Parse((o = parameters["1P_recVisibleX"]) != null ? (string)o : "0.0"),
                    double.Parse((o = parameters["1P_recVisibleY"]) != null ? (string)o : "0.0"),
                    double.Parse((o = parameters["1P_recVisibleW"]) != null ? (string)o : "0.0"),
                    double.Parse((o = parameters["1P_recVisibleH"]) != null ? (string)o : "0.0")
                );
                direction = new Vector3(1, 0, 0);
                rotation = new Vector3(0, 0, 0);
            }
            else
            {
                mi.emissiveColor = new Vector3(
                    float.Parse((o = parameters["2P_emissiveColorX"]) != null ? (string)o : "1.0"),
                    float.Parse((o = parameters["2P_emissiveColorY"]) != null ? (string)o : "1.0"),
                    float.Parse((o = parameters["2P_emissiveColorZ"]) != null ? (string)o : "1.0")
                    );
                mi.recVisible = new RectangleD(
                    double.Parse((o = parameters["2P_recVisibleX"]) != null ? (string)o : "0.0"),
                    double.Parse((o = parameters["2P_recVisibleY"]) != null ? (string)o : "0.0"),
                    double.Parse((o = parameters["2P_recVisibleW"]) != null ? (string)o : "0.0"),
                    double.Parse((o = parameters["2P_recVisibleH"]) != null ? (string)o : "0.0")
                );
                direction = new Vector3(-1, 0, 0);
                rotation = new Vector3(0, 180, 0);
            }

            mi.recCollision = mi.recVisible;
            recVisible.Offset(mi.recVisible.Center.X - recVisible.Center.X, 0);

            emissiveColor = mi.emissiveColor;

            model.Add("DirectionIndicator", new ModelInfo(name, originalSize, recVisible, depth, RectangleD.Empty, rotation, emissiveColor));

            dist = ((ModelInfo)model["DirectionIndicator"]).recVisible.Bottom3D - RecVisible.Top3D;

            normalRectangle = new RectangleD(mi.recVisible);

            cnt_ColStateWithAttacker = cnt_ColStateWithSolid = 0;
            MAX_COLSTATEWithAttacker = MAX_COLSTATEWithSolid = 60;
            colStateWithAttacker = new Hashtable[MAX_COLSTATEWithAttacker];
            colStateWithSolid = new Hashtable[MAX_COLSTATEWithSolid];

            MAX_ADJUSTTOHIST = 60;
            adjustToHist = new int[MAX_ADJUSTTOHIST];
            for (int i = 0; i < adjustToHist.Length; i++)
            {
                adjustToHist[i] = -1;
            }

            life = int.Parse((o = parameters["life"]) != null ? (string)o : "3");

            /*
             * ゲージ
             */
            gage = 0;
            gageV = double.Parse((o = parameters["gageV"]) != null ? (string)o : "1.0");
            MAX_GAGE = double.Parse((o = parameters["MAX_GAGE"]) != null ? (string)o : "100.0");

            /*
             * アニメーション
             */
            // 共通して使用する変数
            anim = Animation.Stop;
            velocity = Vector2.Zero;               // 速度
            endAnimation = false;      // アニメーションが終わったかどうかのフラグ
            tmpJumpFlg = 0;            // ジャンプフラグの退避用変数
            attackArea = null;   // 見えない攻撃範囲(通常攻撃などで使用)
            ex = ey = 1;      // 拡大率
            tmpVelocity = Vector2.Zero;            // 速度の退避用変数
            ox =  oy = 0;                  // 差分
            pileFlg = 0;                // スマッシュのアニメーションに使うフラグ
            maxPileTime = double.Parse((o = parameters["maxPileTime"]) != null ? (string)o : "3.0");             // ため時間の上限
            tmpEmissiveColor = Vector3.Zero;       // EmissiveColorの退避用変数

            // Stop
            stopAccel = double.Parse((o = parameters["stopAccel"]) != null ? (string)o : "1.0");         // 静止しようとする加速度

            // Walk
            maxWalkSpeed = double.Parse((o = parameters["maxWalkSpeed"]) != null ? (string)o : "1.0");  // 歩く速さの上限
            double peekTime = double.Parse((o = parameters["walkPeekTime"]) != null ? (string)o : "1.0");
            walkAccel = maxWalkSpeed / peekTime;            // 歩きの加速度

            // Run
            maxRunSpeed = double.Parse((o = parameters["maxRunSpeed"]) != null ? (string)o : "3.0");// 走りの加速度
            peekTime = double.Parse((o = parameters["runPeekTime"]) != null ? (string)o : "1.0");   // 走る速さの上限
            runAccel = maxRunSpeed / peekTime;

            // Jump
            jumpTime1 = double.Parse((o = parameters["jumpTime1"]) != null ? (string)o : "0");               // ジャンプの溜めの時間
            jumpA = double.Parse((o = parameters["jumpA"]) != null ? (string)o : "0");                   // ジャンプの溜めのときのモデル伸縮幅
            jumpFlg = 0;                    // 今、何段目のジャンプをしているか
            MAX_JUMP = int.Parse((o = parameters["MAX_JUMP"]) != null ? (string)o : "2");                   // 何段ジャンプが出来るか
            peekTime = double.Parse((o = parameters["jumpPeekTime1"]) != null ? (string)o : "1.0");
            double peekHeight = double.Parse((o = parameters["jumpPeekHeight1"]) != null ? (string)o : "1.0");
            jumpSpeed1 = 2 * peekHeight / peekTime;
            jumpSpeed = jumpSpeed1;
            gravity = jumpSpeed1 / peekTime;
            peekTime = double.Parse((o = parameters["jumpPeekTime2"]) != null ? (string)o : "1.0");
            peekHeight = double.Parse((o = parameters["jumpPeekHeight2"]) != null ? (string)o : "1.0");
            jumpSpeed2 = 2 * peekHeight / peekTime;
            maxJumpSpeedX = double.Parse((o = parameters["maxJumpSpeedX"]) != null ? (string)o : "3.0");

             // Float
            peekTime = double.Parse((o = parameters["slidePeekTime"]) != null ? (string)o : "1.0");
            maxSlideSpeed = double.Parse((o = parameters["maxSlideSpeed"]) != null ? (string)o : "1.0");
            slideAccel = maxSlideSpeed / peekTime;        // 浮遊時に横に動こうしたときの加速度
            maxFallSpeed = double.Parse((o = parameters["maxFallSpeed"]) != null ? (string)o : "1.0");
            fallAccel = gravity * double.Parse((o = parameters["fallAccel"]) != null ? (string)o : "1.0"); ;     // 高速落下しているときの落下スピード (gravityに対する比率で指定)
            floatRot = 0;            // 二段目以降のジャンプでの回転角度
            floatRotSpeed = double.Parse((o = parameters["floatRotSpeed"]) != null ? (string)o : "360.0"); ;     // 二段目以降のジャンプでの回転速度

            // Ground
            groundTime = double.Parse((o = parameters["groundTime"]) != null ? (string)o : "1");              // アニメーションの時間
            groundA = double.Parse((o = parameters["groundA"]) != null ? (string)o : "0.2");                 // 伸縮幅
            maxGroundSpeed = double.Parse((o = parameters["maxGroundSpeed"]) != null ? (string)o : "3");          // 横方向の最大速度
            groundAccel = double.Parse((o = parameters["groundAccel"]) != null ? (string)o : "1");             // 横方向の加速度

            // Climb
            climbRot = 0.0;                                                                                 // 回転角度。Degree
            climbRotSpeed = double.Parse((o = parameters["climbRotSpeed"]) != null ? (string)o : "1000.0"); // 回転速度。Degree

            // Sit
            sitTime = double.Parse((o = parameters["sitTime"]) != null ? (string)o : "0");                         // アニメーションの時間
            sitA = double.Parse((o = parameters["sitA"]) != null ? (string)o : "0");

            avoidGTime = double.Parse((o = parameters["avoidGTime"]) != null ? (string)o : "0");        // アニメーションの時間

            avoidRSpeed = double.Parse((o = parameters["avoidRSpeed"]) != null ? (string)o : "0");
            avoidRTime = double.Parse((o = parameters["avoidRTime"]) != null ? (string)o : "0");        // アニメーションの時間

            avoidSSpeed = double.Parse((o = parameters["avoidSSpeed"]) != null ? (string)o : "0");
            avoidSTime = double.Parse((o = parameters["avoidSTime"]) != null ? (string)o : "0");        // アニメーションの時間

            brownTime = double.Parse((o = parameters["brownTime"]) != null ? (string)o : "0");
            maxBrownTime = double.Parse((o = parameters["maxBrownTime"]) != null ? (string)o : "0");
            minBrownTime = double.Parse((o = parameters["minBrownTime"]) != null ? (string)o : "0");
            maxGetDamage = double.Parse((o = parameters["maxGetDamage"]) != null ? (string)o : "0"); ;
            maxBrownSpeed = double.Parse((o = parameters["maxBrownSpeed"]) != null ? (string)o : "0");     // 最大の吹っ飛び速度
            brownFallAccel = gravity * double.Parse((o = parameters["brownFallAccel"]) != null ? (string)o : "1");    // 下ボタンを押しているときの重力加速度
            brownSlideAccel = slideAccel * double.Parse((o = parameters["brownSlideAccel"]) != null ? (string)o : "1");   // 横ボタンを押しているときの横方向の加速度

            brownRotSpeed = 0;
            _brownRotSpeed = double.Parse((o = parameters["brownRotSpeed"]) != null ? (string)o : "0");
            brownRot = 0;

            breakFallSpeed = double.Parse((o = parameters["breakFallSpeed"]) != null ? (string)o : "0");    // 跳ね返りの速さ
            maxBreakFallSpeed = double.Parse((o = parameters["maxBreakFallSpeed"]) != null ? (string)o : "0"); // 衝突面と平行な方向の速度の最大値

            checkDownSpeedSquared = double.Parse((o = parameters["checkDownSpeedSquared"]) != null ? (string)o : "25");

            attackedTime = double.Parse((o = parameters["attackedTime"]) != null ? (string)o : "0.5");      // アニメーションの時間
            brownAngle = double.Parse((o = parameters["brownAngle"]) != null ? (string)o : "15");
            minAttackedRatio = double.Parse((o = parameters["minAttackedRatio"]) != null ? (string)o : "1");
            maxAttackedRatio = double.Parse((o = parameters["maxAttackedRatio"]) != null ? (string)o : "5");
            maxDamage = double.Parse((o = parameters["maxDamage"]) != null ? (string)o : "200");

            deadTime = double.Parse((o = parameters["deadTime"]) != null ? (string)o : "1.0");          // アニメーションの時間

            o = scene.Parameters[scene.Stage];
            if ( o != null )
            {
                Object o1;
                double y = double.Parse((o1 = ((Hashtable)o)["aliveZoneY"]) != null ? (string)o1 : "-100");
                double h = double.Parse((o1 = ((Hashtable)o)["aliveZoneH"]) != null ? (string)o1 : "200");
                double w = h * GLOBAL.WindowWidth / GLOBAL.WindowHeight;
                double x = -0.5 * w;

                aliveZone = new RectangleD(x, y, w, h);// この外に出れば死ぬ
                rebornPos = new Vector2(
                    float.Parse((o1 = ((Hashtable)o)["rebornPos" + player.id + "X"]) != null ? (string)o1 : "0"),
                    float.Parse((o1 = ((Hashtable)o)["rebornPos" + player.id + "Y"]) != null ? (string)o1 : "10")
                    );
            }
            else
            {
                aliveZone = RectangleD.Empty;
                rebornPos = Vector2.Zero;
            }

            ARot = 0;                // 回転角度
            ARotSpeed = double.Parse((o = parameters["ARotSpeed"]) != null ? (string)o : "360");       // 回転速度
            AeX = double.Parse((o = parameters["AeX"]) != null ? (string)o : "1.2");    // 攻撃範囲のRecCollisionに対する大きさ比率
            AeY = double.Parse((o = parameters["AeY"]) != null ? (string)o : "1.2");    // 攻撃範囲のRecCollisionに対する大きさ比率
            ADamage = double.Parse((o = parameters["ADamage"]) != null ? (string)o : "5");
            APower = double.Parse((o = parameters["APower"]) != null ? (string)o : "10");

            sideAeY = double.Parse((o = parameters["sideAeY"]) != null ? (string)o : "0.9");
            sideAeX = 1 / sideAeY / sideAeY;  // 攻撃範囲のRecCollisionに対する大きさ比率
            sideASpeed = double.Parse((o = parameters["sideASpeed"]) != null ? (string)o : "0");                              // 移動速度
            sideATime1 = double.Parse((o = parameters["sideATime1"]) != null ? (string)o : "1");                              // 伸びきるのにかかる時間
            sideAExtendSpeed = (sideAeX - 1) / sideATime1;                                                                          // 伸縮する速度
            sideATime2 = double.Parse((o = parameters["sideATime2"]) != null ? (string)o : "1");                              // 伸びきってから縮み始めるまでの時間
            sideATime3 = double.Parse((o = parameters["sideATime3"]) != null ? (string)o : "1");                              // 縮みきるのにかかる時間
            sideADamage = double.Parse((o = parameters["sideADamage"]) != null ? (string)o : "5");
            sideAPower = double.Parse((o = parameters["sideAPower"]) != null ? (string)o : "10");

            upAeX = double.Parse((o = parameters["upAeY"]) != null ? (string)o : "0.9");
            upAeY = 1 / upAeX / upAeX;                                                                              // 攻撃範囲のRecCollisionに対する大きさ比率
            upATime1 = double.Parse((o = parameters["upATime1"]) != null ? (string)o : "1");                                // 伸びきるのにかかる時間
            upAExtendSpeed = (upAeY - 1) / upATime1;                          // 伸縮する速度
            upATime2 = double.Parse((o = parameters["upATime2"]) != null ? (string)o : "1");                                // 伸びきってから縮み始めるまでの時間
            upATime3 = double.Parse((o = parameters["upATime3"]) != null ? (string)o : "1");                                // 縮みきるのにかかる時間
            upADamage = double.Parse((o = parameters["upADamage"]) != null ? (string)o : "5");
            upAPower = double.Parse((o = parameters["upAPower"]) != null ? (string)o : "10");

            downAeY = double.Parse((o = parameters["downAeY"]) != null ? (string)o : "0.9");
            downAeX = 1 / downAeY / downAeY;  // 攻撃範囲のRecCollisionに対する大きさ比率
            downATime1 = double.Parse((o = parameters["downATime1"]) != null ? (string)o : "1");                              // 伸びきるのにかかる時間
            downAExtendSpeed = (downAeX - 1) / downATime1;                                                                          // 伸縮する速度
            downATime2 = double.Parse((o = parameters["downATime2"]) != null ? (string)o : "1");                              // 伸びきってから縮み始めるまでの時間
            downATime3 = double.Parse((o = parameters["downATime3"]) != null ? (string)o : "1");                              // 縮みきるのにかかる時間
            downADamage = double.Parse((o = parameters["downADamage"]) != null ? (string)o : "5");
            downAPower = double.Parse((o = parameters["downAPower"]) != null ? (string)o : "10");

            sideSmashTimeRatio = double.Parse((o = parameters["sideSmashTimeRatio"]) != null ? (string)o : "1");               // ため終わった後のアニメーションの時間
            sideSmashRot = 0;                // 回転角度
            sideSmashRotSpeed = 0;           // 回転速度
            sideSmashRotAccel = double.Parse((o = parameters["sideSmashRotAccel"]) != null ? (string)o : "1");         // 回転加速度
            sideSmashRotSpeedRatio = double.Parse((o = parameters["sideSmashRotSpeedRatio"]) != null ? (string)o : "3");    // タメ時間に対する回転速度の比率
            sideSmashSpeed = 0;            // 移動速度
            sideSmashSpeedRatio = double.Parse((o = parameters["sideSmashSpeedRatio"]) != null ? (string)o : "3");       // タメ時間に対する移動速度の比率
            minSideSmashSpeed = double.Parse((o = parameters["minSideSmashSpeed"]) != null ? (string)o : "3");         // 移動速度の最小値
            maxSideSmashSpeed = double.Parse((o = parameters["maxSideSmashSpeed"]) != null ? (string)o : "10");        // 移動速度の最大値
            sideSmasheX = double.Parse((o = parameters["sideSmasheX"]) != null ? (string)o : "0");
            sideSmasheY = double.Parse((o = parameters["sideSmasheY"]) != null ? (string)o : "0");        // 攻撃範囲のRecCollisionに対する大きさ比率
            minSideSmashDamage = double.Parse((o = parameters["minSideSmashDamage"]) != null ? (string)o : "5");
            minSideSmashPower = double.Parse((o = parameters["minSideSmashPower"]) != null ? (string)o : "10");
            maxSideSmashDamage = double.Parse((o = parameters["maxSideSmashDamage"]) != null ? (string)o : "5");
            maxSideSmashPower = double.Parse((o = parameters["maxSideSmashPower"]) != null ? (string)o : "10");
            maxSideSmashTime = double.Parse((o = parameters["maxSideSmashTime"]) != null ? (string)o : "1");
            minSideSmashTime = double.Parse((o = parameters["minSideSmashTime"]) != null ? (string)o : "1");
            sideSmashTime = 0;

            upSmashTime = double.Parse((o = parameters["upSmashTime"]) != null ? (string)o : "1");               // ため終わった後のアニメーションの時間
            minUpSmashDamage = double.Parse((o = parameters["minUpSmashDamage"]) != null ? (string)o : "5");
            minUpSmashPower = double.Parse((o = parameters["minUpSmashPower"]) != null ? (string)o : "10");
            maxUpSmashDamage = double.Parse((o = parameters["maxUpSmashDamage"]) != null ? (string)o : "5");
            maxUpSmashPower = double.Parse((o = parameters["maxUpSmashPower"]) != null ? (string)o : "10");
            upSmashRot = 0;
            upSmashRotSpeed = 0;
            upSmashRotAccel = double.Parse((o = parameters["upSmashRotAccel"]) != null ? (string)o : "360");
            maxUpSmashTime = double.Parse((o = parameters["maxUpSmashTime"]) != null ? (string)o : "10");
            minUpSmashTime = double.Parse((o = parameters["minUpSmashTime"]) != null ? (string)o : "10");
            upSmashA = 0;
            upSmasheX = double.Parse((o = parameters["upSmasheX"]) != null ? (string)o : "1.2");
            upSmasheY = double.Parse((o = parameters["upSmasheY"]) != null ? (string)o : "1.2");
            maxUpSmashA = double.Parse((o = parameters["maxUpSmashA"]) != null ? (string)o : "10");
            upSmashExtendSpeed = double.Parse((o = parameters["upSmashExtendSpeed"]) != null ? (string)o : "10");

            downSmashTime = double.Parse((o = parameters["downSmashTime"]) != null ? (string)o : "1");               // ため終わった後のアニメーションの時間
            minDownSmashDamage = double.Parse((o = parameters["minDownSmashDamage"]) != null ? (string)o : "5");
            minDownSmashPower = double.Parse((o = parameters["minDownSmashPower"]) != null ? (string)o : "10");
            maxDownSmashDamage = double.Parse((o = parameters["maxDownSmashDamage"]) != null ? (string)o : "5");
            maxDownSmashPower = double.Parse((o = parameters["maxDownSmashPower"]) != null ? (string)o : "10");
            downSmashRot = 0;
            downSmashRotSpeed = 0;
            downSmashRotAccel = double.Parse((o = parameters["downSmashRotAccel"]) != null ? (string)o : "360");
            maxDownSmashTime = double.Parse((o = parameters["maxDownSmashTime"]) != null ? (string)o : "10");
            minDownSmashTime = double.Parse((o = parameters["minDownSmashTime"]) != null ? (string)o : "10");
            downSmashA = 0;
            downSmasheX = double.Parse((o = parameters["downSmasheX"]) != null ? (string)o : "1.2");
            downSmasheY = double.Parse((o = parameters["downSmasheY"]) != null ? (string)o : "1.2");
            maxDownSmashA = double.Parse((o = parameters["maxDownSmashA"]) != null ? (string)o : "10");
            downSmashExtendSpeed = double.Parse((o = parameters["downSmashExtendSpeed"]) != null ? (string)o : "10");

            cubeBBomb = new CubicBomb[int.Parse((o = parameters["cubeBNum"]) != null ? (string)o : "5")];
            sphereBBomb = new GuidedBomb[int.Parse((o = parameters["sphereBNum"]) != null ? (string)o : "5")];

            cubeUpBA = double.Parse((o = parameters["cubeUpBA"]) != null ? (string)o : "0.3");
            cubeUpBTime1 = double.Parse((o = parameters["cubeUpBTime1"]) != null ? (string)o : "0.2");
            peekHeight = double.Parse((o = parameters["cubeUpBPeekHeight"]) != null ? (string)o : "10");
            cubeUpBTime2 = double.Parse((o = parameters["cubeUpBTime2"]) != null ? (string)o : "10");
            cubeUpBSpeed1 = peekHeight / cubeUpBTime2;
            cubeUpBSpeed2 = jumpSpeed1 * double.Parse((o = parameters["cubeUpBSpeed2"]) != null ? (string)o : "0.7");
            cubeUpBTime3 = double.Parse((o = parameters["cubeUpBTime3"]) != null ? (string)o : "10");
            cubeUpBBottom3D = 0;
            cubeUpBBottom3D2 = 0;

            cubeDownBMaxFallSpeed = double.Parse((o = parameters["cubeDownBMaxFallSpeed"]) != null ? (string)o : "5");
            cubeDownBEmissiveColor =  new Vector3(
                    float.Parse((o = parameters["cubeDownBEmissiveColorX"]) != null ? (string)o : "5"),
                    float.Parse((o = parameters["cubeDownBEmissiveColorY"]) != null ? (string)o : "5"),
                    float.Parse((o = parameters["cubeDownBEmissiveColorZ"]) != null ? (string)o : "5")
                    );
            attackedAbsorb = false;

            int maxBomb = int.Parse((o = parameters["maxCubeSBBomb"]) != null ? (string)o : "10");
            cubeSBBomb = new CubicBomb[maxBomb];
            cubeSBCnt = 0;
            cubeSBRad = double.Parse((o = parameters["cubeSBRad"]) != null ? (string)o : "10");
            cubeSBAngle = 0;
            cubeSBDAngle = 0;
            cubeSBTimeSpan = double.Parse((o = parameters["cubeSBTimeSpan"]) != null ? (string)o : "10");

            maxBomb = int.Parse((o = parameters["maxSphereSBBomb"]) != null ? (string)o : "10");
            sphereSBBomb = new GuidedBomb[maxBomb];
            sphereSBCnt = 0;
            sphereSBRad = double.Parse((o = parameters["sphereSBRad"]) != null ? (string)o : "10");
            sphereSBAngle = 0;
            sphereSBDAngle = 0;
            sphereSBTimeSpan = double.Parse((o = parameters["sphereSBTimeSpan"]) != null ? (string)o : "10");
        }