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 / main loop?

Author
Message
pagio
21
Years of Service
User Offline
Joined: 8th Jan 2003
Location: - Please Select -
Posted: 11th Jan 2003 01:09
i have created a 3d character that walks i use loop
to do that every thing else must be in that loop or can i have that loop running always while other lines executed?
Dont forget the retro games
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 11th Jan 2003 05:23
yes. See the "3d that walks" in the fast track learning section of the tutorials. Just make sure you know what frame numbers the walk cycle start and end on.
Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 11th Jan 2003 19:20
Everything must be in the loop
pagio
21
Years of Service
User Offline
Joined: 8th Jan 2003
Location: - Please Select -
Posted: 12th Jan 2003 00:30
there is no other way?to animate my character without every thing in that main loop?

Dont forget the retro games
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 12th Jan 2003 07:35
do can deploy a few types of loops using these command combos. would u like frys with that?


do
loop
rem no way to escape this one unless u add more commands

while
endwhile

rem a condition that does something while u have a variable or condition set


if
endif

rem ahh classic if, if a condition is met then play that song sam

for
next

rem for next next loops will do it as many times as you want


these are some basics u can get even weirder but have a practise of these if you havent explored them

heres a sample
rem while the spacbar is not pressed place and sync
the screen with the text

rem as u can see u can use things backwards to achieve your goals as in reference to the spackey being a zero compared to one

while spacekey()=0
text 10,10,"hello world"
sync
endwhile
end
rem then the program ends as if it was in a loop


clear as mud? yay!

AsriCE
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location: Brunei
Posted: 12th Jan 2003 09:01
You could try using GOSUB's. E.G:




You could also try using functions. E.G:



Hope that helps. Goodluck.
Asri Crew

Anak Brunei!

Login to post a reply

Server time is: 2024-03-29 05:10:21
Your offset time is: 2024-03-29 05:10:21