Discuss Scratch
- The_Floppy_Disc
-
66 posts
Find all diamonds!
My browser / operating system: ChromeOS 14541.0.0, Chrome 132.0.0.0, No Flash version detected
I'm on a Chromebook.
I'm on a Chromebook.
- as23990402
-
83 posts
Find all diamonds!
Win10, Chrome 133.0.6943.98.
Is there any logical error in my original code? It's just a simple switch function.
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1130324016/
Sorry! I got to be offline now, I'll check the message later. Thanks again.
Is there any logical error in my original code? It's just a simple switch function.
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1130324016/
Sorry! I got to be offline now, I'll check the message later. Thanks again.
- The_Floppy_Disc
-
66 posts
Find all diamonds!
I don't know what the problem was. I think it was my fault. There was a small bug with a wait block, but I think when I modified the script I broke something. I'll try to fix it.
Do you have a list of what all the variables are for? I can't tell what they're for because they're just numbers. If you don't that's fine too.

- as23990402
-
83 posts
Find all diamonds!
I don't know what the problem was. I think it was my fault. There was a small bug with a wait block, but I think when I modified the script I broke something. I'll try to fix it.Do you have a list of what all the variables are for? I can't tell what they're for because they're just numbers. If you don't that's fine too.
Check this project with Mandarin typing:
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1134519127/
It's simplified from project A that contains 5 games inside. I took off the other 4 games and left the 2nd-one.
.
The original structure of project A:
1. The stage works as a tour guide and provides menu, players could choose games they want to play. When player confirms to play a game, then the stage broadcasts message “0進入關卡(n)” to activate the character 「n_小廠務」.
2. The character 「n_小廠務」 is a window between the stage and characters in this game. When the stage calls 「2_小廠務」 , then 「2_小廠務」broadcasts message “0開始遊戲(2)”.
3. Characters of the 2nd-game act their roles until win/lose case triggered.
4. The character 「n_小廠務」 stops the game with message “0結束遊戲(2)”, and report the result to the stage with message “0退出關卡(2)”.
5. The stage takes control. Things repeats from step 1.
Last edited by as23990402 (Feb. 18, 2025 05:05:00)
- The_Floppy_Disc
-
66 posts
Find all diamonds!
Okay. I looked at the original project. It seems like it is only a bug in my project. I was trying to fix some lag caused by wait blocks on the selection screen, and I think that was when the bug started. I'll just reset the code in the stage.
- as23990402
-
83 posts
Find all diamonds!
The variabl 「311」is designed with rules below:
It is used to:
1. check that players finish their setting at the current page.
2. proceed to next page which means next procedure.
wait until <[311 v] = [1]>
set [311 v] to [0]
repeat until <[311 v] = [1]>
end
set [311 v] to [0]
It is used to:
1. check that players finish their setting at the current page.
2. proceed to next page which means next procedure.
Last edited by as23990402 (Feb. 18, 2025 05:31:28)
- as23990402
-
83 posts
Find all diamonds!
There is a bug (in my code) with hiding clones of character 「2_鑽石」when message 「閃電」received . It causes the incorrect behavior of character 「2_光點」,all diamond spots whether be caught or not shall show up in right-up corner when player lose the game, but it does not.
I added a new variable named “99”. Code fixed is showed below…
character 「2_小廠務」:
character 「2_鑽石」:
I added a new variable named “99”. Code fixed is showed below…
character 「2_小廠務」:
when I receive [0進入關卡(2) v]
set [99 v] to [0]
when I receive [閃電 v]
set [99 v] to [1]
repeat (10)
hide
wait (0.2) secs
show
end
set [99 v] to [0]
character 「2_鑽石」:
when I receive [閃電 v]
if <<touching [edge v] ?> and <[204 v] > [1]>> then
hide
wait until <<not <touching [edge v] ?>> or <[99 v] = [0]>>
show
end
Last edited by as23990402 (Feb. 19, 2025 06:52:46)
- The_Floppy_Disc
-
66 posts
Find all diamonds!
I fixed the joystick bug. The mobile joystick works for difficulty and speed selection now.
- The_Floppy_Disc
-
66 posts
Find all diamonds!
I fixed this bug. There is a bug (in my code) with hiding clones of character 「2_鑽石」when message 「閃電」received . It causes the incorrect behavior of character 「2_光點」,all diamond spots whether be caught or not shall show up in right-up corner when player lose the game, but it does not.
I added a new variable named “99”. Code fixed is showed below…
character 「2_小廠務」:when I receive [0進入關卡(2) v]
set [99 v] to [0]when I receive [閃電 v]
set [99 v] to [1]
repeat (10)
hide
wait (0.2) secs
show
end
set [99 v] to [0]
character 「2_鑽石」:when I receive [閃電 v]
if <<touching [edge v] ?> and <[204 v] > [1]>> then
hide
wait until <<not <touching [edge v] ?>> or <[99 v] = [0]>>
show
end
- as23990402
-
83 posts
Find all diamonds!
Mm…I'am afraid you misunderstood my thought.
The right-up corner is a map while game playing. If the player collect 8 diamonds, the map shows where the 8 diamonds are.
But if the player lose the game, the map shows all diamonds including those not collected. This is designed to let the player see diamonds they missed.
The right-up corner is a map while game playing. If the player collect 8 diamonds, the map shows where the 8 diamonds are.
But if the player lose the game, the map shows all diamonds including those not collected. This is designed to let the player see diamonds they missed.
- The_Floppy_Disc
-
66 posts
Find all diamonds!
Okay. I'll fix it later. I can't be online for a while.
- as23990402
-
83 posts
Find all diamonds!
OK. I updated something in my project. The virus will melted and be seen when the player get stars.