コード例 #1
0
ファイル: Robot.cs プロジェクト: EamonnACI/ACI-SpaceRace
 /// <inheritdoc />
 public virtual void OnMouseWheelMoved(MouseWheelMovedEvent e)
 {
 }
コード例 #2
0
ファイル: Interactive.cs プロジェクト: markthor/robocode
        // Called when the mouse wheel is rotated
        public override void OnMouseWheelMoved(MouseWheelMovedEvent e)
        {
            // If the wheel rotation is negative it means that it is moved forward.
            // Set move direction = forward, if wheel is moved forward.
            // Otherwise, set move direction = backward
            moveDirection = (e.WheelRotation < 0) ? 1 : -1;

            // Set the amount to move = absolute wheel rotation amount * 5 (speed)
            // Here 5 means 5 pixels per wheel rotation step. The higher value, the
            // more speed
            moveAmount += Math.Abs(e.WheelRotation)*5;
        }