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.

DarkBASIC Discussion / Mouse control

Author
Message
Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 13th Apr 2005 23:52
I want to create a game that works a bit like dragon's lair (I think) where the direction of the player is determned by clicking on arrows in the corner of the screen to change the scene, but it won't work! The Game Creators Staff were rude when I asked them it (they said, "Don't expect everyone to do it for you! Post in the forums!") Please tell me what is wrong with my code!

sonic91
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 14th Apr 2005 04:47
Ur code doesn't show up with me... maybe you should repost it?
Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 16th Apr 2005 01:09
Sorry, there must be an error with the system, or maybe the computer doesn't like me (they never do!). Here is the code I have tried for making a circle on screen disappear by clicking in the top left corner of the screen:

cls
sync on
sync rate 30
circle 300,300,20
if mousex()<100 and mousey()<100
cls

(I sometimes get errors arising in lines that don't exist in the above code, e.g. line 10, line 15, etc.)

sonic91
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 18th Apr 2005 15:20
Sonic The Hedgehog,

I have attached to this post source code which solves your problem. It needs no media, so just copy and paste and run it. The code is fairly simple and is printed with a comment for each section within it.

By the way, in the code you wrote above...



...is definately set for erros. You are missing the endif part of the if statement, which is checking for mouse coordinates. Also, you have turned manual sync on, but have not included the sync command to manualy refresh the screen.

+NanoBrain+
Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 28th Apr 2005 18:57
thanks for all your help, you've been great! it has really helped my programming (and helped me keep sane!)

sonic91

Login to post a reply

Server time is: 2025-05-23 11:17:09
Your offset time is: 2025-05-23 11:17:09