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.

Newcomers DBPro Corner / Realistic Spaceship movement

Author
Message
PresFox
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 16th Sep 2005 23:26
Hello

I have created a skysphere where a spaceship is flying inside, i added the controls, and it all works fine, but it feels like a toy, its absolutely not realistic

here is my controlling code:


how can i make this more realistic?

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Sep 2005 03:54 Edited at: 17th Sep 2005 05:01
How do you mean the controls are unrealistic? Do you need inertia?

As an aside, I attempted modelling the solar system once, but never got around to finishing it, (so some bits don't work). If interested, you can download it from:

http://www.computechtenerife.com/solarsystem.rar (4.5MB)

The + and - keys aren't implemented, but you can move around by holding down the left mouse button.

Tracking is ON by default and can be toggled by pressing the T key.



TDK_Man

PresFox
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 17th Sep 2005 10:18
well, at this moment im looking for a way to prohibit turning more then 45 degrees (so the ship cannot turn upside down)

and what is inertia?

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 17th Sep 2005 11:16
if its dbpro i've made a tutorial on sprite movement

http://forum.thegamecreators.com/?m=forum_view&t=60785&b=1

New game about to be unleashed steal un theif
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Sep 2005 16:15
Darkbasic MAD:

What on earth has this topic got to do with sprites?!

And, unless you've edited your post since I last looked at it, it's not so much a tutorial as a list of Sprite commands.

You need to take a look at the many tutorials on the forum and see what they do - give a command and explain in detail what each part of that command does. A good start, but not really a tutorial...

PresFox:

Inertia is where your ship moves in one direction and keeps on going when you take your 'foot off the gas'.

In space, there's no friction, so accellerating to a certain speed then turning off the power would result in maintaining that speed and direction even if you turned the ship in another direction.

Applying power in the new direction would move the ship in the new direction combined with the new one. Stopping involves applying the power in the opposite direction to the direction travelling.

Did you look at my solar system demo? It has inertia, but not the multi-direction type that I just mentioned.

TDK_Man

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 18th Sep 2005 20:35
i thought sprite controls might help to get the object to move but not tilt

New game about to be unleashed steal un theif
Medusa
21
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 25th Sep 2005 05:19
David Lawrence's limited flight demo may help
Regards

mpc

Attachments

Login to view attachments
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Sep 2005 05:26
I've released the source and media to my unfinished Solar System Demo if it's of any use to you. It's DBC code.

http://forum.thegamecreators.com/?m=forum_view&t=61145&b=7

TDK_Man

StevetS
20
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 30th Sep 2005 14:48
Did you get this sorted?

Looking at your code it looks like you've got a form or inertia/momentum included where your key stroke adds to an overall speed range. I normally set x and y ranges to say -10 to +10 and a key press simply increments or decrements the speed. That way trying to move in the opposite direction doesn't just stop your ship but gradually slows it down before turning.

Have you thought about gravity as well. Use a variable (as above) to constantly move the ship to the ground while your upward movement key negates this (ala Thrust, Oids or Virus on the Atari ST). Add in an acceleration variable so the longer the ship moves down the faster it falls (within a range). Gives a reasonable representation of gravity.
PresFox
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 30th Sep 2005 17:52
actually i will need this again soon,

gravity in space?

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds

Login to post a reply

Server time is: 2024-11-13 21:11:25
Your offset time is: 2024-11-13 21:11:25