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 / formula for object to be able to run around a loop de loop?

Author
Message
Mugen Wizardry
User Banned
Posted: 15th May 2010 18:26
Hi all. can someone show me an example of an object being able to run around a loop de loop?

kinda like in sonic the hedgehog
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th May 2010 21:27
...hmmm...


If you want more than that I'll need more of an example from you. If you are using a collision system it gets more complicated...

Mugen Wizardry
User Banned
Posted: 15th May 2010 21:55
here:



although i cant figure out how to give it collisions...

the main idea's there

the media is attached.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 15th May 2010 22:27
dont use that source, use this:



u still need media

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 15th May 2010 23:47
also, im using collisions

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 16th May 2010 01:56
did this help, baxslash?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th May 2010 02:33
Yes, I'll take a look tomorrow...

I love problems like this, I hope I can help!

Mugen Wizardry
User Banned
Posted: 16th May 2010 15:59
cool!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th May 2010 10:22
If you use sparkies, you can cast a ray from the characters head to below the characters feet, get the collision normal, then use that to rotate your character.

My signature is NOT a moderator plaything! Stop changing it!
Mugen Wizardry
User Banned
Posted: 17th May 2010 15:06
hey baxslash, were u able to take a look

at this?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th May 2010 15:35
Yeah I did as it happens. I have to agree with mobiius on this one.

Take a look at sparky's collision dll (if you don't have it already), it's really easy to use and understand and will help with this issue. You can use raycasting to fire a ray down at your character's feet and get a 'normal' angle from the collision. Then you can just rotate your character to that angle.

Also it can be used for sliding collision and bounce (to get rebound angles, good for pool games etc.).

I think this is the best thing you can do for now. If you follow it up I'll post you some example code using your own setup as an example but I need to be sure you want to use sparky's first or I'm wasting my time? (it's free)

Mugen Wizardry
User Banned
Posted: 17th May 2010 15:38
i'm definitely using sparky

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 18th May 2010 00:54
so is that enough info?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 18th May 2010 15:18
ok, so what can u do
with sparky, baxslash?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 15:30
Quote: "so is that enough info?"

Yes, thanks.

Sorry, I've had some crazy stuff happening over the last few days and haven't had time to do this yet, I may be setting up a new company in the immediate future and I just got asked to be my friend's 'best man' in September so lot's to do...

Give me a chance and I will post you something ASAP but be patient as the next few days are crucial to this new project! In the mean time maybe Mobiius would write a quick snippet to push you in the right direction?

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th May 2010 15:45
Quote: "In the mean time maybe Mobiius would write a quick snippet to push you in the right direction?"

Erm..........

Lol, I'll see what I can come up with.

My signature is NOT a moderator plaything! Stop changing it!
Mugen Wizardry
User Banned
Posted: 18th May 2010 15:46
thanks alot, guys!

i appreciate it

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 17:04 Edited at: 18th May 2010 17:05
OK, so I did something anyway... I cheated a bit to get the character to keep facing the right way but it's not far from working right!

EDIT: Oh, use "A" and "D" to move the character...

Mugen Wizardry
User Banned
Posted: 18th May 2010 17:17 Edited at: 18th May 2010 17:22
THIS IS AWESOME! O_O

2 questions though. how can i make him go backwards depending on his speed so he slowly accelerates back the way he came.

also how do i make it so if he's close to stopped, and in the middle of the loop de loop, he just falls off?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 17:25
Quote: "how can i make him go backwards depending on his speed so he slowly accelerates back the way he came."

You could reduce his speed depending on his current angle so if he's at 90deg his speed reduces at a "x" per second...

Quote: "also how do i make it so if he's close to stopped, and in the middle of the loop de loop, he just falls off?"

Well using the idea for the first question if you keep track of his current velocity using the same equation you could just have a limit below which you trigger him to be "falling" and then the standard movement functions don't work like:


Quote: "how do i make the camera independant of the loop?"

What do you mean?

Mugen Wizardry
User Banned
Posted: 18th May 2010 17:28
scratch the camera idea.

i fixed that lol

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 18th May 2010 17:31
can u make it work like sonic the hedgehog?

u have seen sonic?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 17:46
Quote: "can u make it work like sonic the hedgehog?

u have seen sonic?"

I could if I had time, which I don't and yes I have seen sonic (my son loves the original and I was playing it the other night)...

Sorry I've done about as much as I can spare time for now, the rest is up to you!

By the way, use the "Edit Post" link at the bottom of your last message if you are just adding to it or the MOD squad will put you in the stocks for double posting!

Mugen Wizardry
User Banned
Posted: 18th May 2010 17:57
im not just adding to it.

is there anyway i could

make it so it doesnt rely on point object?

cuz i need to be able to turn my player

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mugen Wizardry
User Banned
Posted: 18th May 2010 18:05
here's what i have:



i have it sorta working

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 18:20
Quote: "is there anyway i could

make it so it doesnt rely on point object?

cuz i need to be able to turn my player"

Looks like your player is turning to me?

Do you mean you want to have the camera turn with the player? If so try this:


Mugen Wizardry
User Banned
Posted: 18th May 2010 18:22
yea. but see the problem is i cant run up the loop de loop anymore.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 18:47
This works slightly better:


Mugen Wizardry
User Banned
Posted: 18th May 2010 18:53
thanks! works!

now. how would i

give him gravity?

that would solve most

of the fall off

the loop problems.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 18:58
Why don't you tell me what game you're making and I'll just write it for you?

It's your turn now, type "gravity" in the "Forum Search" at the bottom and you'll probably get over 100 threads to look through. That's what I do when I'm stuck and the best way to learn (other than having a go)!

Mugen Wizardry
User Banned
Posted: 18th May 2010 19:04 Edited at: 18th May 2010 19:10
im trying to make

a sonic darkbasic unleashed clone!

a sonic directx9 clone!

originally, it was sonic blitz3d unleashed,

but i decided to upgrade it

even further!

EDIT: Do you mind making

it so that when he
goes up the loop,

and he starts to slow down,

he realizes he's going

back down so he turns,

and starts to accelerate

to which ever way he is facing?
and if he stops completely,

he falls off?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th May 2010 19:22
Why do you keep hitting enter many times every 5th word? It's quite annoying?

And you're still double posting! You could have used edit for each one of your double posts.

My signature is NOT a moderator plaything! Stop changing it!
Mugen Wizardry
User Banned
Posted: 18th May 2010 19:23
i like short sentences. sorry lol

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th May 2010 23:01
Quote: "Do you mind making

it so that when he
goes up the loop,

and he starts to slow down,

he realizes he's going

back down so he turns,

and starts to accelerate

to which ever way he is facing?
and if he stops completely,

he falls off?"

Yes,

I do mind

sorry...

I'm really

busy

and I've given you
lots of help to get you

started

"Your turn"

Login to post a reply

Server time is: 2026-07-25 23:12:17
Your offset time is: 2026-07-25 23:12:17