Noticed a lot of error spat out because of unnormalized basis.
I simply followed the suggestion to use get_rotation_quat() instead of using constructor of Quat(x).
We used to broadcast player info on connect and have the server relay it
to other clients.
With this approach, each peer (including server) sends its own info once
to other peers as soon as they connects.
When a new player connects, it is notified of all the already connected
peers by the `network_peer_connected` signal.
Any already connected peer is also notified of the newly connected peer
by the same signal.
Gravity vector is zero in the first few frames, leading to errors in follow-up calculations expecting a normalized vector. Fixed by assigning a default gravity in case those cases.
* 2d/physics_platformer works flawlessly on Godot 3.1 beta 8
* fix warnings for inferred node type
* every script has a class_name
* formatted code for better clarity
* each files has its own subfolder
* bullet collisions and shooting have to be executed from call_deferred
* PascalCase naming for nodes
* 2d/platformer works flawlessly on Godot 3.1 beta 8
* fix warnings for inferred node type
* every script has a class_name
* formatted code for better clarity
* each files has its own subfolder
* As suggested by @akien-mga
* states are back to const instead of enum
* class_name comes after extends
* better code style
* PascalCase for nodes
Opened them, saved all scenes, ran the project. Did necessary fixes here and there,
fixed some warnings (but some remain in bigger demos).
Did not port JRPG demo yet (#306) nor the two platformer demos.
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