Exemple #1
0
        public virtual void Update(GameTime gametime)
        {
            Transfer.Update(this);
            for (int i = 0; i < DuelDisk.Length; i++)
            {
                DuelDisk[i].Update(gametime);
            }
            switch (this.DuelistID)
            {
            case ePlayerId.PLAYER:
                this.opponent = PlayScene.Computer;
                break;

            case ePlayerId.COMPUTER:
                this.opponent = PlayScene.Player;
                break;

            default:
                break;
            }
            switch (this.Phase)
            {
            case ePhase.STARTUP:
                break;

            case ePhase.DRAW:
                break;

            case ePhase.STANDBY:
                foreach (var item  in MonsterField.ListCard)
                {
                    if ((item as Monster).BattlePosition == eBattlePosition.ATK)
                    {
                        (item as Monster).CanATK = true;
                    }
                }
                break;

            case ePhase.MAIN1:
                break;

            case ePhase.BATTLE:

                break;

            case ePhase.MAIN2:
                break;

            case ePhase.END:
                break;

            case ePhase.TEST:
                break;

            default:
                break;
            }
            this.m_healthbar.Update(gametime);
            this.Lp_change.Update(gametime);
        }
 public HealthBar(ContentManager _content, Duelist _duelist)
     : base(_content,ID.HEALTH_BAR,SpriteID.lp_bar)
 {
     duelist = _duelist;
     m_lp_extractor = new Sprite(
         SpriteManager.getInstance(_content).GetSprite(SpriteID.lp_extract));
     switch (_duelist.DuelistID)
     {
         case ePlayerId.PLAYER:
             m_lp_extractor.Position = GlobalSetting.Default.LPBAR;
             this.Sprite.Frame = new Rectangle(0, 0, 150, 16);
             break;
         case ePlayerId.COMPUTER:
             m_lp_extractor.Position = ComputerSetting.Default.LPBAR;
             this.Sprite.Frame = new Rectangle(0, 16, 150, 16);
             break;
         default:
             break;
     }
     this.Sprite.Position = this.m_lp_extractor.Position + new Vector2(28, 2);
 }
 public void Update(Duelist _player)
 {
     this.collector(_player.DuelDisk);
     this.distribute(_player.DuelDisk);
 }
 public void DirectAtk(Duelist _duelist)
 {
     Vector2 point_vt = GlobalSetting.Default.CenterField +
            ((_duelist.DuelistID == ePlayerId.PLAYER) ? new Vector2(0, 210) : new Vector2(0, -210));
     Point p = new Point((int)point_vt.X,(int)point_vt.Y);
     this.Rotation =this.SetRotation(p);
     this.AddMoveTo(
         new MoveTo(0.3f, point_vt));
 }
Exemple #5
0
        public virtual void Update(GameTime gametime)
        {
            Transfer.Update(this);
            for (int i = 0; i < DuelDisk.Length; i++)
            {
                DuelDisk[i].Update(gametime);
            }
            switch (this.DuelistID)
            {
                case ePlayerId.PLAYER:
                    this.opponent = PlayScene.Computer;
                    break;
                case ePlayerId.COMPUTER:
                    this.opponent = PlayScene.Player;
                    break;
                default:
                    break;
            }
            switch (this.Phase)
            {
                case ePhase.STARTUP:
                    break;
                case ePhase.DRAW:
                    break;
                case ePhase.STANDBY:
                    foreach (var item  in MonsterField.ListCard)
                    {
                        if ((item as Monster).BattlePosition == eBattlePosition.ATK)
                            (item as Monster).CanATK = true;
                    }
                    break;
                case ePhase.MAIN1:
                    break;
                case ePhase.BATTLE:

                    break;
                case ePhase.MAIN2:
                    break;
                case ePhase.END:
                    break;
                case ePhase.TEST:
                    break;
                default:
                    break;
            }
            this.m_healthbar.Update(gametime);
            this.Lp_change.Update(gametime);
        }
        public void Update(Duelist _duelist)
        {
            if (_duelist.IsTurn == false)
                return;
            if (_duelist.DuelistID == ePlayerId.COMPUTER)
            {
                foreach (var bt in buttons)
                {
                    bt.Hovered = false;
                }
            }
            int frameY = 75 * Convert.ToInt32(_duelist.DuelistID);
            foreach (var button in buttons)
            {
                button.NormalImage.Frame = new Rectangle(0,frameY,25,75);
            }

            buttons[Math.Max(0,Convert.ToInt32(_duelist.Phase) - 1)].NormalImage.Frame = new Rectangle(40, frameY, 25, 75);
        }