how do i make ai with multiple sprites per enemy

  • each enemy in this game i'm working on is made up of about four different sprites. but, when i have multiple copies of the enemy, all the parts like the arms and the head are confused on which body to set their position to. is there a way to make each instance of the enemy independent without having to make a million different sprites?

    If this is confusing tell me, and i can try to explain it better.

  • Have you tried using containers?

    Add all of the sprite that go together in 1 container. That way when you spawn one of those they all come along. You'll need to set the locations for each separately though.

  • is there a tutorial on containers? or do you want to explain containers a little more?

  • The manual explains it pretty well: https://www.scirra.com/manual/150/containers

    "Containers are for making "composite objects", or objects made out of lots of smaller sprites (such as a turret and tank base making a single tank). Once in a container, picking the base also picks the turret, and vice versa."

    For example I have a enemy spaceship that have a lifebar, shield bar, shield and a trail all in a container, I just need to place the spaceship on the layout and all the others show up. I have a everytick that keeps them where they go. If I change the healthbar in an event they update for all the ships with the right values of the ships since they are spawned together.

    I never used them before, now after trying them out I use them on everything that have multiple parts.

  • wow, i figured it out, and its pretty great. thanks, you really helped.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Great! Thanks!

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