Object at position Block/ Object With (Trait) Block

A feature I’d like to see in Hopscotch is:

A Block That Chooses An Object At A Position/ Or An Object With A Trait

I’d use it for this type of project:

Building Games

Here are some examples of Hopscotch code that could be improved if we had this:

When (Object At Position Or Object With (Select Trait)) Is Tapped/Pressed/Bumps

Here is an example design I’ve made:

N/A

I’ve seen something similar in another programming languages, it looks like this:

N/A

10 Likes

you can do:

when objects is tapped/pressed/bumps
_if self position = a position
_ do something

7 Likes

i made a change
at position or with select trait

5 Likes

not sure to understand lol
what trait?

3 Likes

this is not what im saying
what im saying is that the block defines the object that will be tapped

5 Likes

So positions would work as a trait?

6 Likes

yeah
a variable that the object has
thats already there
but i want it to be able to select
all objects with that trait

6 Likes

not just one like when (object(value))
when any object with tag, value = value

i would also like to see a block that lets u select clones as objects
beforehand

5 Likes

So…

You want a block that functions when objects = a specific trait?

Like

when (trait) = (specific)

Function

4 Likes

yes
i would also like to see a block that lets u select clones as objects
beforehand

5 Likes

when self bumps circles clone number 1
are these good ideas??

4 Likes

So basically a “When (Index (Clone Index) of (Object)) Bumps (Something)” do some code…

3 Likes


Pls make it clearer aaa

4 Likes

Ah, I get it now - very cool! I would definitely use it for a bunch of my project!

5 Likes

Yay I have a small approval
And no life

4 Likes

This be useful I say. One sec I’m going to make a example for this. (With pictures)

3 Likes

Is this how you imagine it would look like?


Oh wait I forgot to add shape as a trait. You guys can imagine what that would look like.

3 Likes

I think they meant something more like ( (object with color red) X position ) == 23

3 Likes

Oh ya I think that’s what they meant.

2 Likes

Hey awesome e, big fan btw

3 Likes