How do I make a segmented enemy act independently from each other?

0 favourites
  • 4 posts
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • Greetings forums,

    I'm moderately new to Construct 3, and I'm learning by downloading and editing the demos and other projects to see the nitty gritty (I use the free version for now).

    I found this example of a really well made worm game (Not my own example) and started editing it.

    Something that I would like to do is to make each worm independent. Right now, I have 2 heads, but when I try to spawn them both with different segments (For example, worm 1 has 3 segments, and worm 2 has 7 segments), the worm with the higher number takes priority and both worms spawn with the same amount of segments.

    Also, whenever the worm eats a dot, BOTH worms increase in length. I only want the one worm who ate the dot to grow, and the other to be unaffected.

    Can someone please help me out? How do I make these worms independent from one another?

    Here's the code:

    Here's the project file: drive.google.com/file/d/1JEMQdjeLPfbc3466woU7het-Vc0TNcCZ/view

    Thank you in advance ^^

  • Right now it will pick all snakes because none is specified. To pick one you need to pass through the snake UID through the function and use it.

    You should add a parameter to the function. When you call it, the parameter is the snake's UID.

    Inside the function you add a condition, pick snake by UID where the value is the parameter. This then refers to that snake that collided with the object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for replying, that sounds like a good idea, but I've hit a roadblock.

    I've just realized that the example I found was made in Construct 2, before built in functions were a thing, so I'm reworking the example to use built in functions instead of the plugin (Because the plugin doesn't accept parameters the same way built in does)

    However, here's me issue:

    Even though I have the function ready, the editor won't let me call it (I'm trying to find "increaseBody" in this list). Again, I'm using the free version. Are function calls exclusive to the paid version or something?

    I opened Kiwi Story, and the function calls seem to be working just fine. What am I doing wrong? Thanks in advance

  • You need to create the function, on the right side of the event sheet there is an Add button

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