0 votes

Hi, after a bit of advice or signposting to info to help with a (basic) flight physics question. Looking to re-create Biplanes (Amiga game) which has a side on small plane sprite (rigidbody2D) that has 4 controls of accelerate, decelerate, pitch up & pitch down.

I've done some basic implementation of thrust and torque etc. and the sprite does 'fly' in a fashion, but obviously displays no real or pseudo-flight characteristics. Ideally want something resembling flight for take-off speed, lift and stalling etc.

Looking for a bit of advice on sort of code to implement for this or signposting to any useful resources etc.

Thanks

G

Example Youtube video of original game

in Engine by (12 points)

1 Answer

0 votes

I have not played the game you are referencing, but Something to try:

Include a gravity vector on your player, force in the downward direction of -9.8. Verify gravity "works" (increases over time) before continuing.

put the player on the ground. player should not fall under the ground. So setup collision detection and response properly

next work on "takeoff": modify gravity based on speed
- when player is at zero speed, gravity is full force.
- when player is at "idle" speed, gravity is 0
- and interpolate gravity between the two speeds.
- i guess if you want lift, have gravity be negative above idle speed

for stall simulation, have the plane's forward vector rotate towards it's current velocity vector. change the speed of rotation by the velocity (so, faster plane rotates faster towards it's current velocity vector, slower plane rotates slower)

hope that helps.

by (220 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.