[ENH] PolygonFactory

Markus Gaelli gaelli at emergent.de
Wed Apr 23 09:18:57 UTC 2003


from preamble:

"Change Set:		PolygonFactory
Date:			20 April 2003
Author:			Markus Gaelli

Did you ever want to paint polygons out of the traces of your EToy-cars?

Now it's possible.
Just drop a polygon in the world, open a viewer on it, select the
category 'Miscellaneous'.
Here you can select between two new options: - setVertexFromPositionOf:
dot
With this one you can initialize your polygon to have only one point,
that is the current position of the player (replace 'dot' with the tile
of your player / car)
- addVertexFromPositionOf: dot
Use this one if you want to add a new point to your polygon, which is
the current position of the player (again replace 'dot' with the tile of
your player, probably somewhere after you just moved it a bit...)

Attention, this is not yet programmed in a very object-oriented way, as
I actually extended Player with methods like
Player >> 
	addVertexFromPositionOf: aPlayer
	(self costume isKindOf: PolygonMorph) ifTrue:
		[self costume addVertexFromPositionOf: aPlayer costume]

Can anyone tell me, how this could be done in a cleaner way?
I didn't find much subclasses of Player, so I was wondering..."!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PolygonFactory.cs.gz
Type: application/octet-stream
Size: 1051 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030423/a79e7a5c/PolygonFactory.cs.obj


More information about the Squeak-dev mailing list