We should have Check Once if ____ = (a list of numbers)

feature_suggestions

#1

A suggestion I have is that we should have a Check Once if ____= (a list of numbers)

What is it?
This is saying if ____ equals any of the numbers listed, then continue on with what is inside of that block.

Why?
It could be used for drawing pads and games. In drawing pads, it could be used to say if color = any number from 0-23 then Leave a Trail that color code. If it equals anything above 23, then do as follows.
In games, it could be used to say if lives = any number from 0-3 then set text lives red. If it doesn't equal any number from 0-3, then do as follows.

What is your opinion on this suggestion?


#2

This would be really cool, I would love to have this block right now, I am making game now that would really need it.


#3

You can do that already with the check if else and the check once if blocks


#4

You can, but it takes a lot. For example, for my game I have that and it has 10 Check if Else and Check Once Ifs and it lags pretty badlyc:disappointed:


#5

What you're after are either Boolean operators (AND, OR, ...) or "case structure" found in other languages. That would be an advancement, but it may be out of scope for Hopscotch - at least for now.


#6

Yeah this feature would be useful @Glitter_Kitty. Like @oio says, I think Boolean operators would help with this.

@Gabe_N is right too, you could do it on Hopscotch right now like this:

Check once if "Color" ≥ 0
    Check once if "Color" ≤ 23
        Leave trail "Color"
    Else
        Do as follows
    End
End

Text color in the forums?!