How do I hide global sprites?

0 favourites
  • 7 posts
From the Asset Store
Globals 2.0
$3.60 USD
10% off
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Hi all,

    I have some sprites that are set to global (and need to be for various reasons). My issue is they are appearing on other layouts. I understand this is just the nature of global objects but I am wondering if anyone has any clever tricks for hiding these sprites?

    I had considered just setting them to "invisible" but then they will still be collidable and the player may run into these invisible objects.

    I had also considered moving them to some very distant position but I'm not sure how I would ensure each one would return to its original position.

    Has anyone come up with a clever method for hiding global objects on other layouts?

    If so please let me know.

    Thanks in advance!

    Tagged:

  • You can also disable collision on the objects

  • lionz I need the collisions enabled so that certain sprites can detect if they are overlapping.

  • Seems kinda counter intuitive to make them global then hide them on other layouts, why are they global? What purpose do they serve?

  • lionz Yah it does doesn't it.

    But basically when the player enters their house they can click on the diary to go to sleep and the game then starts the next day. It's this end of day action (which happens inside the house) that checks to see which crops outside of the house (and thus on another layout) are overlapping a "watered" tile to know if they should progress through their growth cycle or not. Fun farm sim stuff.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's a strange approach I guess, you shouldn't have to bring in gameplay assets from another layout and set them invisible, but if you are doing that then I don't see how the player colliding them while invisible is a problem? Anyway the approach is not great as you start bringing in unnecessary art assets and increasing memory usage. They are invisible, serve no real purpose. You should process the overlap checks when you enter the layout that contains the crops.

  • lionz Hmm point taken. I'll see if I can do that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)