Wednesday, October 26, 2011

Work Progress - Oct 26 - Nov 1

Demo: "stable SB app" above

Work done
* Hide the timer when it is not necessary
* If angular increment < 5, show an error message.
* "On outside stage" event added to Skateboarder object. It is triggered when the skateboarder is outside the rectangle spanned by the points (minx, maxx) and (miny, maxy) of the Stage/Background object.
* Message similar to MIT Scratch: "Broadcast message" method, "Send meesage" method, "On Receive message", On Receive message From" event. Try to load this for a demo use case. When the skateboarder is outside the stage area, a "Stop" message is broadcast. When the stage receives the "Stop" message, it will stop the simulation.

Scripts for the skateboarder

Script for the stage

Wednesday, October 19, 2011

Work Progress - Oct 19 - Oct 25

Demo: "Stable SB app" above

Done:
* parameterized event codelet
Code example (SB.Skateboarder)
@AutomatableEventList(name="On key Pressed", desc="Fired when a key is pressed", argNames={"key"}, argDesc={""}, argTypes={"String"}, argVals={"a"})
public PEventList ekeyPressed = new PEventList(this);

One should provide one or more PEventInvokeVerifier to the PEventList to help the PEvent make use of the input arguments. In the above example, we add the following in the Skateboarder's constructor
ekeyPressed.AttachInvokeVerifier(new KeyPressedPEventInvokeVerifier());
where KeyPressedPEventInvokeVerifier implements IEventInvokeVerifier, the following method of which does the job.
public boolean VerifyInvoke(PEvent e, Object... params);

* (x1,y1) subscript, parentheses. For an AutomatableProperty, one can now use the additional DisplayName field to suggest the HTML-formatted field name shown in the InitialPropertyManager. If that DisplayName field is not specified, we will take the value specified in the name field. Also, the description field also supports the use of HTML tags to format.
@AutomatableProperty(name="x1,y1", DisplayName="x1, y1", desc="x1, y1", DesignTimeBehavior="B", RunTimeBehavior="H")
public String p1;

* timer - bigger, higher contrast

* Fix the bug that on switching between basic and advanced tab, the desc doesn't change accordingly.
* Fix the bug that traces of codelet are left behind when dragging the codelet in Scriptlet panel.

To do:
* Hide the timer when it is not necessary
* Pull-down selection codelet (detect when to hit boundary)
* Messaging as in MIT Scratch
* Disable various editing panels during simulation
* instantaneous change of display on changing starting values
* Tutorial info window
* Capability to access other objects' sensors and methods, perhaps with a pull-down menu
* not distort the aspect ratio when enlarging the view
* Changing window view angle -- with Jed
* fractal sketching tool -- combine the two versions

My own list:
* Implement AND/OR codelet
* Possible improved texture loading routine -- currently it seems every object keeps its own texture. Should make it class-wise.
* Procedure vs function
* moving is not smooth in scriptlet window

Tuesday, October 18, 2011

Work Progress - Oct 12 - Oct 18

* Upload doc to repository. Add link at the top of this blog.
* Continue working on introducing parameters to event codelet

Wednesday, October 5, 2011

Work Progress - Oct 5 - Oct 11

Demo: "Stable SB app" link above
Done:
* Fix the bug that the scripts of the selected object is not shown up on loading an XML file
* Fix the bug concerning ghost holder. The problem arose when one inserts a codelet into an empty conditional hold of a control codelet (e.g. if... then...). In that case, a ghost codelet holder was created, causing the problem.
* Implement read-only sensing properties (i.e. its value can't be modified by assignment statement). To specify a property to be a read-only property (instead of editable/assignable property), change the value assigned to RunTimeBehavior from "E" to "R" as shown below.
@AutomatableProperty(name="y", desc="y coordinate of current skateboarder position", DesignTimeBehavior="H", RunTimeBehavior="R")
public float m_y;
They are displayed as orange rectangles. Those read-only properties can be put in any rectangular holes, except the left hand side of any assignment statement.



* Add time sensing property for all objects. It is indeed from the engine's corresponding property in every simulation step.


TODO:
* parameters for event codelets
* messaging similar to Scratch
* pull-down menu to select sensing property, object name, etc