Rule Block Idea! AND block. "When ___ is tapped AND when ___ is tapped!"

improvement
coding
block

#1

Hello. :wave:
I have always thought that there should be a new rule block. I always had the idea when coding a large game with multiple choice questions. Here is the block I was thinking: an “and” block. For example, “When____ is tapped AND when _____ is tapped AND when _____ is tapped”. Then, if either of those were tapped, they could have the same outcome.

Don’t understand what I mean? In the pic above, I show “when circle is tapped”, “when circle 2 is tapped”, and “when circle 3 is tapped”. They both have the same outcome… “Grow”. If there was an “and” block for not just for “when____is tapped”, but for other rules, it would save time and make great simplicity! Please consider this THT, @alish and @liza and everyone apart of THT!

Panda


#2

That’s already exists lol
Check the end of the when’s menu


#3

Yes, but not in one piece.


#4

I know what you mean, but I was talking about linking them all together

Trust me, I know from experience.

It would save A LOT of time


#5


#6

Yes, @FRENCH_WAVE123, I know about that block. However, that is only for values. I’m talking about an and block for the “IPAD” section at the beginning. Not a “CONDITIONAL”


#7

Thank you for trying though


#8

Ok


#9

That would be really cool to have in Hopscotch, I agree! “OR” statements for rules would also be cool!


#10

That is a really thought out idea. It would definitely organize everything out instead of have two different rule blocks


#11

Exactly! Just a little more organization is all it takes for a stupendous coding experience


#12

All my coding experiences are amazing (except when I’m trying to teach my sis)


#13

This is a good idea. (In my opinion)


#14

Hi @PandaS

Your proposal is a good one. I’ve wished for that at times as well. However… with just a small effort we can accomplish the “When and” with the existing functionality. Since Hopscotch is a learning tap, I think it’s important to force (or perhaps encourage) users to code some types of extended functionality themselves.

For When ___ is tapped AND ___ is tapped, we could do something like

Create a custom ability:


(Note the order. It’s important to have the When Tapped 2nd. If the order was switched, you’d have to add another Wait 0 to get the exact same result)

For any object we add this to, the object variable ‘Tapped’ will be set and remain set for a couple frames (cycles through the code) to make to easier to tap multiple objects at the “same time”.

Then we can add the When And rules referring to the object’s Tapped variables. Note the order. It’s important to have the 2 Whens “between” the 2 ‘Self Tapped’ Abilities to avoid a possible glitch where one When fires but not the other.


#15

Thank you for this suggestion. I’m not sure if it would solve the problem of time. But I’ll check it out!