Skip to content

Commit eb83e1e

Browse files
committed
Some more work
1 parent 48b1d00 commit eb83e1e

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

assets/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"targets":[{"isStage":true,"name":"Stage","variables":{"`jEk@4|i[#Fk?(8x)AV.-my variable":["variabila mea",0]},"lists":{},"broadcasts":{},"blocks":{},"comments":{},"currentCostume":0,"costumes":[{"assetId":"cd21514d0531fdffb22204e0ec5ed84a","name":"decor1","md5ext":"cd21514d0531fdffb22204e0ec5ed84a.svg","dataFormat":"svg","rotationCenterX":240,"rotationCenterY":180}],"sounds":[{"assetId":"83a9787d4cb6f3b7632b4ddfebf74367","name":"pop","dataFormat":"wav","format":"","rate":44100,"sampleCount":1032,"md5ext":"83a9787d4cb6f3b7632b4ddfebf74367.wav"}],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":null},{"isStage":false,"name":"Personaj1","variables":{},"lists":{},"broadcasts":{},"blocks":{"Fu(KfOuh$cmgs0~Auqf9":{"opcode":"event_whenflagclicked","next":"%8(CtQom@,Qrk`;X+c1P","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":233,"y":241},"%YFU}CY;=s+fot2avH}*":{"opcode":"control_repeat","next":"bsblJ:MFwOOpBeuK5bD{","parent":"/%kBdd{_YGZu*[n3aMhW","inputs":{"TIMES":[1,[6,"10"]],"SUBSTACK":[2,"}IRk2OYvn4PF,G6N;b*O"]},"fields":{},"shadow":false,"topLevel":false},"%8(CtQom@,Qrk`;X+c1P":{"opcode":"motion_gotoxy","next":null,"parent":"Fu(KfOuh$cmgs0~Auqf9","inputs":{"X":[1,[4,"0"]],"Y":[1,[4,"0"]]},"fields":{},"shadow":false,"topLevel":false},"8K@.:@oW0!FH}1Q1nVCE":{"opcode":"control_repeat","next":null,"parent":"bsblJ:MFwOOpBeuK5bD{","inputs":{"TIMES":[1,[6,"10"]],"SUBSTACK":[2,"H=wW]C.G5jmE3UatxMgw"]},"fields":{},"shadow":false,"topLevel":false},"bsblJ:MFwOOpBeuK5bD{":{"opcode":"control_wait","next":"8K@.:@oW0!FH}1Q1nVCE","parent":"%YFU}CY;=s+fot2avH}*","inputs":{"DURATION":[1,[5,"0.5"]]},"fields":{},"shadow":false,"topLevel":false},"}IRk2OYvn4PF,G6N;b*O":{"opcode":"motion_changeyby","next":null,"parent":"%YFU}CY;=s+fot2avH}*","inputs":{"DY":[1,[4,"10"]]},"fields":{},"shadow":false,"topLevel":false},"H=wW]C.G5jmE3UatxMgw":{"opcode":"motion_changeyby","next":null,"parent":"8K@.:@oW0!FH}1Q1nVCE","inputs":{"DY":[1,[4,"-10"]]},"fields":{},"shadow":false,"topLevel":false},"/%kBdd{_YGZu*[n3aMhW":{"opcode":"event_whenkeypressed","next":"%YFU}CY;=s+fot2avH}*","parent":null,"inputs":{},"fields":{"KEY_OPTION":["space",null]},"shadow":false,"topLevel":true,"x":235,"y":401}},"comments":{},"currentCostume":0,"costumes":[{"assetId":"b7853f557e4426412e64bb3da6531a99","name":"costum1","bitmapResolution":1,"md5ext":"b7853f557e4426412e64bb3da6531a99.svg","dataFormat":"svg","rotationCenterX":48,"rotationCenterY":50},{"assetId":"e6ddc55a6ddd9cc9d84fe0b4c21e016f","name":"costum2","bitmapResolution":1,"md5ext":"e6ddc55a6ddd9cc9d84fe0b4c21e016f.svg","dataFormat":"svg","rotationCenterX":46,"rotationCenterY":53}],"sounds":[{"assetId":"83c36d806dc92327b9e7049a565c6bff","name":"Miau","dataFormat":"wav","format":"","rate":44100,"sampleCount":37376,"md5ext":"83c36d806dc92327b9e7049a565c6bff.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":"0.2.0-prerelease.20201016122132","agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Scratch/3.18.1 Chrome/80.0.3987.165 Electron/8.2.5 Safari/537.36"}}
1+
{"targets":[{"isStage":true,"name":"Stage","variables":{"`jEk@4|i[#Fk?(8x)AV.-my variable":["variabila mea",0]},"lists":{},"broadcasts":{},"blocks":{},"comments":{},"currentCostume":0,"costumes":[{"assetId":"cd21514d0531fdffb22204e0ec5ed84a","name":"decor1","md5ext":"cd21514d0531fdffb22204e0ec5ed84a.svg","dataFormat":"svg","rotationCenterX":240,"rotationCenterY":180}],"sounds":[{"assetId":"83a9787d4cb6f3b7632b4ddfebf74367","name":"pop","dataFormat":"wav","format":"","rate":44100,"sampleCount":1032,"md5ext":"83a9787d4cb6f3b7632b4ddfebf74367.wav"}],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":null},{"isStage":false,"name":"Personaj1","variables":{},"lists":{},"broadcasts":{},"blocks":{"Fu(KfOuh$cmgs0~Auqf9":{"opcode":"event_whenflagclicked","next":"%8(CtQom@,Qrk`;X+c1P","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":233,"y":241},"%YFU}CY;=s+fot2avH}*":{"opcode":"control_repeat","next":"bsblJ:MFwOOpBeuK5bD{","parent":"/%kBdd{_YGZu*[n3aMhW","inputs":{"TIMES":[1,[6,"10"]],"SUBSTACK":[2,"}IRk2OYvn4PF,G6N;b*O"]},"fields":{},"shadow":false,"topLevel":false},"%8(CtQom@,Qrk`;X+c1P":{"opcode":"motion_gotoxy","next":null,"parent":"Fu(KfOuh$cmgs0~Auqf9","inputs":{"X":[1,[4,"0"]],"Y":[1,[4,"0"]]},"fields":{},"shadow":false,"topLevel":false},"8K@.:@oW0!FH}1Q1nVCE":{"opcode":"control_repeat","next":null,"parent":"bsblJ:MFwOOpBeuK5bD{","inputs":{"TIMES":[1,[6,"10"]],"SUBSTACK":[2,"H=wW]C.G5jmE3UatxMgw"]},"fields":{},"shadow":false,"topLevel":false},"bsblJ:MFwOOpBeuK5bD{":{"opcode":"control_wait","next":"8K@.:@oW0!FH}1Q1nVCE","parent":"%YFU}CY;=s+fot2avH}*","inputs":{"DURATION":[1,[5,"0.5"]]},"fields":{},"shadow":false,"topLevel":false},"}IRk2OYvn4PF,G6N;b*O":{"opcode":"motion_changeyby","next":null,"parent":"%YFU}CY;=s+fot2avH}*","inputs":{"DY":[1,[4,"10"]]},"fields":{},"shadow":false,"topLevel":false},"H=wW]C.G5jmE3UatxMgw":{"opcode":"motion_changeyby","next":null,"parent":"8K@.:@oW0!FH}1Q1nVCE","inputs":{"DY":[1,[4,"-10"]]},"fields":{},"shadow":false,"topLevel":false},"/%kBdd{_YGZu*[n3aMhW":{"opcode":"event_whenkeypressed","next":"%YFU}CY;=s+fot2avH}*","parent":null,"inputs":{},"fields":{"KEY_OPTION":["up arrow",null]},"shadow":false,"topLevel":true,"x":222,"y":574}},"comments":{},"currentCostume":0,"costumes":[{"assetId":"b7853f557e4426412e64bb3da6531a99","name":"costum1","bitmapResolution":1,"md5ext":"b7853f557e4426412e64bb3da6531a99.svg","dataFormat":"svg","rotationCenterX":48,"rotationCenterY":50},{"assetId":"e6ddc55a6ddd9cc9d84fe0b4c21e016f","name":"costum2","bitmapResolution":1,"md5ext":"e6ddc55a6ddd9cc9d84fe0b4c21e016f.svg","dataFormat":"svg","rotationCenterX":46,"rotationCenterY":53}],"sounds":[{"assetId":"83c36d806dc92327b9e7049a565c6bff","name":"Miau","dataFormat":"wav","format":"","rate":44100,"sampleCount":37376,"md5ext":"83c36d806dc92327b9e7049a565c6bff.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":"0.2.0-prerelease.20201016122132","agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Scratch/3.18.1 Chrome/80.0.3987.165 Electron/8.2.5 Safari/537.36"}}

config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Project file name
3131
# If the "manual" mode is chosen, set the Scratch project file to load.
32-
projectFileName: str = "projects/KeyTest1alt.sb3"
32+
projectFileName: str = "projects/KeyTest1.sb3"
3333

3434
# Extract on project run
3535
# Set whether to extract the project assets on run.
@@ -59,7 +59,7 @@
5959

6060
# Key delay
6161
# Set the delay before key events start repeating. (in milliseconds)
62-
keyDelay: int = 250
62+
keyDelay: int = 1000
6363

6464
# Screen width/height
6565
# Stage size. You can change that, but most projects won't work with it.

main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ def buttonbox(self):
238238
# Debug and utility functions
239239
# keyEvents = set()
240240
if event.type == pygame.KEYDOWN:
241-
if event.key == pygame.K_SPACE:
242-
print("Space")
243-
keyEvents.add(32)
244241
keyEvents.add(event.key)
245242
keysRaw = pygame.key.get_pressed()
246243
keys = set(k for k in scratch.KEY_MAPPING.values() if keysRaw[k])
@@ -310,7 +307,7 @@ def buttonbox(self):
310307

311308
if e.opcode == "event_whenkeypressed":
312309
print(s.target.blocks, e.script)
313-
if not e.script or all(s.target.blocks[b].blockRan for b in e.script):
310+
if all(s.target.blocks[b].blockRan for b in e.script):
314311
e.blockRan = False
315312
for b in e.script:
316313
s.target.blocks[b].blockRan = False

projects/KeyTest1alt3.sb3

41.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)