public BattlePhase(ContentManager _content) { _list_monsterATK = new LinkedList<Card>(); battleSword = new BattleSword(_content); m_timer = new Timer(); this.Step = eBattleStep.ENDPHASE; #if DEBUG Trace.Listeners.Add(new TextWriterTraceListener("debug.log")); Trace.AutoFlush = true; #endif }
public override void Init(Game game) { base.Init(game); _contentManager = game.Content; _goFirstPlayer = 0; _playerChoose = -1; _botChoose = -1; _playerChooseIndex = -1; _botChooseIndex = -1; _goFirstPlayer = -1; _rightOffset = 800 + 200*2; //200 là width của 1 nút _leftOffset = 0 - 200 * 2; _speedMove = 100; _timer = 0.0f; //Add 4 Button Player for (int i = 0; i < 9; i++) { _playerButtons.Add(RandomHandButton()); _playerButtons.Last().Position = new Vector2(_leftOffset + i * (_playerButtons.Last().Sprite.Bound.Width), 350); float time = (_playerButtons.Last().Position.X - _leftOffset + _playerButtons.First().Sprite.Bound.Width) / _speedMove; _playerButtons.Last().AddMoveTo(new MoveTo(time, new Vector2(_leftOffset + (-1) * _playerButtons.First().Sprite.Bound.Width, 350))); _playerButtons.Last().ButtonEventWithSender += OnButtonEventWithSender; } for (int i = 0; i < 9; i++) { _botButtons.Add(new Button(new Sprite(_contentManager, "Chosen\\jya_eye_1"), new Sprite(_contentManager, "Chosen\\jya_eye_3"), new Sprite(_contentManager, "Chosen\\jya_eye_2"))); _botButtons.Last().Position = new Vector2(_rightOffset - i * (_botButtons.Last().Sprite.Bound.Width), 50); float time = (_rightOffset - _botButtons.Last().Position.X) / _speedMove; _botButtons.Last().Origin = new Vector2(_botButtons.Last().Sprite.Bound.Width, _botButtons.Last().Sprite.Bound.Height); _botButtons.Last().Rotation = (float)Math.PI; _botButtons.Last().AddMoveTo(new MoveTo(time, new Vector2(_rightOffset, 50))); } //Select your hand _selectHandTitle = new Sprite(_contentManager, "Chosen\\bg_mid_m2"); _selectHandTitle.Position = new Vector2(400 - _selectHandTitle.Bound.Width / 2, 300 - _selectHandTitle.Bound.Height / 2); _background = new Sprite(_contentManager, "Menu\\MenuBackground"); //Timer _myTimer = new Timer(); _myTimer.ResetStopWatch(); _start = true; }
public LP_Change(ContentManager _content, Vector2 _position) { m_timer = new Timer(); this.m_position = _position; this.m_numsprite = new Num(_content, _position, SpriteID.font_1640_damage); }