How do I add enemy without spawner

  • Hello everybody I'm just wondering is it possible to create enemies with out a spawner? Because when I kill one of the enemy all of them die (instantly). Is there any way to add ID or something like that so they are not attached (not duplicating the other enemy sprite?

    Thank you!

  • "Enemy" and "Spawner" are technically just sprites, you can create them using the system's action "create object".

    Now about "killing one of them", I think you may have to pick the object beforehand. If you simply call the destroy action on an Enemy, it is natural that they are all destroyed afterwards, because all your Enemy instances are picked.

    Use the event "pick by unique ID" of your Enemy object, or any "pick ..." event in the System object to pick a single instance, or a group of instances, upon which you wich to apply the "destroy" action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So there is no other way without spawner? Because I really wanted to just place the zombies on the map but they keep repeating what the real enemy does, so if I kill one of the zombie all of them play the death animation and die... I'm not very good at understanding where and what to press in construct 2 guys sorry ( Still Learning) Thanks for future help!

  • Well we could go and guess what you are doing, or you could show us..

    I'm not sure what you mean by a spawner, as far as I know there is no spawner object in C2.

    you probably mean either the sprite spawn action or the system create action..

    Both of these create objects at a location you specify, but neither has anything to do with the fact your enemies all act the same..

    If you want a specific enemy to do a specific thing while other enemies do other things, you should make it clear in your events which enemy you want.

    My guess is you are using the system compare action, which doesn't pick any instances..

  • you can do this - add a health variable to your sprite. add some hp.

    then do this

    condition - something (bullet, bomb or whatever you use to destroy objects) on collision with enemy - remove x from hp

    subevent - condition - if health <= 0 - enemy destroy (this will destroy the collided enemy)

    that way you can duplicate your sprite infinite times and have only 1 destroyed at a time. of course there's tons of other ways of doing this, but it all depends on the gameplay you want to achieve.

  • I thought I cant post links .. sorry! But here it is...

  • Try posting the URL without the "https://www" part.

    I think that should work..

  • ok here it is - upload.ee/image/4712865/Untitled-1.png

  • Thanks for the picture..

    I'm not quite sure in what way this picture should help with answering your questions, but it's nice..

  • I mean like I have the 2nd zombie as a clone so if I kill the real zombie the clone dies with him together .

    Im trying saiyadjin answer right now, might work.

    But I have hit boxes so if zombie hit in the circle >> play animation 1. If zombie hit in square zombie play animation 2 Will this still work saiyadjin?

  • To fix this issue it's important to see the events you use.

    If all zombies die, you are not picking the zombie.

    The zombie you want to be destroyed should be referenced in the event/conditions.

  • Okey, did the image work on 1st page? LittleStain

  • Okey, did the image work on 1st page? LittleStain

    Yes, it worked..

  • Hey LittleStain If you have time could you explain how I need to do it? because I have been trying for long time now no idea at all .. sorry for too many questions!

    What do you mean by picking the zombie.

    And how do I referenced in the event/conditions. ?

  • Picking means specifying which instance of the zombie object should be affected by the actions..

    You are saying that all zombies get destroyed, so it seems to me it is not clear which zombie should be destroyed..

    You do know how events work?

    https://www.scirra.com/manual/75/how-events-work

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