Skate game prototype in Godot
Textures by https://www.kenney.nl/
Characters are based on low res metahuman characters by EPIC Games.
I tried to keep most function self explainatory
Keeps track of the current player movement state and changes the state based on conditions.
Executes raycasts for the ground and the current movement direction.
Returns the tangent of a path at a specific point.
Returns the direction along the path.
Returns the position on a curve based on the current location.
Returns the offset value of the curve. A value between 0 and the curve length.
Returns true of the player should be attached to a curve, false if the player leaves the curve.
Calculates the upvector.
Interpolates the visible player transform to avoid jittery motion because of lowres colliders.
Falling logic.
Resets the player to the starting location, resets all player values.
Read and map inputs.
Controls the animtree.
Removes orthogonal velocity of the player.
Removes orthogonal velocity on a pipe.
Aligns the player with the groud.
Speed limit.
Turns the player to follow the movement direction.
Ground movement logic.
Air movement logic.
Movement logic while snapped to a pipe.
Grinding movement logic.
Lip movement logic.
Randomize balance direction.
Initialize the player.
Checkup to execute the revert motion function.
Checkup if the player bounces off a wall while grinding.
Checkup if the player bounces off a wall.
###_debug_player_state() Prints debug infos.
Timer function to get the time since the last jump.
Returns forward component of velocity.
Raycast function.
Checks if the player should fall.
Park setup runs only in the editor. It requires 3d models as packed gltf scenes.
Select a packed gltf-scene in the editor and run the script.
- assetname_Col_Pipe -> Pipe collision
- assetname_Col_Floor -> Floor collision
- assetname_Col_Wall -> Wall collision
There can only be one of those 3 collision meshes inside of a packed scene. Concave colliders are created for each mesh. Keep them simple.
- assetnameRailX -> Rail line
Used to create rails, there can be multiple rails inside of one packed scene. Each rail needs a unique identifier. For example A,B,C etc. Rails need to be created as polylines. You need to take care of the vertex order.
To order the vertices you can convert the polyline to a curve and then back to a mesh in blender. This will order vertices based on connectivity.