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 / A problem

Author
Message
Whong
20
Years of Service
User Offline
Joined: 15th Jul 2004
Location: Turku Finland
Posted: 12th Feb 2005 18:47
okey! here is the thing. I've made a cube and would like to control it by typing in words to make it go forward and backward etc.

I'm sending source of what i've got. My problem is that I can't add more commands. If I do none of them will work!
Mr Pointless
20
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 14th Feb 2005 03:27
Assuming you're trying to add the commands with that "if" statement...

Have a look in the help file for core commands or something like that and see if you can find commands like "select" and "case". If you can I may be able to help.

"My gods, Detritus, that's not a crossbow, that's a national emergency." - Sam Vimes from "The Fifth Elephant".
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 15th Feb 2005 09:13
Move object 1,0.03

Unfortunately there is not move object command in DarkBasic Classic. You will need to use this set of commands:

newx#=newxvalue(object position x(1), object angle y(1), 0.3)
newz#=newzvalue(object position z(1), object angle y(1), 0.3)
position object 1, newx#, object position y(1), newz#


It's been a while...so check to make sure that covers all the dimensions you need to move in.

The newxvalue and newzvalue functions are a quick way to do some trig to calculate where the next coordinate will be when you are moving at different angles.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 15th Feb 2005 16:14 Edited at: 15th Feb 2005 16:16
ok, here is what to do:

do

if userpassword$=""
INPUT "Password: ",userpassword$
IF lower$(userpassword$) = "sijak"
Move object 1,0.03
ELSE
if lower$(userpassword$) = "kajis"
Move object 1,-0.03
else
etc. etc.
ENDIF

loop


note that this sorce wont compile

blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 23rd Feb 2005 02:06
Move object works FINE in DBC..

Mr Blanky - This Time, It's Personal

Login to post a reply

Server time is: 2025-05-23 19:05:15
Your offset time is: 2025-05-23 19:05:15