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 think that i don`t understand with db ..

Author
Message
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 9th Feb 2006 00:47 Edited at: 9th Feb 2006 00:51
EDIT : SORRY FOR THE SPELLING ERROR IN TITLE


This is kind of strange (odd) to me , if you use :

move object 1,0.5

it will move right as it should , BUT if you use :

speed#=0.5
move object 1,speed#

it will not move at all..

i`m not sure i understand why ?

--Dodic--
Don`t try to SEE the future , try to MAKE the future the way you like it.
---------
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 9th Feb 2006 00:54
Quote: "move object 1,0.5

it will move right as it should , BUT if you use :"

in which direction it'll move depends on the object's rotation angle.

Quote: "speed#=0.5
move object 1,speed#

it will not move at all.."

It works here.

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 9th Feb 2006 00:57
Sorry , i didn`t mean right for direction.. (i guess i don`t know how to spell the "other one" correctly ) i meant rite maby ? i don`t know , but the word that says "Just like it should work.."

What my point was that it`ll work in decimall speed unit if you write it directly into move object command , but if you don`t (example :

speed#=0.5
move object 1,speed#
)

Then it will just well NOT move.

--Dodic--
Don`t try to SEE the future , try to MAKE the future the way you like it.
---------
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 9th Feb 2006 01:04
Quote: "speed#=0.5
move object 1,speed#
)

Then it will just well NOT move."

Like I said, it works here. Are you sure you typed the variable name correctly?

Copy and Paste this code and see if it works.


UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 9th Feb 2006 01:57
I think I know what's wrong.
If you made the speed variable at the begining of the program, and then put the move object command within a function, it will not get any variables outside the function unless it is an array, or is passed on to the function like:
Function Move_Object(speed#)
Move object 1,speed#
Endfunction
and call it with
Move_Object(speed#)


Hippopotomonstrosesquippedaliophobia-Fear of long words

Login to post a reply

Server time is: 2025-05-23 10:50:17
Your offset time is: 2025-05-23 10:50:17