Enemy respawn?

thor6577

  • Posts: 189
Hey guys what blocks would i need to make a behavioir that makes enemies respawn in
a) random places
b) in a certain spot

Greg

  • *
  • Posts: 1260
You'd just need the "Create Actor" (or Created Recycled Actor) blocks.  You enter in the x,y position of where you want them to be created, so if you want to randomize it - just use the random number blocks in the position fields.


coleislazy

  • *
  • Posts: 2607
No, that would create a Mambo every frame (remember, "always" gets run up to 60 times per second), then try to recycle him. Since you didn't create him with the "create recycled" actor block, it will probably give an error.

You probably want something like in this screen shot. "Spawn Seconds" is a Number attribute and "Actor to Spawn" is an Actor Type attribute. By using screen height/width, it makes sure that the actor will only spawn on the screen.

thor6577

  • Posts: 189
Ok i did that and i worked, but it doesn't repeat so i used the repeat block and put the {create actor} thing in there and when the screen loaded, the mambos were already there. I want them to fall from the sky gradually.

coleislazy

  • *
  • Posts: 2607
It should repeat. What value did you give "Spawn Seconds"?

thor6577

  • Posts: 189
Hmmm thats wierd I replayed the level and it worked fine. Oooh BTW how do i get the mambo actor to go through the tiles. I changed the collision for the tiles and mambo and he still stands on top of the tile.

coleislazy

  • *
  • Posts: 2607
Either make sure his group doesn't collide with tiles and make sure his collision boxes for each animation are not set to a different group.

Or, you could make each collision box for each animation a sensor.

thor6577

  • Posts: 189
Hey thanks the sensor thing worked!!

thor6577

  • Posts: 189
Ok guys last question.Im trying to make a behavior that makes you die when you hit mambo but when i tested it , i still lived tell me of this is right or what changes i need to make.

kantieno

  • *
  • Posts: 242
The collision groups of the colliding actors may not be set to be able to collide with each other, that's the only thing I think the problem might be, unless you just forgot to attach the behavior :P
Play my new game "Hidden Valley Ninja" here: http://www.kongregate.com/games/kantieno/hidden-valley-ninja

coleislazy

  • *
  • Posts: 2607
I believe because you turned Mambo into a sensor, need to use <this actor [hit] [a sensor]>.

thor6577

  • Posts: 189
I did and it still didnt work D:

thor6577

  • Posts: 189
Any suggestions?   
Guys???

« Last Edit: November 22, 2011, 05:29:26 pm by thor6577 »