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 / 2d collision

Author
Message
xxelixx
15
Years of Service
User Offline
Joined: 6th Dec 2008
Location: CodeLand
Posted: 5th Aug 2009 22:29
I'm having trouble figuring out how to make the white box, when it hits the white border, stop.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Aug 2009 06:47
You never want to use the mouse coordinates directly if you want to limit the area it'll be in because you'd have to use the POSITION MOUSE command which will cause problems and weird glitches. You always want the mouse to have free reign on the whole screen.

Instead you want to use variables to store the current mouse coordinates and have a set of IF/THEN statements to change the coordinates if they go beyond where you want them to be.

Also it's better to do the screen and character setup before the main DO/LOOP. It's not a good idea to create, use once, and delete images when you're just going to create the same image in a few milliseconds.



xxelixx
15
Years of Service
User Offline
Joined: 6th Dec 2008
Location: CodeLand
Posted: 6th Aug 2009 09:29
Thanks for the help.

Login to post a reply

Server time is: 2024-11-25 04:31:59
Your offset time is: 2024-11-25 04:31:59