when collides w/ actor type x, destroy this actor...

toastyteetoastytee Member Posts: 53
edited February 2012 in Working with GS (Mac)
Please help! Its a very simple rule but its not working for me! I have a button for a bomb which clears the screen of all enemies. When the player presses the bomb button it spawns an invisible rectangle the size of the screen. I created a rule in the enemy actors that says " when actor overlaps/collides with actor type "bomb explosion", destroy this actor. So, when I drag and drop the enemy onto the scene, it works perfectly, the enemies are destroyed when the bomb button is pressed! BUT, normally the enemies are spawned by another actor, an "enemy spawner", and for those actors the bomb does not work! It simply wont destroy them! Is this a bug, or am I missing something?

Comments

  • CloudsClouds Member Posts: 1,599
    " I created a rule in the enemy actors that says " when actor overlaps/collides with actor type "bomb explosion", destroy this actor. So, when I drag and drop the enemy onto the scene, it works perfectly, the enemies are destroyed when the bomb button is pressed . . . . "

    Are these enemies (with the working rule) instances or are they copies of the prototype ?
  • MotherHooseMotherHoose Member Posts: 2,456
    is this a scrollingPlatform? is the camera moving right or up ?

    is the bombExplosion relative to actor or scene?

    in designPhase … don't have the bombExplosion invisible … change its alpha to 0.5 … so you can see where it is when it is spawned

    @};- MH
  • toastyteetoastytee Member Posts: 53
    "Are these enemies (with the working rule) instances or are they copies of the prototype ?"
    the short answer is I don't know. Im not sure what the difference is. When the player touches the enemy spawner it spawns sometimes 2 or 3 of the same actor on the screen and then the spawner is destroyed.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I would do it differently

    Create an attribute called clearBombs or something

    Have a rule on the button that says when touch is. Pressed change attribute to true and have a timer tht says after .5 seconds change attribute false


    Then on your bombs, have a rule that says

    When clearBombs is true
    Destroy actor.
  • toastyteetoastytee Member Posts: 53
    Thanks for the suggestion! I just got done testing that out and yes it seems to work but theres still a big problem.. I don't want the bomb to kill all the enemies in the room, just the ones on the screen. Any ideas?
Sign In or Register to comment.