Wonky Wheels

Wonky Wheels

by Dinosu

👁 1,179 ❤️ 137 ⭐ 111 🔄 1
Created: May 14, 2022 Last modified: May 30, 2022 Shared: May 14, 2022

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

Project thumbnail
View Project

Swarmulation v 2.0

by 1080GBA

Project thumbnail
View Project

TREEHOUSE ZOMBIE SURVIVOR 2- EVEN MORE ZOMBIER AND TREEHOUSIER

by Ghaztly97

Project thumbnail
View Project

Pink heart in the emoji band

by paumung2021

Project thumbnail
View Project

Windows 8 Crazy Error with Latvian

by nihaelmannukadan34

Project thumbnail
View Project

Henry Stickmin: Breaking The Bank l PLZ USE FORKPHOURUS

by Guest9999999

Project thumbnail
View Project

Beat up Scratch Cat v2.0 remix

by MeWantMobs

Project thumbnail
View Project

Hill Climb Racing 2 v.10.6 ( Mobile Friendly) remix-2

by sfa20106

Project thumbnail
View Project

I Am Bread - Mobile Friendly - Action Game - Adventure Game - Rage Game

by TheReal_BestGamer

Project thumbnail
View Project

Tom and Ben News Back on Television! v 2. remix

by jayjayy1809

Project thumbnail
View Project

NO VIACOM DON'T TURN ME INTO A MARKETABLE PLUSHIE remix

by ericktheguy2763

Project thumbnail
View Project

[SH2.5]史縫 現想逃避 ~ Reallity Girl

by AT-8

Project thumbnail
View Project

Five Nights At George's 2

by cmrhps1

Project thumbnail
View Project

Larrette FNF Test (My Version)

by -CirclyAnimateZ-

Project thumbnail
View Project

Untitled - 0.0937666

by harvey123344

Project thumbnail
View Project

Talking B

by Alfad2009

Project thumbnail
View Project

Face Raiders The Remake Stage 2

by ZooWeeMinecraft

Project thumbnail
View Project

Alpha Puzzles (SMG4 x Undertale)

by 1602_Animations

Project thumbnail
View Project

talking tom and ben news V2: edición ALL AND THE NEWS remix

by everton_trader

Project thumbnail
View Project

Add yourself/ your oc singing Sprites in the Night (0)

by Pup_Music

Project thumbnail
View Project

Cuphead Inkwell Isle V FULL GAME

by teodoraimarko

Project thumbnail
View Project

Geometry Dash Wave Practice 1

by Mark1431

Project thumbnail
View Project

Fleeing the Complex 2

by Lor888

Project thumbnail
View Project

The Story Button but it's Custom Mouseheadz

by ChefJ456

Project thumbnail
View Project

Outfit7 Films 1985 (fake) in G Major

by gamerboy1228