Squeak Class Documentation category index | class index  
 
BlobMorph
  category: Morphic-Demo
  superclass: PolygonMorph
  subclasses: BlobMPEGMorph

The Blob was written by David N Smith. It started out as a simple test of the CurveMorph and ended up as an oozing, pulsating, repulsive mess which will wander across your screen until killed. Each instance has its own rate of oozing, so some are faster than others. It's not good for anything.

Try:
BlobMorph new openInWorld

15 Jan 2000 by Bob Arning, a change so that the blob tries to be a color like the color under itself.
16 Jan 2000 by David N Smith, added blob merging: if two blobs meet then one eats the other.
18 Jan 2000
by Sean McGrath, smother color changes.
06 Feb 2000 by Stefan Matthias Aust, refactoring and support for duplication, dragging and translucent colors.

instance methods
  copying
  veryDeepCopy

  debug and other
  installModelIn:

  geometry
  setConstrainedPosition:hangOut:

  geometry testing
  containsPoint:

  initialization
  initialize
initializeBlobShape
initializeColor
initializeToStandAlone
maximumVelocity
setVelocity

  stepping
  adjustColors
bounceOffWalls
limitRange:
mergeBlobs
mergeSelfWithBlob:atPoint:
oozeAFewPointsOf:
selfPolarPointRadius:degrees:
step
stepTime

  submorphs-add/remove
  delete

class methods
  initialization
  descriptionForPartsBin

  instance creation
  new

  instance remembering
  delete:
remember:

instance methods
  copying top  
 

veryDeepCopy

Do a complete tree copy using a dictionary. An object in the tree twice is only copied once. All references to the object in the copy of the tree will point to the new copy.


  debug and other top  
 

installModelIn:

Overwritten to not add handles to the receiver.


  geometry top  
 

setConstrainedPosition:hangOut:

Deal with dragging the blob over another blob which results in spontaneous deletations.


  geometry testing top  
 

containsPoint:


  initialization top  
 

initialize


 

initializeBlobShape


 

initializeColor


 

initializeToStandAlone

Override PolygonMorph's version


 

maximumVelocity


 

setVelocity


  stepping top  
 

adjustColors

Bob Arning <arning@charm.net>


 

bounceOffWalls

Change sign of velocity when we hit a wall of the container


 

limitRange:

limit radius to range 20-120; limit interpoint angle to surrounding angles with max of twice of average separation.


 

mergeBlobs

See if we need to merge by checking our bounds against all other Blob
bounds, then all our vertices against any Blob with overlapping bounds.
If we find a need to merge, then someone else does all the work.


 

mergeSelfWithBlob:atPoint:

It has already been determined that we merge with aBlob; we do all the work here.


 

oozeAFewPointsOf:

change some points at random to cause oozing across screen


 

selfPolarPointRadius:degrees:

Same as Point>>#r:degrees: in Point class except that x and y are not truncated to integers


 

step

Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.


 

stepTime

Answer the desired time between steps in milliseconds.


  submorphs-add/remove top  
 

delete

Remove the receiver as a submorph of its owner and make its new owner be nil.


class methods
  initialization top  
 

descriptionForPartsBin

If the receiver is a member of a class that would like to be represented in a parts bin, answer the name by which it should be known, and a documentation string to be provided, for example, as balloon help. When the 'nativitySelector' is sent to the 'globalReceiver', it is expected that some kind of Morph will result. The parameters used in the implementation below are for documentation purposes only!


  instance creation top  
 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


  instance remembering top  
 

delete:


 

remember: