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

Add a button to Beat up Bendy (5)

by Mugtoff

Project thumbnail
View Project

(scrapped)Add yourself singing: Come Out To Play (Tommot engine!1)

by reallygoodgamer140

Project thumbnail
View Project

robo Kitty is mad and nonny187 remix

by tinathemagnificent88

Project thumbnail
View Project

Talking tom fans be like:

by thealtman341

Project thumbnail
View Project

Blue Shirt Dance ft. Nano and Li'l Petey

by TSEGifted1

Project thumbnail
View Project

-Trinity Encore- (FNF VS Rewrite ROUND 2

by sweetapie8

Project thumbnail
View Project

Beat Up Sonic Again (2023 Remastered) remix remix

by doddwell

Project thumbnail
View Project

Opening To happy blam And Balloon 2009 DVD

by kirbyguy200

Project thumbnail
View Project

Space Sphere

by hugmyster

Project thumbnail
View Project

Geometry Dash Megalodon

by iPhone_ATT_TWC115

Project thumbnail
View Project

Cuphead Aviary Action in scratch カップヘッド

by keichandesu

Project thumbnail
View Project

FNF - (Mid-Fight-Masses) REMAKE

by Bradk2005

Project thumbnail
View Project

(UNFINISHED) Super Mario World

by Brad-Unfinished

Project thumbnail
View Project

Remix & Ruin Yakka Dee remix

by On_Beyond_Zebra139

Project thumbnail
View Project

新頭脳アタノワァルヒト

by kekelolo

Project thumbnail
View Project

4 Player Battle | Cloud

by besameier

Project thumbnail
View Project

Friday Night Funkin' mobile (Buggy)

by main_thing

Project thumbnail
View Project

脱出ゲーム2

by aoi1011

Project thumbnail
View Project

FNF Test Playground

by Bananarileyboy4

Project thumbnail
View Project

add a button to beat up the weird scratch cat (1)

by newmyles

Project thumbnail
View Project

(2D/3D) multistyle for GentleX (feat. wolther, crystal-25, top5intros, and MORE)

by -savior-

Project thumbnail
View Project

Spasmodic

by btta2012s

Project thumbnail
View Project

Beat up Dirty P-head 2022 (Remaster) remix

by Lojojo1929

Project thumbnail
View Project

☁️scratch vibe☁️

by walmart-employ33