Closed benloh closed 1 year ago
added 5 commits
added 1 commit
marked this merge request as ready
@jdanish I think this is ready for testing/conversion.
added 2 commits
added 3 commits
@jdanish I've pushed the Movement prop fixes up too. Please see Movement in the main merge text for details.
added 3 commits
added 2 commits
dev-next
added 1 commit
added 1 commit
Touches were failing to register when costumes were flipped via scale because the calculated body width / height ended up as a negative value. This should now be fixed.
mentioned in commit db8bc42b7111d42462a77ece495b8538e107d1ce
Merges dev-bl/feat-simplify -> dev-next
THIS WILL BREAK SCRIPTS!
In order to simplify student use of features, we are converting most common feature calls to
featProp
references. Because these include some fundamental changes to the way Features are structured, we are not supporting backward-compatibility -- there's too much room for inadvertent interactions and we want to actively remove the old methods.Costume
setCostume
-- needs to be converted tofeatProp <agent>.Costume.costumeName setTo <file>
.setCostume
has been removed.setGlow
-- needs to be converted tofeatProp <agent>.Costume.glow setTo <seconds>
.setGlow
has been removed.Sizing and Scaling -- sizing and scaling is now done through the Costume feature -- you no longer need to use Physics. New properties:
colorize -- Most colorizing properties and methods are now only available as "expert" options (meaning they're faded by default in the wizard).
Physics
Sizing and Scaling -- Costume sizing is now all done through the Costume feature properties. Any references to the following Physics properties and methods should now use Costume's properties (
size
,width
,height
,scale
,scaleY
) instead:Props
agent.Physics.bodyRadius
agent.Costume.width
agent.Costume.height
agent.Costume.scale
agent.Costume.scaleY
Methods
featProp agent.Costume.width
andfeatProp agent.Costume.height
featProp agent.Costume.width
featProp agent.Costume.height
physics
bodyWidth
bodyHeight
bodyRadius
-- Physics by default uses the Costume size and scale to determine touches: whenever you set the costume size and scale, the private physics_body*
parameters will be updated. The_body*
properties are used by default when calculating touches. If you need physics to use a different body size, you can override the Costume sizes by setting the user-accessiblebodyWidth
bodyHeight
bodyRadius
properties. IF these are set, the system will use these values instead of the Costume values. These are considered "expert" properties and most users will never touch these.Physics no longer has any user-accessible methods. The methods that are in the system are mostly used by the Touches feature via private calls. We can make these methods user-accessible again if necessary (e.g.
intersects
).Movement
setMovementType
-- has been removed.All
setMovementType
calls should be replaced bymovementType
property setting:featProp agent.Movement.movementType setTo wander
featProp agent.Movement.movementType setTo stop
featProp agent.Movement.movementType setTo goLocation
featProp agent.Movement.movementType setTo setLocation
featProp agent.Movement.movementType setTo jitter
Additional parameters can be set for the movement type, e.g.
featProp agent.Movement.distance setTo 5
will set thewander
andgoLocation
speedwill set the location for
setLocation
andgoLocation
featProp agent.Movement.jitterDistance setTo 10
will set how violently to jitterqueueLocation
-- still works, but consider replacing thefeatCalls
with a property setting:featProp agent.Movement.movementType setTo goLocation
wanderUntilInside
-- in refactoring the other movement methods, we had to redo this one too. This call should be replaced with:The other seek and random position methods remain featCalls due to their complexity.
Some example GEMSCRIPT to use for testing
Population
The Population feature has a small set of commonly used props and methods, and a larger set of expert props and methods. We're leaving these alone for the most part. A rewrite would be rather involved and deeply affect Moth scripts. The simple solution is to move most props and methods to the faded "expert" selection and leave a few of the more common props and methods more visible.
Improved student support will mostly be in Script Cookbook and Script Reference rewrites.
Vision
The whole Vision feature is an advanced feature. We'll move it to the faded expert section and leave the props and methods.
Cursor
The Cursor feature is also an advanced feature. We could make a case that it should not appear and be editable at all, but
Cursor
itself needs to be visible so students can enable it as a feature. The Cursor feature wizard-editable has no properties or methods.Under the Hood
featProp
error managementBecause of the changes to feature methods and properties, it's easy to end up with bad scripts. Currently the system is blindly catching errors to enable users to still load and update bad projects, but the error catching is not providing very useful feedback. So
featProp
has some temporary error management to better report problem lines, e.g. if there is a reference to a non-existent feature property.