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 / i cant get this done

Author
Message
Guyver Unit 1
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Guyver universe probably 3512 B.C.
Posted: 30th Jun 2004 23:31
well i got this small matrix of 20 by 10 and i use this code for an object that i use as an pointer but the problem is that the object cant get off the matrix like i want to but the mouse goes through

if mx#<0 then mx#=1
if mx#>10 then mx#=9
if my#>20 then my#=19
if my#<4 then my#=5
mx#= MOUSEX()
my#= 20 - MOUSEY()
position object 7,mx#,0,my#

~im not good at expressing things but who cares, im a god in my mind~
Kain
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: NJ, USA
Posted: 30th Jun 2004 23:50
Well, I'm not quite sure what you are asking. But one thing you probably want to change:

if mx#<0 then mx#=1
if mx#>10 then mx#=9
if my#>20 then my#=19
if my#<4 then my#=5

To:

if mx#<0 then mx#=0
if mx#>10 then mx#=10
if my#>20 then my#=20
if my#<4 then my#=4

You want to make your check the same number as your repositioning. Otherwise your object will skip around.

Any chance you could restate your question? I'm not quite clear on what you are asking. The only other thing I could think of that would give you problems is that maybe the object isn't moving in sync with the mouse? This can be fixed by two ways in this code:

position object 7,mx#,0,my#

Either change the y position (currently at 0) to something else. Or, and more preferably, devide the mx# and my# variables by different numbers. Experiment to see what numbers get it matching more closely with the mouse.

Guyver Unit 1
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Guyver universe probably 3512 B.C.
Posted: 1st Jul 2004 00:06
thnxs for reponding what i ment was that the object doesnt get of the matrix right, but the mouse does it just goes and doest stop the mouse has to stop or else it just goes on and the object will stay there on the side
im srry if im not very clear

~im not good at expressing things but who cares, im a god in my mind~
DeepBlue
21
Years of Service
User Offline
Joined: 17th May 2003
Location: A little box in the UK
Posted: 1st Jul 2004 00:21
Take your after a mouse to 3d/matrix coordinates.

Theres a sample here in the codebase

http://developer.thegamecreators.com/?m=codebase_view_code&i=1eb03b2a2b7549c2ee563984c21bc4ef

Suggest you download the sample.zip file that shows a nice demo of it working

http://developer.thegamecreators.com/userdata/codebase/files/example.zip

Code posted by JamesBlond

The coder formerly known as Twynklet.
Guyver Unit 1
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Guyver universe probably 3512 B.C.
Posted: 1st Jul 2004 04:10
gee thnxs guy that really helped a lot

~im not good at expressing things but who cares, im a god in my mind~

Login to post a reply

Server time is: 2024-09-22 15:40:20
Your offset time is: 2024-09-22 15:40:20