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 / move object move, distance

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 18th Jan 2004 02:31
in this code here:


it just jumps the object to the location, instead of gradually moving it...but if i change this line here:

to this:

it does it just fine...why is that?

what the code does (just in case you dont understand)
i have 3 objects on a matrix, you click on one, then right click else where when a object is selected, then it will move it. if you want me to post the whole code (it should just work out of the box) i will.

TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 18th Jan 2004 03:16
don't think of it as "move object move, distance"
but as "move object move, speed". You are moving the
object from the original position to the target in one
frame.

Why do programmers always mix up Christmas and Halloween?
Because DEC 25 = OCT 31
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 18th Jan 2004 05:37
Darwin, what you need to do, is have a variable that sets weather or not the object should be moving, ie, when you right-click and the obejct is selected, set its move variable to 1, then, somewhere else in the loop, check all the moving variables, and then move the the object if it's set to 1, ie;



That's how I did it in mine, and that also means that your units can keep on moving even if you deselect them.

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 20th Jan 2004 04:20
@TKF15H: yeah, thats kinda what i figured it was after i played with it for a while :p

@JT: thats a good idea...im starting over on my code, because i structered it all wrong , but i havnt done much, & i have actually been planning it so i know what i need now and i know what im doing

thanx for the help guys

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 20th Jan 2004 06:15
lol, good for you.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-05-22 14:38:27
Your offset time is: 2025-05-22 14:38:27