ScratchData LogoScratchData
Back to kriblo_test's profile

Example: Bezier curves to move and turn

KRkriblo_test•Created March 19, 2024
Example: Bezier curves to move and turn
62
50
504 views
View on Scratch

Instructions

This is an example of how Bezier curves can be used to calculate a path from one position to another. Thus, it is not a game! I only used the "parking scenario" because I couldn't think of a better example ;) Click on a parking lot to try it out. See inside to learn how it works. Code in Car sprite. Stop the project to show the thumbnail, which is also a visual aid: - P1 is the starting point, the position of the current parking lot. - H1 is the Bezier handle pointing away from P1. - P2 is the position of the destination parking lot. - H2 is the handle pointing away from P2. - The length of the Bezier handles determine the "turning radius" in this example. Click the button at the bottom left to toggle Bezier curve illustration (thank you @s_federici for the suggestion). The car costume was made by @papipupepappa: https://scratch.mit.edu/projects/577186108/ All code by me (@kriblo). Code in this example is optimized for readability.

Project Details

Project ID985451214
CreatedMarch 19, 2024
Last ModifiedMarch 20, 2024
SharedMarch 19, 2024
Visibilityvisible
CommentsAllowed