Esempio n. 1
0
 private void Player2_UnitMoved(object sender, UnitMovedEventArgs e)
 {
     _mapWindow.DrawUnit(e.Unit, "#", Font);
     _mapWindow.FlipBuffer();
 }
Esempio n. 2
0
        /// <summary>
        /// Trigger function in the event of unit moving across the screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void updateLocationOfUnit(Object sender, UnitMovedEventArgs e)
        {
            UnitUI ui = componentToUI[e.Unit] as UnitUI;

            ui.DrawBox = new Rectangle((int)(e.NewPoint.X * cellDimension) - ui.DrawBox.Width / 2, (int)(e.NewPoint.Y * cellDimension) - ui.DrawBox.Height / 2, ui.DrawBox.Width, ui.DrawBox.Height);
        }
Esempio n. 3
0
        private void Player_UnitMoved(object sender, UnitMovedEventArgs e)
        {
            Point cell = new Point(Globals.Instance.GameWorld.SelectedUnit.Location.X, Globals.Instance.GameWorld.SelectedUnit.Location.Y);

            _mapWindow.CenterOnCell(cell);
        }