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 / What is wrong with my camera movement code?

Author
Message
Heiner Hink
20
Years of Service
User Offline
Joined: 17th May 2004
Location:
Posted: 27th May 2004 14:15
Hi there,
i want my camera go back and forth and therefore I wrote this little piece of code. Unfoirtunateley, tha camera does not move a bit. what am i doing wrong?

By the way, i defined the variable Ort outside of this loop ...

/////////////CODE:
do
position camera 1, 0, 30, Ort#
A:
while Ort# > 100
Ort# = Ort# + 0.1
endwhile

goto B:

text 50,50,"Esc to exit"

B:
While Ort# > 0
Ort# = Ort# - 1

endwhile
goto A:
loop

Beeing creative is a profession, not a task
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 27th May 2004 14:25
Change the first while Ort# > 100
to while Ort# < 100

Its not a bug, its a feature!
Heiner Hink
20
Years of Service
User Offline
Joined: 17th May 2004
Location:
Posted: 27th May 2004 14:42
Nah, it did not do the trick :-( unfortunateley, i was not that easy
Heiner

Beeing creative is a profession, not a task
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 27th May 2004 14:51
No, I took a better look at your code and its the while statements. They keep incrementing the values until they reach the value, but the camera is only updated after they're both done. This should work:

do
position camera 1, 0, 30, Ort#
if Ort# < 100
Ort# = Ort# + 0.1
else
done = 1
endif
if Ort# > 0 and done = 1
Ort# = Ort# - 1
endif
loop

Its not a bug, its a feature!

Login to post a reply

Server time is: 2024-09-22 10:40:34
Your offset time is: 2024-09-22 10:40:34