v0.1.0-alpha.3
Pre-release-
This is the fourth early alpha weekly release of PicoTurtle. It contains several minor changes/fixes and one major feature.
-
The fern drawing sample program in the README.md file is updated.
-
The Box and BoxTurtle lua classes now optionally check the bounds for each movement of the turtle. The option is supplied in the constructor. If check_bounds is enabled the BoxTurtle keeps the turtle moving only inside the box. Any move taking the turtle outside the box is invalid and has no effect.
-
To enable gameloop like mechanics for some turtle programs the following methods are added to the turtle API:
elapsed_time_ms
- Gives the total time in millis since the turtle was constructed.paint
- Explicitly calls the paint callback if specified. This should be used to paint the turtle on the UI canvas.delay
- Add an explicit delay to the turtle to slow it down. This calls the delay callback if specified. In non-interactive runs this method can be ignored - by not providing a callback to implement it.update
- A function which calls the update callback whenever the state of the turtle changes. This helps the UI take some actions when the turtle is modified.
-
The major feature added in this release is the Lua Repl Widget in the UI. This widget is based on the code in lua.c of lua5.4 and implements an interactive lua console. Currently the turtle is not enabled in this console. In the next release turtle launches and interaction will be added to this widget.