I am not sure if this is in the correct form but if it’s not please let me know so that I can notify a mod.....
I have a form with a picturebox control on it. At this point the picturebox is simply moving from left to right 10 pixels per second. I also have a menu with a New Game option on it. My goal is to when clicked the New Game menu will reset the picturebox to a new location. I would like for this new location to be randomly generated each time. So this is what I have......
I am guessing I am going to have to build another function and have my newGameMenu Event Handler call that function. That I can do but what goes in the function is confusing me. Espically the random location aspect of it. Any advice would be great....Code://This Event Handler handles the momvment of an object(ship) //on the form private: System::Void gameTimer_Tick(System::Object * sender, System::EventArgs * e) { int newx = ship->Location.X + 10; int newy = ship->Location.Y; Point newloc = Point(newx,newy); ship->Location = newloc; } private: System::Void newGameMenu(System::Object * sender, System::EventArgs * e) { //? }
FYI - This is being done in Visual C++ 2003
Thanks
Chad



LinkBack URL
About LinkBacks


