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

Spanish Alphabet Lore - The Prolouge!

by thethecreator2ndacc

Project thumbnail
View Project

Fnati vector's 2015 version's v1.1

by geutomy

Project thumbnail
View Project

Sonic the Hedgehog Level Maker

by tails_the_epic

Project thumbnail
View Project

My Angry Birds Classic AU Cutscenes Sketches remix

by scribbles-lol

Project thumbnail
View Project

Beat Up Stickman Extreme remix remix

by XXULOS59

Project thumbnail
View Project

Windows xp

by alman14032017

Project thumbnail
View Project

Minecraft 3D v1.18 remix

by a-minecraft_lover

Project thumbnail
View Project

Ball Blast! - v3.00

by -Fusion_Games-

Project thumbnail
View Project

Geometry Dash - Theory of Everything remix remix

by ToLor

Project thumbnail
View Project

TurboWarp Keypress Detector

by MiniCoder11

Project thumbnail
View Project

BEAT UP PROTO!!!! remix remix

by devin578

Project thumbnail
View Project

Ball Physics Ball-to-ball collisions - Attempt 1

by Haluria_games

Project thumbnail
View Project

Weird Tower - Full Of Bosses [Part 1]

by Robik2019

Project thumbnail
View Project

Geometry Dash Cursed Bonfire

by JohnDaTank

Project thumbnail
View Project

Add Button To beat up Scratch Cat remix

by cleverkids06

Project thumbnail
View Project

osu! Full Remake

by SpiritSK

Project thumbnail
View Project

Black Hole Add Round 2 remix-2

by Linesta

Project thumbnail
View Project

Beat up alpha

by paata27747438

Project thumbnail
View Project

click the only button to beat up cat! remix

by RafaelCardoso2016

Project thumbnail
View Project

Emerald Pingu Error: 4th Of July 2023

by DanielSapinho9IsBack

Project thumbnail
View Project

My Algodoo Numberblocks

by the6689coding

Project thumbnail
View Project

Beat Up Tora DLC Remastered! V.3.0

by rsresreatrs

Project thumbnail
View Project

THE COOL VERSION of beat up scratch cat

by thunderbird3458

Project thumbnail
View Project

Marvin Martian Cartoon Intro and Outro (CinemaScope)

by PeppaDoesScratch