diff --git a/assets/project.json b/assets/project.json index 815f7bd..b4a7e06 100644 --- a/assets/project.json +++ b/assets/project.json @@ -1 +1 @@ -{"targets":[{"isStage":true,"name":"Stage","variables":{},"lists":{},"broadcasts":{},"blocks":{},"comments":{},"currentCostume":0,"costumes":[{"name":"xy-grid","bitmapResolution":1,"dataFormat":"svg","assetId":"4851f7b71585efa5d42cb3a0b2d5fadf","rotationCenterX":239.99996948242188,"rotationCenterY":180.00003051757812}],"sounds":[],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":"ro"},{"isStage":false,"name":"Cat 2","variables":{},"lists":{},"broadcasts":{},"blocks":{"?^q)qSDL?G9M_{|/iKKo":{"opcode":"event_whenflagclicked","next":"{$QhU(~Y{qa/r`=G{mGX","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":300,"y":340},"{$QhU(~Y{qa/r`=G{mGX":{"opcode":"control_repeat","next":null,"parent":"?^q)qSDL?G9M_{|/iKKo","inputs":{"TIMES":[1,[6,"12"]],"SUBSTACK":[2,"hqsMZs4WIfY8fR:Z$[V0"]},"fields":{},"shadow":false,"topLevel":false},"hqsMZs4WIfY8fR:Z$[V0":{"opcode":"motion_turnright","next":null,"parent":"{$QhU(~Y{qa/r`=G{mGX","inputs":{"DEGREES":[1,[4,"15"]]},"fields":{},"shadow":false,"topLevel":false}},"comments":{},"currentCostume":0,"costumes":[{"name":"cat 2","bitmapResolution":1,"dataFormat":"svg","assetId":"b19faf9c49fb425c52756c2b229f08cb","md5ext":"b19faf9c49fb425c52756c2b229f08cb.svg","rotationCenterX":128.79883,"rotationCenterY":36.221843067841604}],"sounds":[{"name":"meow2","assetId":"cf51a0c4088942d95bcc20af13202710","dataFormat":"wav","format":"","rate":44100,"sampleCount":26048,"md5ext":"cf51a0c4088942d95bcc20af13202710.wav"}],"volume":100,"layerOrder":1,"visible":true,"x":0,"y":0,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"}],"monitors":[],"extensions":[],"meta":{"semver":"3.0.0","vm":"1.5.48","agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"}} \ No newline at end of file +{"targets":[{"isStage":true,"name":"Stage","variables":{},"lists":{},"broadcasts":{},"blocks":{},"comments":{},"currentCostume":0,"costumes":[{"name":"xy-grid","bitmapResolution":1,"dataFormat":"svg","assetId":"4851f7b71585efa5d42cb3a0b2d5fadf","md5ext":"4851f7b71585efa5d42cb3a0b2d5fadf.svg","rotationCenterX":239.99996948242188,"rotationCenterY":180.00003051757812}],"sounds":[],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":"ro"},{"isStage":false,"name":"Cat 2","variables":{},"lists":{},"broadcasts":{},"blocks":{"?^q)qSDL?G9M_{|/iKKo":{"opcode":"event_whenflagclicked","next":"}l[bKZnw-AEF;s1PwWnH","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":300,"y":340},"}l[bKZnw-AEF;s1PwWnH":{"opcode":"control_forever","next":null,"parent":"?^q)qSDL?G9M_{|/iKKo","inputs":{"SUBSTACK":[2,"*p+AjP1@8x!|)0=-WRd0"]},"fields":{},"shadow":false,"topLevel":false},"*p+AjP1@8x!|)0=-WRd0":{"opcode":"motion_pointindirection","next":"GTgrP{t^I,0POk;iBL2|","parent":"}l[bKZnw-AEF;s1PwWnH","inputs":{"DIRECTION":[3,"_:Fh9,Ie4..HS/zo)#Tf",[8,"90"]]},"fields":{},"shadow":false,"topLevel":false},"_:Fh9,Ie4..HS/zo)#Tf":{"opcode":"operator_random","next":null,"parent":"*p+AjP1@8x!|)0=-WRd0","inputs":{"FROM":[1,[4,"-180"]],"TO":[1,[4,"180"]]},"fields":{},"shadow":false,"topLevel":false},"GTgrP{t^I,0POk;iBL2|":{"opcode":"control_wait","next":null,"parent":"*p+AjP1@8x!|)0=-WRd0","inputs":{"DURATION":[1,[5,"0.5"]]},"fields":{},"shadow":false,"topLevel":false}},"comments":{},"currentCostume":0,"costumes":[{"name":"cat 2","bitmapResolution":1,"dataFormat":"svg","assetId":"b19faf9c49fb425c52756c2b229f08cb","md5ext":"b19faf9c49fb425c52756c2b229f08cb.svg","rotationCenterX":128.79883,"rotationCenterY":36.221843067841604}],"sounds":[{"name":"meow2","assetId":"cf51a0c4088942d95bcc20af13202710","dataFormat":"wav","format":"","rate":44100,"sampleCount":26048,"md5ext":"cf51a0c4088942d95bcc20af13202710.wav"}],"volume":100,"layerOrder":1,"visible":true,"x":0,"y":0,"size":100,"direction":-150,"draggable":false,"rotationStyle":"all around"}],"monitors":[],"extensions":[],"meta":{"semver":"3.0.0","vm":"1.5.68","agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"}} \ No newline at end of file diff --git a/config.py b/config.py index 687c14f..3c3d640 100644 --- a/config.py +++ b/config.py @@ -24,7 +24,7 @@ # Project file name # If in test mode, set the Scratch project file to load. -projectFileName: str = "projects/Rotation2-medium.sb3" +projectFileName: str = "projects/AbsoluteRotation.sb3" # Download cache size # Number of recent downloaded projects stored. 0 means infinity. diff --git a/projects/AbsoluteRotation.sb3 b/projects/AbsoluteRotation.sb3 new file mode 100644 index 0000000..733a624 Binary files /dev/null and b/projects/AbsoluteRotation.sb3 differ diff --git a/scratch.py b/scratch.py index d174307..33312e7 100644 --- a/scratch.py +++ b/scratch.py @@ -252,6 +252,9 @@ def execute(block, s, events=eventContainer.EventContainer()): elif opcode == "motion_turnright": # turn cw () degrees s.setRotDelta(float(block.getInputValue("degrees", eventContainer=events))) + elif opcode == "motion_pointindirection": # point in direction () + s.setRot(float(block.getInputValue("direction", eventContainer=events))) + elif opcode == "control_wait": # wait () seconds block.screenRefresh = True if not block.waiting: