Increasing number once per mouse click/key press in XNA
- by DMan
This has been bothering me lately- when I use some code like below to increase selection every mouse click:
if (m.LeftButton == ButtonState.Pressed)
currentSelection++;
Then currentSelection increases by a ton, simply because this code is in my Update() function and by design, runs every frame and so increases currentSelection. There is almost no…