I think it will be harder for the devs to implement this. Especially since ‘break’ would have to ‘automatically’ end the repeat block even if it hasn’t finished. Either way, it would be perfect addition, and it would also make the code more efficient. It would be very useful for objects with moving animations like ‘move forward ’, which if tapped would originally need to wait for the loop to end before resetting its own animation.
That’s why there would be “check once if else” inside repeat forever blocks.
Check once if: -1 = Supreme
Set Text: “Petrichor is Supreme”
…and then whatever would be after.
Also, I think there should be an option to ‘broadcast’ named statements. Because most programming language uses ‘void’ (text) or ‘when broadcasted’ (blocks).
The beta editor has a broadcast block. I don’t know if it does exactly what you’re saying one should do, though.
The kind that’s used in real programming, except it has ‘void’ next to a function and it is basically a set of code that doesn’t run until it gets called. The broadcast feature in the beta is probably for the chat bot.
I don’t have the beta, so I have no idea if it is or not.
We do have ‘when ()=()’ which somewhat does the same thing, your example just makes it even easier to code.
Types would be nice
Then we can make strutcts
I think there are 100+ blocks the devs could add to Hopscotch including your ‘break’ and ‘continue’ blocks, and if there was that many more blocks, there should be better organization, as well as a ‘search blocks’ feature.
However, we must remember that this is a kids’ coding app, and as such there cannot be too many blocks, as remembering how all of them function would be difficult for a lot of 8-12 year olds.
Oyes that is true
What if there was a “beginners set” and a “complete set”
And maybe a “favorites” to save your favorites
Oh please do add this THT. It would be super helpful for stopping repeat forever loops and checking if music is paused.
Oh yeah, it would be really useful for music. I didn’t think about that.
I forgot about they have repeat forever loops
With “break” we could turn this repeat forever into a “while” loop or “repeat until” block.
Yes! Absolutely! I would love to see this.
we need these
This is also used in Python,
while True: if value == 0: break
Yes. I know a little Python, and I’ve always found it very useful.
Scratch has 119 blocks - I think we’ll be fine.