public int getPosition()
{
return position += value;
}
public void resetPosition()
{
if (getPosition()>20)
{
position = 0;
state++
}
}
public void btnRoll_Click(object sender, EventArgs e)
{
value = diceRoll.Throw();
lblValue.Text = Convert.ToString(value);
lblPosition.Text = Convert.ToString(getPosition());
lblstate.Text = Convert.ToString(state);
}
So basically I want it so when the value is equal to or greater than 20, to set the position to 0 and increment the state variable. then output them into a label.


Sign In
Create Account


Back to top









