PM wrote:
Hi,
Im a student currently designing a game for a project.
As part of my game, I want to be able to drag a shape over a series of
panels. The shape needs to be able to be dropped on any of the panels.
If the shape is dropped outside any of the panels, I want it to be
returned to its original position.
Does anyone have any hints to the code I should be using?
Thanks
Hi,
This news group discuss the C++ language as defined by the ANSI/ISO
standard; Therefore, I assume that your "game", "shape" and "panel"
objects are standard C++ classes and further assume that you have the
methods "drop(const shape&)" and "position()" implemented somewhere in
your code.
If so, I guess you need a loop over all panels and an if-statement to
check that the shape is within all panels and a method to set the
position of your "shape" object.
If not, go to a more appropriate news group.
Regards,
Peter Jansson
http://www.jansson.net/