Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit afda389

Browse filesBrowse files
committed
Add "point in direction" (absolute rotation block)
1 parent 4bfb6ef commit afda389
Copy full SHA for afda389

File tree

Expand file treeCollapse file tree

4 files changed

+5
-2
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+5
-2
lines changed

‎assets/project.json

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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"}}
1+
{"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"}}

‎config.py

Copy file name to clipboardExpand all lines: config.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Project file name
2626
# If in test mode, set the Scratch project file to load.
27-
projectFileName: str = "projects/Rotation2-medium.sb3"
27+
projectFileName: str = "projects/AbsoluteRotation.sb3"
2828

2929
# Download cache size
3030
# Number of recent downloaded projects stored. 0 means infinity.

‎projects/AbsoluteRotation.sb3

Copy file name to clipboard
29.4 KB
Binary file not shown.

‎scratch.py

Copy file name to clipboardExpand all lines: scratch.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ def execute(block, s, events=eventContainer.EventContainer()):
252252
elif opcode == "motion_turnright": # turn cw () degrees
253253
s.setRotDelta(float(block.getInputValue("degrees", eventContainer=events)))
254254

255+
elif opcode == "motion_pointindirection": # point in direction ()
256+
s.setRot(float(block.getInputValue("direction", eventContainer=events)))
257+
255258
elif opcode == "control_wait": # wait () seconds
256259
block.screenRefresh = True
257260
if not block.waiting:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.