Scratch Zoom Project

Goal

Draw squares on the screen, each new square smaller than the previous one, until a minimum size is reached.

Requirements

  1. Scratch needs to start drawing squares on the outer edge of the screen
  2. Each square must be X size smaller than the previous square
  3. Squares must be centered, and not touching each other.
  4. Scratch needs to stop drawing when the smallest square is less than or equal to the minimum size.

Example 1

Steps

  • Move Scratch to outer corner.
  • Draw square
  • Check size – If size is smaller than smallest size, then stop.
  • Move Scratch to next starting point
    • X = X + space
    • Y = Y - space
  • Draw smaller square
  • Repeat

Problems

  • Different shapes will affect the “corner” of where Scratch starts out.
  • Might need to use sin/cos functions, but there aren't any currently?
    • Hmm. Might be too complicated for now? Naaah. Maybe just have Scratch turn X degrees before drawing the line.

Solutions

Might use “pen site” feature to fill in shapes as they're being drawn.

We need to compute the center of the polygon, so that the polygon appears centered.

There are a few ways to compute the center of the polygon. This gets really complicated, so I might see if there's a way to make Scratch find where the polygon touches the X axis, and then re-draw the polygon!

http://www.mathopenref.com/polygonincircle.html

http://www.mathopenref.com/polygonradius.html

See Also

Any Shape    
Custom Animation in Scratch %2008/%04/%29 %12:%Apr nate
Fish Catch %2008/%02/%14 %17:%Feb nate
Great Scratch Intro Program %2008/%11/%16 %00:%Nov nate
Programming Mentorship Ideas %2008/%05/%14 %09:%May nate
Scratch    
Scratch Catch %2008/%03/%02 %22:%Mar nate
Scratch Programming Class %2007/%08/%08 %00:%Aug nate
Scratch Zoom Project %2007/%09/%16 %23:%Sep nate
Sir Scratch    
Tic-Tac-Toe %2007/%11/%10 %06:%Nov nate
Turning the Beep Off %2008/%04/%29 %21:%Apr nate
 
scratch_zoom_project.txt · Last modified: 2007/11/27 23:45 by nate
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki