Exemple #1
0
 public AttackArea(Fight scene, Hashtable parameters, RectangleD rect)
     : base(scene, parameters)
 {
     model.Add("model", new ModelInfo("", Vector3.Zero, RectangleD.Empty, 0, rect, Vector3.Zero, Vector3.Zero));
     normalRectangle = new RectangleD();
     normalRectangle.Copy(RecCollision);
     Object o = model["recCollision"];
     if (o != null)
     {
         mi = (ModelInfo)o;
         mi.emissiveColor = new Vector3(1, 0, 1);
     }
     force = Vector2.Zero;
     damage = 0;
     expandSpeedX = expandSpeedY = 0;
     w = rect.Width;
     h = rect.Height;
 }
Exemple #2
0
        bool SphereBAnimation(GameTime gameTime)
        {
            #region 1.初期化

            if (time <= gameTime.ElapsedGameTime)
            {
                mi.recVisible.Copy(normalRectangle);
                mi.depth = 1;
                int i = 0;

                for (i = 0; i < sphereBBomb.Length; i++)
                {
                    if (sphereBBomb[i] == null)
                    {
                        break;
                    }
                }

                if (i < sphereBBomb.Length)
                {
                    Object o = scene.Parameters["GuidedBomb"];
                    if (o != null)
                    {
                        RectangleD rect = new RectangleD();
                        rect.Copy(normalRectangle);
                        if (direction.X > 0)
                        {
                            rect.X += 1.5;
                        }
                        else
                        {
                            rect.X -= 1.5;
                        }
                        sphereBBomb[i] = new GuidedBomb(scene, (Hashtable)o, rect, player.id);
                        sphereBBomb[i].Follow(this);
                        scene.EntityList.Add(sphereBBomb[i]);
                        Cue c = GLOBAL.soundBank.GetCue("B");
                        c.Play();
                    }
                }

            }

            #endregion

            #region 2.アニメーション

            double dt = gameTime.ElapsedGameTime.TotalSeconds;

            // Write your logic

            endAnimation = true;

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

            mi.rotation = Vector3.Zero;

            #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.B,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;
            }

            #endregion

            return true;
        }