aroberge / reeborg

Enhanced Karel-the-robot clone
http://reeborg.ca/reeborg.html
Other
47 stars 36 forks source link

frame callback #327

Closed aroberge closed 7 years ago

aroberge commented 7 years ago

Add a new method, something like RUR.register_frame_callback(fn), which would enable a single function to be called when a frame is recorded. This function, which should only be called when a frame is being recorded, should likely be executed as follows:

recordings(false)
callback()
recordings(true)

Similarly, show how one can redefine an exception to do something else (e.g. showing an animation if a wall is hit). It might be helpful to record the robot id which caused the exception so that it is available.