Wonky Wheels
by Dinosu
Instructions
β οΈ Too slow? Run the project on Turbowarp: https://turbowarp.org/690349930 Paste your save codes here: https://scratch.mit.edu/discuss/topic/604485/ ------ Instructions (also in project) ------ 1. Draw a wonky wheel shape between the two dashed rings, or load one of the examples. 2. Click and drag your mouse slowly across the dashed horizontal line, and then press "Generate." Watch as your wheel runs smoothly on a strange road! Generate a save code if you like! ------ Experiment ------ What happens when you try these shapes? - Long rectangle - Oval/ellipse - Random squiggle ------ Guide for remixers ------ - The broadcast event "get road" occurs when the user presses "Generate." - Most of the variables are set in the "get wheel" sprite. - The variables that do not change throughout the project are denoted in all capital letters. - "WHEEL CENTER X" and "WHEEL CENTER Y" are variables that define where the wheel is shifted. For instance, if you wanted the road to be high on the screen, you would set "WHEEL CENTER Y" to a large number. - The "axis" sprite is simply the black dot in the center of the wheel. - The "clouds" sprite is pretty self-explanatory if you want to add to it or remove it. ------ Math explanation ------ This is how the project works: 1. User creates a drawing. Some points in the drawing are stored in a list in which each index is the angle from the center of the wheel to the point, and the item at the index index is the distance from the center to the point. This is known as "polar coordinates," based on a radius and angle. 2. The project uses linear interpolation to smooth the user's drawing and fill in any gaps that weren't detected in the drawing stage. 3. The project "unravels" the user's wheel drawing in order to form a road that it will roll smoothly on. Specifically, each value in the list of radii of the wheel are subtracted from the height of the wheel's center so that the new point just skims the outside of the wheel. 4. The wheel is rotated by taking the first item of the list, appending it to the end, and then deleting the first item. ------ Credits ------ Thanks to @colinmacc for the suggestion to include save codes! Thanks to https://i.imgur.com/tpQa868.jpg for the formula I used to load the example polygons (polar equation for an n-gon).
Project Details
- Visibility
- Visible
- Comments
- Enabled
More Cool Projects
MUGEN Bluiguini Mayro Cuddle and SM128 Yoshi
by robertchaz64
Learn number Times tables! - numberblocks
by Dorianek1234567
The Shapeshifting Detective
by QueenSparkle88
Beat up evil p head
by tiguy2
random colors
by pjranimate
Henry Stickguy: Escaping the Jail
by DJ_CA_97
Coca-Cola Logo
by eliascape
Scratch Memes! REACTIONS!
by LankyBox789
Mixels intro recreated series 9
by Kingtyler04
talking tom and ben news ytp tennis (26 buttons) remix
by azoriad
Beat Up Uppercase Y (4)
by tiziland009
The Labyrinth Β» A Scratch Project || V. 1.2.1
by Feathers_McGraw
ζ₯ζ¬θͺηγγ©γΌγγγ€γ2D
by yuuu12
Dolby Digital Aurora (1999-2010s) logo remake
by studio989
Scratch Cat Beat Up! | v.2.08
by newmyles
γη‘δ½ζζ΅εγ
by DM-5032
Beat up Scratch Cat: Community Edition (All the Buttons) remix
by tatatino150again
Beat Up Chica 2 [8] remix remix remix
by bluesonic45
My numberblocks in Algodoo!
by Jereoics
[GG!Underfell] Sans fight
by kostya_strange
Clock
by AaronP_61
Closing to Dumbo (1941) 2020 Legoland DVD
by Gumball1034
Beat up Edward Premium Gold remix
by Menxtin
my effects kit remix-4
by juliescott12