The Best Ways to Affect Only Linked Objects

0 favourites
  • 5 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • The description may be misleading, but I'm not sure exactly how to word this.

    I'm just wondering what the most efficient ways to link (or group) objects and manipulate them individually. As you see below, I have a building which can be destroyed with it's health displayed overhead. The display, health bar, arrow, and building are all separate and are all controlled separately. Since there will be more instances of the destroyable building onscreen at any given time, I'd need a way to link the health and building sprites so the programming doesn't get confused. Pretty common issue, but all the ways I know to do this take a lot of events or individual objects to program.

    What I am wondering is what are the easiest ways y'all have found to put objects into groups or link them together?

  • Have you looked at using a container? That can help with some aspects of 'grouping' objects together.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As codah said, you would probably be helped a lot with containers

    https://www.scirra.com/manual/150/containers

  • codah LittleStain

    I didn't know events on the container only affect objects in the container. Huh. I was avoiding containers mostly because destroying the building when it's health drops to 0 would also destroy the bar indicator and arrow sprites, but there are easy ways around that now that I know!

    Thanks, guys!

  • No worries, they are useful mainly in saving you doing a lot of picking of related objects. Families are another way to group (more categorise) objects.

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