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 / Little help

Author
Message
Mode5555
20
Years of Service
User Offline
Joined: 2nd Nov 2003
Location:
Posted: 10th Nov 2003 05:22
New to DB and I have a question, In this code:
DO
IF UPKEY() THEN
move object up 1, 8 "and" YROTATE OBJECT 1,OBJECT ANGLE X(1)+5
LOOp
What do I replace the "and " with
Thank you.
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 10th Nov 2003 05:30
Hi,

Like this:



Don't use "IF x THEN" when you need more than one statement to be executed in the IF block. It's easier to debug like I've laid it out above. However if you want to use an AND test in an IF statement, you can do so like this:

IF a>b AND b>c THEN do stuff

Cheers,

Rich

"It's easy to be mean when death equals a high score screen."
"You can take your Quake and go away, I'd rather play Bubble Bobble any day."
Mode5555
20
Years of Service
User Offline
Joined: 2nd Nov 2003
Location:
Posted: 10th Nov 2003 05:40
Cool
Thank you
Dark Coyote
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 10th Nov 2003 14:26
You can also do this if you want it to stay on one line:

DO
IF UPKEY() THEN
move object up 1, 8 : YROTATE OBJECT 1,OBJECT ANGLE X(1)+5
LOOp

Dark Coyote.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 10th Nov 2003 19:23
do
if upkey()
move object up 1,8 : Yrotate object 1, object angle x(1)+5 : endif
loop
i dont think that other one works

Two words, moo.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 10th Nov 2003 23:21
do
if upkey()=1
move object up 1,8
Yrotate object 1, object angle x(1)+5
endif
loop

third time's a charm

-RUST-
Dark Coyote
20
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 11th Nov 2003 17:55
ops, error in my post up there, meant to say:

IF UPKEY()=1 THEN move object up 1, 8 : YROTATE OBJECT 1,OBJECT ANGLE X(1)+5

This works in dark basic classic not sure about pro though.

Dark coyote.

Login to post a reply

Server time is: 2024-09-21 09:44:32
Your offset time is: 2024-09-21 09:44:32