Killing Enemy!

Avigga

  • Posts: 72
Hi. I have megaman and it shots bullets so how i can kill with bullet enemies? Is here something behaviour?

Thanks for all answerers
IcyTower ;)

mkross1983

  • Posts: 22
Try attaching this to your bullet actor.

Hectate

  • *
  • Posts: 4643
You may want to assign enemies to a collision group called something like "Enemies" and also check if the actor you collided with was part of group "Enemies" so you don't kill random actors like platforms, doors, etc.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

DeathWish

  • Posts: 31
I think the best idea would be to make an enemies group, and have megaman be in a players group. Then, make it so that the bullet

When this collides with something
If group for this actor's colliding shape=Enemies
Kill last collided actor

(I think that should work, but I'm not too good with the actor's colliding shape part-But I used that for spikes and it worked, so it'll probably work here too).


And by the way, but the enemy sprites in the Enemy group, and the bullet in a new one called bullet-Have the bullet group only collide with enemies and tiles.


And by the way, if you want to have a bullet take out, let's say, half of the life of the enemy, you can simply add the health behavior from the forge to the enemies, make them have, let's say, 30 life, and NOT invincible, and have another one in the bullet, Inflicts Damage, and have it take out 15 or whatever you want. Make sure the bullet and the enemies collide, though.

mikbob

  • Posts: 493
Try attaching this to your bullet actor.
That would work perfectly!

Visit Our Site!  http://www.mikbobgames.com
Play The Platforms 2!  http://bit.ly/theplatforms2
Check out our twitter!  www.twitter.com/mikbobgames

Avigga

  • Posts: 72
Is here something killing enemy

"When bullet hits enemy it will dissappear"

?
IcyTower ;)

mikbob

  • Posts: 493
Is here something killing enemy

"When bullet hits enemy it will dissappear"

?
Add a [kill (self)] block at inside the 'if'

Visit Our Site!  http://www.mikbobgames.com
Play The Platforms 2!  http://bit.ly/theplatforms2
Check out our twitter!  www.twitter.com/mikbobgames

Avigga

  • Posts: 72
mikbob i mean something like when bullet hit enemies not one enemy...
IcyTower ;)

Hectate

  • *
  • Posts: 4643
Well, use a number variable to count how many it has hit.

If Bullet hits enemy
- kill enemy
- increment hit count by 1
- If Hit count is greater than or equal to Max Hits
- - Kill bullet.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Avigga

  • Posts: 72
hectate can you show for this in Blocks picture...
IcyTower ;)

Hectate

  • *
  • Posts: 4643
Given my schedule, it won't happen until Sunday at the soonest then. Perhaps someone else could create the example?
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

mikbob

  • Posts: 493
hectate can you show for this in Blocks picture...
Here it is:

Visit Our Site!  http://www.mikbobgames.com
Play The Platforms 2!  http://bit.ly/theplatforms2
Check out our twitter!  www.twitter.com/mikbobgames

Hectate

  • *
  • Posts: 4643
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Avigga

  • Posts: 72
Thanks mikbob and Hec =)

Bullet doesn't die when i kill enemy...
How i can get something when 3 seconds gone bullet die
IcyTower ;)

Hectate

  • *
  • Posts: 4643
Your question was how do you let it kill multiple enemies up to a certain number. Now you want to make it disappear after time? Is the bullet even staying onscreen? This is really odd, especially 3 seconds.

I could tell you, but explain to me first what you're trying to accomplish - perhaps there is a better way.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.