mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:09:46 +03:00
bded14a5068dc1e400eaa831eada10c4f27642ca
Value fwd_mps converts global velocity into a velocity vector which is rotated to cars local coordinate system (in this example x-axis). Then if key "ui_down" is pressed and the fwd_mps value is greater or equal to -1 (which seems to be very good spot and represents car still moving forward but nearly standing still) the car reverses (negative engine_force_value). If this condition isn't met (which means the car is moving forward) then the car brakes. Tested and working on Godot 3.1 Beta 3. Suggestions: In this case, if you want something more realistic, the -engine_force_value can be much lower because no car reverses in same speed as it goes forward but for the sake of demo project I left it as it is. Created for my own project with help of user wombatstampede from godotdevelopers.org/forum
Godot demo projects
Each folder containing a project.godot file is a demo project meant to
be used with Godot Engine, the open source
2D and 3D game engine.
Important note
- The
masterbranch is compatible with the latest Godot version (currently 3.0). - Use the appropriate branch for your Godot version, such as the
2.1branch for Godot 2.1.x.
Useful links
License
Those demos are distributed under the terms of the MIT license, as described in the LICENSE.md file.
Description
Languages
GDScript
89%
C#
9.4%
JavaScript
0.7%
GLSL
0.5%
Shell
0.2%
Other
0.2%