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
Mario Party 6 Mass Meteor plus mobile
by tkt201103
特效
by wish081209
Sesame street fight
by Luigisonic
UPDATE talking tom and ben news 9 V4 aded all hd remix remix-4 remix
by tomandbennews6
Add Your 2048 Tiles [Remix This!]
by MicrosoftFan576
GantaTheGamerFan2K9 (ME)'s Button For Beat Up Games
by GantaTheGamerFan2K9
Argam Clock remix
by PatrickRedOne
-<[{(Collabs)}]>- talking ben and ben news HD remix-2
by veziravcisi
BFDI: Branches (2024, AU)
by igor_is_cool
Storyshift Chara Themes
by CharaPlays
Beat up Scratch Cat 2 remix-2
by cs1692937
Beat up No-visor 5
by Rileyroo2011
234 player game tank 1 player mode [Scratch remake]
by phong2806
pokemon battle
by fuutt
kinako-cheese-blue's platformer engine (仮名称) ver.0.45α
by kinako-cheese-blue
Beat up Edward DLC remix-2
by FullandER2021
Chess
by connorschulz40
Bella fidget spinner
by 756221
Multiplayer Roblox Doors (Beta)
by games-coder
The endless Monsters show all characters remix-10
by Dejvid2115
Beat up Elmo XTRA!!
by WalFan13BoxinScratch
Uncanny Endless Numbers Band (11-20) remix
by muyyu174
FNF Test Engine Remade | V.3
by Sharkpeaceface2
Gray - Colorbox V10 [Incredibox]
by freepies