How do I 'link' sprites together. (SOLVED)!

0 favourites
  • 10 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • The enemies in my game are composed of multiple parts, they are in a container so when the body spawns everything else spawns with it. Is there a way to 'link' these enemies parts together so when a certain detector sprite is triggering the enemy to jump only the triggered one will jump. (Them being in a container doesn't link them together either.)

    I.e. JumpDetector on collision with Wall | Enemy simulate control Jump.

    Normally this would cause every enemy to jump but I only want the right one to jump.

    What could I possibly try that would link all of the enemy parts together when spawned.

  • I'm not sure of exactly what you're trying to do, but I think you could use variables to pick the correct enemy.

  • If you are using 8 direction control for your enemies all enemies will jump that are on screen.

    You can use Y coordinates to simulate a jump and use that for a character specific behavior event.

    On Enemy1 collision with Wall move Enemey1 -40 in Y direction.

    Something like that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm using the platform behaviour and just realized I could use overlapping at offset to jump before the enemy is at the wall. However, I still need to know how to link parts together, I think burvey has the right idea with some sort of variable system, I just don't know what to do.

  • If you have a capx I would be happy to take a look for you (I'm still not sure exactly what you mean when you say link the parts together but make them act separately from each other).

  • https://www.dropbox.com/s/w2gm4znmqopvxcu/Demo%20capx.capx?dl=0

    Here is a very simple capx demonstrating how setting the animations though the enemies platform.vectorX speed doesn't work with multiple enemies. This is where it needs a linking system to separate different enemies. Hopefully you can understand the problem from what I've given you.

  • You have 2 little problems.

    1/ You did't pick. Compare two values does not pick an object.

    2/ You are right that (even with picking) the logic will not work. As far as my little knowledge goes, this is due the 'deceleration' component. When it 'stops' at solids, it is still decelerating. The push-out-of-solids routine inside the platform behavior is placing it outside the solid, but the actual vector is still decelerating. Fix in the capx. (and no, i dont like the behavior working that way)

    https://www.dropbox.com/s/agav1wyuh0uuo ... .capx?dl=0

  • No, i a wrong, its only the picking. I used an 'else' where not applicable.

    Correcting myself:

    https://www.dropbox.com/s/ap5mxvf5kg3vh ... .capx?dl=0

  • Thanks so much, it's pretty obvious why it wasn't working now. Going to have to ask just out of curiosity, what was that 'ahem' bug in the first capx that was logged in the browser, what does that do?

    But again thanks for clearing this up for me.

  • It captured those that escaped the logic. And i could not wrap my head around why they escaped the logic.

    The browser plugin logged the speed (bring up Chrome's console) for those that escaped me .

    Console is a window to what happens in the core. Best debug tool ever.

    Then i wend outside, in the cold wet air, for a smoke. And it dawned to me.

    Never think you are the only struggling scripter. Just keep gooin.

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