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 / Following Objects

Author
Message
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 29th Jul 2004 19:54
Does anyone know how to get an object to follow another object like train? Kinda Like This:

If you can't see the image goto http://www.freewebs.com/trainexample/

Do you see how the car 1 curves along the track, and car 2 and car 3 follow with the same curve

I hope i've made this clear...
...if i haven't please let me know.

This will really help.

I have tried alot of things like pointing the 2nd and 3rd carriages at the 1st and them trying to get them to move in the main loop, but for some reason they won't.

Thanks in Advance
Cya Later,
Axelman

This Space for rent
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 29th Jul 2004 21:44
Did you try pointing the 2nd carriage at the first, and the 3rd carriage at the seconds? That would be more realistic than the one you attempted.

AMD Athlon XP2800+
GeForce FX5200 128MB
1024MB DDR 333MHz RAM
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 30th Jul 2004 11:12
yea, thats kinda what i meant, except thats not my problem. the problem is that the 2nd and 3rd carriages don't move when i use the MOVE OBJECT command. i'll put some code up when i get home from school.

This Space for rent
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Jul 2004 13:59
Have you tried making each carradge a limb to the first?

Or optionally, making dummy objects ( such as a plain ) for each carradge, then make the carradge's limbs to the plains and offsetting them so that the "front" of the carradge is at the position of the plain.

Then, you can use NewXValue, NewZValue to position the "carradge" ( the plain ) at the back of the carradge in front.

Hows that sound?

If you want, i could try to write up some example code, but I haven't used limbs in such a long time...

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 30th Jul 2004 16:27 Edited at: 30th Jul 2004 16:32
alrighty then, i've made a bit of mistake here. I'm not making a train game, i'm making a snake game (Please don't Laugh). I'm embarrased because its noob stuff and i'm still having a hard time with it, and as you probably know jess its taken me well over a year to get even a small grip on darkbasic programming. This is very embarrasing because i've heard people say stuff on these forums like "DarkBASIC is so easy, even Idiots can learn it" and stuff like that. I posted a different thread before but not much people saw it and i think its already sank. I'm gonna try to enter this in the competition, then have a crack at the intermediate level.

Anyways, more about the snake game instead of self pity. The thing is i've got my snake, which is, at the moment, a cube. it moves very different from a normal snake game, instead of having a box like movement it is very free, and the snake swerves around.

Heres the movement



You have already helped with this game on the collision jess, you might remember. anyways when the snake eats the food (Which it successfully does) the second piece of tail appears, right behind the snake. the problem with this though is the tail does not follow, and i wanted it to follow in the train like example as i said before. I didn't say this before because, Again, i was too embarrased.

Anyways, Heres the code

Hope you guys understand now.
Cya
Axelman

This Space for rent

Login to post a reply

Server time is: 2025-05-25 18:28:42
Your offset time is: 2025-05-25 18:28:42