Help with Checking/Getting #sprites #visibility

I am trying to figure out a way to check if #sprites are #visible or not.
I have 30 sprites to check for after collision.
If Sprites are Visible True Thunkable2

If Sprites are Visible True Thunkable3

If Sprites are Visible True Thunkable4

I have tried all of these, the last of which seems to give me some sort of result but the exact opposite of what i need and changing the value to true doesn’t help and doesn’t give me any result what so ever.
is there an option to do this without having to call every single sprite’s visibility?

1 Like

No, there is NOT.

1 Like

Ok Thanks.

Ok so i think i found somewhat of a solution but i think there is a #bug with the #visibility and the #logic blocks.
Get the visibility = false doesn’t work and but the function IS WORKING it just seems to ignore the is false.
I even tried the NOT block and that seems to be ignored as well.
If Sprites are Visible True Thunkable5
If Sprites are Visible True Thunkable6

This is not a solution.
You are just repeating the same mistake.
You cannot use a list to test collective true/false condition.

1 Like

Practical approach

I first made a function to loop through all available sprites in the specific sprite type and will return TRUE if all are hidden, otherwise will return FALSE
image

I then made added 3 buttons to the screen

  • A button to hide all sprites.
  • A button to show all sprites.
  • A button to call the function to check if all are hidden.
    image

image

image

I was getting the right message in the label every time.

1 Like

Thank You. Are you able to show me the blocks for the variable?

1 Like

Can you please explain more?
What variable do you mean?

The code I copied is all what is required to do the job and I added just two other buttons to set visibility of the sprites as True/False to test that my code is working.

1 Like

Oh Ok i thought the thisSprite block was a variable block.
Can you send me a link to the app?

1 Like

I have to recreate it. I just made the test and then deleted it.

Will do that later

I made a sample app
https://x.thunkable.com/projectPage/6128f82aefc8a20010ccb22f

There are TWO buttons. One to check if all sprites are hidden and show the appropriate message.

The other button will show a list of Sprite IDs and a status text to say “Visible” or “Hidden”. Once you click on any item it will hide it if it is visible or show it if it is hidden.

You can check if all are hidden at any time and see that the app is giving expected results.

1 Like

Hey Thank you Very much muneer

1 Like