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
set display mode 1024,768,16
CLS
SYNC ON
SYNC RATE 20
MAKE OBJECT CUBE 1, 25
pos3dx = OBJECT POSITION X(1)
pos3dy = OBJECT POSITION Y(1)
do
posx = OBJECT SCREEN X(1)
posy = OBJECT SCREEN Y(1)
if rightkey()=1 then inc pos3dx
if leftkey()=1 then dec pos3dx
POSITION OBJECT 1, pos3dx, 0, 0
if OBJECT IN SCREEN(1) = 0
POSITION OBJECT 1, 0, 0, 0
endif
set cursor 0,0
print posx, \" \", posy, \" \", OBJECT IN SCREEN(1)
SYNC
loop