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 / last loop click

Author
Message
ShadowCentaur 2
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Free Country USA
Posted: 21st Apr 2005 13:59
i often find it usefull to make a variable that stores the "last loop click", the status of the mouse on the previous game loop. is this a good idea? does anyone else do it? are there better ways to see if the mouse has just been pressed this loop, but hasn't been held down?

Truth suffers from too much analysis.
-Ancient Fremen Saying
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 22nd Apr 2005 14:11 Edited at: 22nd Apr 2005 14:24
ShadowCentaur 2,

Truly, I cannot figure a reason to check, when a mouse button is clicked, if it has been held pressed before hand. If you have a program which will activate code A upon a mouseclick, then code A will be activated upon the first click of it. This rids the reason for checking if the mouse button was held down previously. This is because if it was held down on the last loop and some odd loops before, this means that code A would have also been activated on those loops.

In conclusion, this is tough to explain and I hope you have understood what I am trying to say.

+NanoBrain+
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 23rd Apr 2005 07:21 Edited at: 23rd Apr 2005 07:22
`Long click/short click detection routine ^_^
`(Relatively SHORT piece of code, had to use a {code} to
`keep the indentation)



How's my typing? Phone 0800-GO-TO-HELL
ShadowCentaur 2
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Free Country USA
Posted: 28th Apr 2005 08:07
thanks blanky. i was working on making something, like in AOE or starcraft, where you can click to "drop" the corner of the box in one place, and drag the other corner to another location, then release to achieve desired effect. i was having trouble making the program tell the difference between having just clicked and having held it down dragging the box around for a while

Truth suffers from too much analysis.
-Ancient Fremen Saying

Login to post a reply

Server time is: 2025-05-23 15:05:36
Your offset time is: 2025-05-23 15:05:36