New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PoemBot][HOC] Validation Code #42243
Conversation
@@ -36,7 +36,8 @@ | |||
"hide_pause_button": "false", | |||
"instructions_icon": "poet", | |||
"callout_json": "[\r\n {\r\n \"localization_key\": \"poetry_background\",\r\n \"callout_text\": \"Find code blocks here. \",\r\n \"element_id\": \"[id=':1.label']\",\r\n \"on\": \"\",\r\n \"qtip_config\": {\r\n \"codeStudio\": {\r\n \"canReappear\": false,\r\n \"dropletPaletteCategory\": \"\"\r\n },\r\n \"style\": {\r\n \"classes\": \"\"\r\n },\r\n \"position\": {\r\n \"my\": \"left center\",\r\n \"at\": \"right center\",\r\n \"adjust\": {\r\n \"x\": 0,\r\n \"y\": 0\r\n }\r\n }\r\n }\r\n }\r\n]", | |||
"preload_asset_list": null | |||
"preload_asset_list": null, | |||
"validation_code": "var validationInfo = getValidationInfo();\r\nif (validationInfo.backgroundEffect) {\r\n setSuccessFrame();\r\n}\r\ndrawProgressBar();\r\nif (World.frameCount == validationInfo.endTime) {\r\n if (validationInfo.successFrame) {\r\n levelFailure(0, 'genericSuccess');\r\n } else {\r\n levelFailure(3, 'poemBotMakeBackground');\r\n }\r\n}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -36,7 +36,8 @@ | |||
"instructions_icon": "poet", | |||
"callout_json": "[]", | |||
"parent_level_id": 29611, | |||
"preload_asset_list": null | |||
"preload_asset_list": null, | |||
"validation_code": "var validationInfo = getValidationInfo();\r\nif (validationInfo.foregroundEffect) {\r\n setSuccessFrame();\r\n}\r\ndrawProgressBar();\r\nif (World.frameCount == validationInfo.endTime) {\r\n if (validationInfo.successFrame) {\r\n levelFailure(0, 'genericSuccess');\r\n } else {\r\n levelFailure(3, 'poemBotMakeForeground');\r\n }\r\n}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -40,6 +40,7 @@ | |||
"encrypted_examples": [ | |||
|
|||
], | |||
"validation_code": "var validationInfo = getValidationInfo();\r\nvar spriteIds = getSpriteIdsInUse();\r\n\r\nif (spriteIds.length > 0) {\r\n setSuccessFrame();\r\n}\r\ndrawProgressBar();\r\nif (World.frameCount == validationInfo.endTime) {\r\n if (validationInfo.successFrame) {\r\n levelFailure(0, 'genericSuccess');\r\n } else {\r\n levelFailure(3, 'noSprites');\r\n }\r\n}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -39,7 +39,8 @@ | |||
"preload_asset_list": null, | |||
"encrypted_examples": [ | |||
|
|||
] | |||
], | |||
"validation_code": "var validationInfo = getValidationInfo();\r\nvar spriteIds = getSpriteIdsInUse();\r\n\r\nfor (var i = 0; i < spriteIds.length; i++) {\r\n if (getProp({id: spriteIds[i]}, \"scale\") !== 100) {\r\n setSuccessFrame();\r\n }\r\n}\r\n\r\ndrawProgressBar();\r\nif (World.frameCount == validationInfo.endTime) {\r\n if (validationInfo.successFrame) {\r\n levelFailure(0, 'genericSuccess');\r\n } else if (spriteIds.length == 0) {\r\n levelFailure(3, 'poemBotRemovedSprite');\r\n } else {\r\n levelFailure(3, 'poemBotSetSize');\r\n }\r\n}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - thanks for adding the screenshots - made it a lot easier to review!
First few levels of validation code. Technically the level validation code could be written directly on Levelbuilder, but I did it on localhost so that I could add translation strings and library hooks at the same time.
I added screenshots of the validation code for each level since the string diff is hard to review.
With editing levels on localhost, there's potential for merge conflicts with the DTL, but if they come up, they should be easy to resolve since Amy is not editing the
validation_code
field on these levels.