That’s right, the Director 2 Simple Factory example now runs in ScummVM (with some modifications to account for broken button rendering)! I had to implement several Lingo features for this movie, but the most important is, of course, factories, which are essentially Lingo’s first iteration of object-oriented programming.
For example, here’s a snippet from the ballBoy
factory used in this movie:
factory ballBoy
method mNew n, entry
instance ballNum, spriteNum, count, entryNum
set entryNum = entry
set count = 0
set ballNum = n
set spriteNum = n + 1
When the button in the bottom-right corner is clicked, a new ballBoy
object is created and associated with a ball sprite. This object becomes the control center of the sprite, giving it logic that keeps track of how many times it’s been clicked, changing its appearance, and allowing it to be dragged around.
Factories are used extensively throughout Spaceship Warlock, so now that they’re implemented, I’ll be working directly on that game in the near future.
Besides factories, this week I implemented numerous event-handling features, and I discovered and fixed a bug that prevented certain scripts in Director 2 and 3 movies from being loaded. This caused a horrifying amount of unhandled Lingo syntax in The Journeyman Project to suddenly reveal itself:
Luckily, sev has now fixed all of those errors.
Onward to more Lingo!
Leave a Reply