I was hoping someone might be able to help me with a 'newbie' question please.
I want to be able to move a mouse pointer around, and then when the mouse is clicked, record the x and y position and place a sprite in that position. The next time the mouse button is pressed, a second sprite is displayed at the new mouse position, and then finally, a third upon another mouse button click. Further mouse button clicks will then re-position the first sprite and so on......
This should leave 3 sprites on the screen, and record their positions.
The current code does this, and displays the x/y position of each sprite. The problem I have is that a single "mouse click" event is hard to make and the code loops round very quickly making discrete sprite positioning difficult.
Can anyone please suggest a way to remedy this?
Any help would be much appreciated.
Maybe don't record the click as a click until the mouse button goes back up? Like, while the mouse is being held down, show the sprite in the location of the mouse, but don't keep it there and increment to the next sprite number until the mouse buttons stops being pressed.
Thanks very much for both of your suggestions.
I have played around a bit, bearing your ideas in mind and come up with the following code that does the job. Not elegant, but it works!!
Thanks again - much appreciated.
if mpress~=stat(34) and stat(34)~=0 then
[Please log in to post a comment]