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 Professional Discussion / Moving object up or down

Author
Message
xavier jefferson
15
Years of Service
User Offline
Joined: 11th Apr 2011
Location:
Posted: 13th Apr 2011 18:04
Im trying to make my ship move up and down as well as forwards back ards etc

if mvoes forward back side to side just fine but it wont move up or down. ive tried a few different variations of the move ovject up and down from the dark basic command help folder but have nto found any that work

this is my current set up that gives me the error object number is illegal

if Upkey()=1 then move object 1,MySpeed
if Downkey()=1 then move object 1,0-MySpeed
if Leftkey()=1 then A1Y = wrapvalue(A1Y-(MySpeed/3))
if Rightkey()=1 then A1Y = wrapvalue(A1Y+(MySpeed/3))
if keystate(29)=1then move object down,1
if keystate(48)=1then move object up,1


ive tried making the object number on the keystates 87 which is my actual ship but i still get the same error
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Apr 2011 19:35
You need to put a space after "if keystate(29)=1" and "if keystate(48)=1" before the word "then" otherwise the compiler sees "1then" as not a number

Jimmy
22
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 13th Apr 2011 20:50
Also your move object up and down commands need to have the object number and the amount to move:

Move object up 1, 1

NaGaFailMo.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 13th Apr 2011 21:05
keystates may be confusing sometimes.

I always use:
EXP: if lower$(inkey$()="w") then move object up objno
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 13th Apr 2011 21:11 Edited at: 13th Apr 2011 21:33
correckshun!


[edit]
WAIT. There isn't even a command called "move object up"!!!!!

Errm...


>.>

[edit2]
just kidding yes there is.


Tell me if there's a broken link to images in a thread I post, and I'll fix 'em.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 13th Apr 2011 21:23
Quote: "move object up"


One of IanM's I think.

paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 13th Apr 2011 21:26 Edited at: 13th Apr 2011 21:27
Straight from the DBPro help files
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 13th Apr 2011 21:32
Oh...

okay then...

I guess I shouldn't try to give DBPro help from a linux box xD


Tell me if there's a broken link to images in a thread I post, and I'll fix 'em.
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Apr 2011 02:09
'MOVE OBJECT UP'??? (I didn't know that existed either)

Does that affect Euler angles like the free flight commands?

Warning! May contain Nuts!
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Apr 2011 02:11
It's not rotation, so it shouldn't. Normally I'd say "definitely not" but... I can't test it, so I'll stick to "probably not".


Tell me if there's a broken link to images in a thread I post, and I'll fix 'em.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Apr 2011 11:02
Definitely not.

It just adds to the position in Y of the object.

paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 14th Apr 2011 22:05
It doesnt change the rotation of the object,but it does take into account the angle of the object being moved,just like the move object command,so depending on the rotation of the object when you use this command you may get som unexpected results.

Login to post a reply

Server time is: 2026-07-18 06:41:23
Your offset time is: 2026-07-18 06:41:23