View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Summer 2005 Milestone 1

Introduction

This project gives you some practice working with a number of skills you will need throughout this project: Squeak in general, Morphic, and basic simulations.

Ask questions here: Summer 2005 Milestone 1 Questions

Requirements

Make a class FunkyMorph that is a subclass of Morph. Your morph must have the following features:


All in all, you should implement the following methods:

Finally, you should implement a test case for your bar computations. Write a class method named testBarComputations that tests all of the following and does "self error:" if there are any problems:
  1. the barWidth changes depending on the number of bars and the size of the morph
  2. the position of the bars changes over time, and as the morph change size and position, and as the number of bars changes.
TA's will check this method; if they break your code, then the test should stop working.


Hints

DON'T PANIC! Do one step at a time. First get it to draw at all, then get it to redraw correctly when a different time is hard-coded, then get the time to increase slowly as time passes, etc.

The "Programming Morphs" tutorial can help you get started with morphic – it has everything you need to know. You can install it using a Universe browser ("open"... "Universes Browser")

You don't have to draw everything in drawOn:. You can, at your choice, stick other morphs in your morph (using addMorph:) and let them handle some of the drawing for you.

To draw the face, class EllipseMorph may be useful.

Any time you want the system to redraw your morph, you should do self changed.

The assignment does not tell you what instance variables to declare. You need to give your class one instance variable for each thing that the morph wants to "remember" over time...

step gets called at regular time intervals. If you want, you can use this to create your own clock that starts and stops as needed, and updates whenever step is called.

For Full Credit

You'll get most of the points as long as your funky morph is close. But to get a 100:
  1. Bars should not draw past the edge of the morph.
  2. You should correctly handle the fractional bars at the left and right edge of the morph; bars shouldn't just disappear when they get close to the right edge, or appear out of nowhere at the left edge.
  3. Give your class a class comment.
  4. Put your methods into method categories; don't put them all in "as yet unclassified".
  5. Give major methods a comment saying what they do. For long method, insert comments explaining what the code does.

Grading


Links to this Page