Skip to content

Add CostumeName support#8

Open
asareynolds wants to merge 1 commit intoDavidBuchanan314:mainfrom
asareynolds:main
Open

Add CostumeName support#8
asareynolds wants to merge 1 commit intoDavidBuchanan314:mainfrom
asareynolds:main

Conversation

@asareynolds
Copy link

This PR implements support for CostumeName handling in the SetCostume block.

COSTUME=costume)
def __init__(self, costume):
if isinstance(costume, (str, int)):
costume = core.Costume(costume)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think int is valid here? The goal of boiga is to only emit scratch code that could have been created manually.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch allows assignment of costume based on integers: try this for example

ScratchInt.png

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but you have to do it via a (() + (0)) block. I am open to supporting this in boiga but it needs to emit code that looks just like this.

@DavidBuchanan314
Copy link
Owner

Nice, could you add it to the example here too?

Say(CostumeNumber()),
#CostumeName(),

(uncomment and add say)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants