Report as inappropriate.
This is an example (with some re-usable classes) of safely implementing actor logic in "sequences" - threads which regularly give up control via method call.
A ThreadActor can have one or more sequences, and in the act() method it processes each sequence. The sequence does whatever it wants to do and then calls waitForNextSequence() to relinquish control to the next sequence (or actor).
The example uploaded here shows an actor with two sequences: one which moves it, and another which rotates it.
To embed this scenario in a web page, copy the following HTML code:
Want to leave a comment? You must first log in.
No votes yet.