Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Mouseclick problems... Help!

Author
Message
Jake025
16
Years of Service
User Offline
Joined: 28th Aug 2008
Location:
Posted: 8th Sep 2008 19:44
I've been trying to create a game where you click on objects that pop up to destroy them and gain points. However, I have come to a problem.

Here is the code.



The problem is that whenever I try to run it, it says the loop is out of place. What am I doing wrong?
Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 8th Sep 2008 20:02 Edited at: 8th Sep 2008 20:03
The problem is that your IF statements are not being closed. You must close them with an END IF or a THEN followed by a command of some sort.

According to your need and code above, I would probably setup the code like this:



Notice I used PICK OBJECT instead. SCREEN OBJECT returns only a single point, whilst pick obect will check the mouse position against all points where the object is on screen..
Jake025
16
Years of Service
User Offline
Joined: 28th Aug 2008
Location:
Posted: 8th Sep 2008 20:29
Thanks! That worked great!

Login to post a reply

Server time is: 2024-11-15 21:18:57
Your offset time is: 2024-11-15 21:18:57