0

Hi all I m making a simple game in C# (Catch ME). In this game there will be a button to catch. when a user moves the pointer to click on to it. It moves further and doesnt get clicked. i have done it by changing the location of the button. But by doing so, the button moves in a fixed set location and also when pointer is brought near the form boundries the button gets out of the form or becomes invisible. So i want the some random number be generated and assigned to the location property of the button so that button moves randomly. Also ensure that it must be within the form boundries.
Thanks in advance for any Idea

2
Contributors
9
Replies
10
Views
9 Years
Discussion Span
Last Post by Ramy Mahrous
0

Random class helps you, but your problem is easier than generating random number and so on. what you need is to detect Mouse.X and Mouse.Y and change the location of button to be out this area.

0

Thnks Ramy But i also need to generate a random number can u help me in that also

0

Plz Any one can give me any idea to access random class in C# and How to generate a random Number

0

One More quistion Ramy, I cant able to change the location of the button on mouse move. How to do it

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.