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

Beat up TVOKids Q UTTP THDTC and his flip buddies (2) remix

by jace1809

Project thumbnail
View Project

Add Yourself Singing Secrets

by zahbigboi7656898

Project thumbnail
View Project

Galaxy Note9 Crazy Error Maker (One UI2.1)

by WindowsAstron

Project thumbnail
View Project

numberblocks beyond infinity remix

by maldives06

Project thumbnail
View Project

Beat Up Dennison: Ultimate Edition AND BEST GAME EVER!!!!!!!!!!!!!!

by the_number_is_567

Project thumbnail
View Project

SDC: Reboot - Ch1 Pt1 (Bnnuy's Smol Fwenzy)

by Newaccount5678

Project thumbnail
View Project

talking tom and ben news ohio 3 v0.1 remix-3 remix remix-5

by kuponoIs

Project thumbnail
View Project

Super Mario: The ABC Song from ABC No Utau Video! remix-2 remix

by Seankalnizki

Project thumbnail
View Project

Windows 7 Ultimate

by WinXP_Fan

Project thumbnail
View Project

Beat up Dog Man! (10)

by newmyles

Project thumbnail
View Project

BEAT UP MR. FUN COMPUTER'S FAMILY!!!!!!!!!!!!!!!! remix remix

by elevatorfan1978

Project thumbnail
View Project

Nickelodeon Creatures Text Engine 9.2

by SmartBear10

Project thumbnail
View Project

Klasky Csupo Assets (see inside)

by carternh

Project thumbnail
View Project

[BIGSHOT] Simulator V1.01 - (Spamton NEO Fight)

by Frobula

Project thumbnail
View Project

Jsab is fun

by squaretone

Project thumbnail
View Project

(Wii) Disc Channel (With Homebrew)

by Gabi2012TheCreator

Project thumbnail
View Project

Beat up stickman another new mini update

by bennybean07

Project thumbnail
View Project

Fidget Spinner X

by 4baker10

Project thumbnail
View Project

カービィ大戦争「モバイル対応」Kirby Great War

by nendo-ru

Project thumbnail
View Project

Dateblocks Band 24 (Aidans Version)

by AidanScratchMaker

Project thumbnail
View Project

Smoke Flow Simulation

by SpicyMelon

Project thumbnail
View Project

Sad Scratch Cat Test (MOBILE SUPPORT)

by SunnyGamer665

Project thumbnail
View Project

Hill Climb Racing v6.4 remix

by na34590

Project thumbnail
View Project

My take of Czech Alphabet Lore

by NJsaurus