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 / Problem with object movement

Author
Message
Erwin_Br
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: The Netherlands
Posted: 18th Nov 2005 16:39
Hi,

I\'m new to DB (Classic) and I\'m experimenting. I have no idea why the code below doesn\'t work. What I want to do is move the cube out of the screen. When it\'s not on screen, its position is reset to 0, 0, 0. This works fine, except for one thing: I can\'t move the cube anymore?

My question: Why can\'t I move the cube after I set its position to 0, 0, 0? What am I doing wrong, and how can I fix this?

I hope you guys can help me out here. Thanks.

Kind regards,

--Erwin

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Nov 2005 15:12
Although you reposition the cube at 0,0,0 you don't reset the variable pos3dx back to 0. Try:

if OBJECT IN SCREEN(1) = 0
POSITION OBJECT 1, 0, 0, 0
pos3dx=0
endif

TDK_Man

Erwin_Br
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: The Netherlands
Posted: 20th Nov 2005 01:58
Problem solved. Thanks!

--Erwin

Login to post a reply

Server time is: 2025-05-22 19:47:51
Your offset time is: 2025-05-22 19:47:51