Port Pachinko to current plugin version #16
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This was mainly a direct reimplementation of each BlockCode program, with a few tweaks. I had to make the Ball group global so that it shows up in the “[something] is in group [group ▼]” dropdown. I also added an extra Reset method on the "Bump!" label to hide it when the game resets, calling it directly with "call [method] on [node]".
The code that plays one of 5 sounds at random when the ball hits a pin
previously relied on being able to pass an int as the "sound name" parameter,
which would for some reason I didn't bother digging into would previously cause
a str() conversion to be inserted, but now does not.
So instead I use a chain of conditionals that compiles to:
This is a bit wordier than what was there before but it works.
It would be nice to have a way to define a local variable rather than a
property of the node, but it's not the end of the world.
https://phabricator.endlessm.com/T35697