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 / Flyhard Heli Movement

Author
Message
Ashley Staggs
16
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 17th Sep 2010 11:22
hi,

im quite new to dbpro and am having some difficulty in getting a flying saucer to move in the way i want.

After some digging through files that came with my purchase flyhard was a game that has the exact same movement as i need. Unfortunatly there is no project file.

How could i replicate this fluid movent?

Thanks
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Sep 2010 12:41 Edited at: 17th Sep 2010 12:42
I'm guessing you need some smooth inertia in your movement, so I suggest a simple control scheme but with curvevalues. Curvevalues smooth out movement, so you supply the new value, current value, and a transition rate. Maybe something like this:



This is untested, as I'm nowhere near DBPro right now, but it might work - it should give a dummy flying saucer that you control with the arrow keys, with quite smooth movement. If it doesn't work I can take another look at it later.

Health, Ammo, and bacon and eggs!
Ashley Staggs
16
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 17th Sep 2010 14:13
the smooth movement works perfectly. Thanks.

Just one thing, the rotation in flyhard when moving left or right depending on speed.

I have been playing around and just cannot figure it out.

Any suggestions?
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 17th Sep 2010 16:35 Edited at: 17th Sep 2010 16:36
Mabey something like this?
Ashley Staggs
16
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 17th Sep 2010 16:50
i took out the dummy cube as i do not know why it is needed.

The great thing is it works perfectly.

Thanks soooo much, this is put me back on track.
Ashley Staggs
16
Years of Service
User Offline
Joined: 18th Sep 2009
Location:
Posted: 18th Sep 2010 14:05
hi again,

after loading in my world i have found that i am moving too slowly.

Please could you tell me what i need to edit in order to speed up.

Thanks
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 18th Sep 2010 23:05
Quote: "i took out the dummy cube as i do not know why it is needed."

The purpose of the dummy cube(/UFO is a limb) was so the UFO could "tip" as it flew around (Zrotating the dummy object) without messing with the spinning (Yrotating the UFO limb). If you know of an easier way to achieve this I would love to see an example.


Quote: "after loading in my world i have found that i am moving too slowly."

One way would be to solve this would be to make your world smaller, and another way would be to multiply the MoveVert and MoveHoriz variables by a number higher than one.
Like:


The truth is that the code posted here was simply an example of how this could be acheved, but shouldn't be used directly in a project without modification.
One reason is that it uses curvevalue() which will produce different results on different machines unless you can guarantee that it will run at a specific framerate (this could be solved with some timer-based calculations). Another reason is that when the ship is moving diagonally it moves faster than it does when flying just left-right or up-down (this could be solved with some simple trig). The last reason is that it is a bit messy, and should be converted into functions.

Login to post a reply

Server time is: 2026-07-22 11:01:42
Your offset time is: 2026-07-22 11:01:42