Duplicating Enemies

This forum is currently in read-only mode.
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • So I have this little critter:

    <img src="http://i216.photobucket.com/albums/cc212/darkstorne/1.png" border="0" />

    And I have this event list for his movement/attacks:

    <img src="http://i216.photobucket.com/albums/cc212/darkstorne/SpiderEvents.png" border="0" />

    Which works fine when there's just one spider in the game. But as soon as I insert a second one, they just mimic each other. So when one is attacking, the other is attacking too even if he isn't in range. Slapping a "For each Spider" command in front of the events doesn't help <img src="smileys/smiley6.gif" border="0" align="middle" />

    Is this a bad way to create events for enemies? Am I supposed to create a different sprite set and event list for each one, naming them Spider1, Spider2, Spider3 etc? That could work, but the VRAM overhead would be pretty huge, especially for my Stag enemies which have a lot of animation frames.

    Thanks for reading <img src="smileys/smiley12.gif" border="0" align="middle" />

  • Else was always buggy in Cc. I would guess that's what the issue is.

    Edit:

    Just noticed the call for the family. Might be an issue as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I like your spider sprite.

    I probably can't help because it makes sense to me what you've done! Do you think perhaps you have to give each spider some sort of unique identifier, like maybe set a private variable for the one that triggers the animation?

    It seems like as soon as one spider triggers that attack animation maybe it triggers it for all of them. The fact that the "For Each" event doesn't seem to help also kind of supports that.

  • I'd try adding a "for each" condition to the end of event 220. If that doesn't work it's likely the else's that are causing all of them to be picked. In this case you can easily fix it by removing the elses and putting the inverted conditions of events 221 and 222 into event 223.

  • Else was always buggy in Cc. I would guess that's what the issue is.

    Was that a pun? <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Else was always buggy in Cc. I would guess that's what the issue is."Else" never was buggy in CC! It just doesn't work with human logic but computer logic. The greatest difference in that logic is that "else" doesn't pick. Which causes most of the problems CC developers have using "else".

  • I love you guys. Rojo nailed it: "you can easily fix it by removing the elses and putting the inverted conditions of events 221 and 222 into event 223."

    Thanks for all the replies, and thanks for the explanation behind the Else command Tulamide <img src="smileys/smiley1.gif" border="0" align="middle" />

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