Destroying Spawner Actor?

I have been trying to find ways to spawn new actors in my spawner with no luck, so I am thinking on destroying the spawner itself and putting up a new spawner when it reach like the score 200..
so the 1st spawner will be destroyed when the score reach 200 and a new one will be put up in its place, can this be possible?
the code that I made so far is..
Change Attribute: self.random to random(1,2)
Rule: Attribute self.random = 1
Spawn Actor: 1
Destroy:
Rule: Attribute self.random = 2
Spawn Actor: 2
Destroy:
after that I made a line here, and its not destroying the spawner..
Rule: Attribute game.score "equal or greater than" 200
Destroy:
is there a way to do this or it cant be possible? thanks for the help..
so the 1st spawner will be destroyed when the score reach 200 and a new one will be put up in its place, can this be possible?
the code that I made so far is..
Change Attribute: self.random to random(1,2)
Rule: Attribute self.random = 1
Spawn Actor: 1
Destroy:
Rule: Attribute self.random = 2
Spawn Actor: 2
Destroy:
after that I made a line here, and its not destroying the spawner..
Rule: Attribute game.score "equal or greater than" 200
Destroy:
is there a way to do this or it cant be possible? thanks for the help..
Comments
you want to let a new actor spawn by a score of 200 where the old actor was destroyed?
for destroying actor 1 you must safe the x and y coordinates (in an game attribute), then by a score equal or over 200 spawn actor on position ... ... (game.positionx and game.positiony for example)
that's what you want??
wouter
so I need to make a rule like..
Rule:Attribute game.score "equal or greater than" 200
Spawn Actor: spawner01
game.positionx - game.positiony
Destroy:
I made them real attribute in game attribute, or I made a mistake in selecting the rules?
thanks for the help and response..
but you can make a timer with every ...(20) seconds spawn actor and when score is over 200 you can make that timer to spawn every 10 seconds...
http://gamesalad.com/game/22255
and with that example, the timer is part of the actors not the spawner, as of right now I am browsing more examples in gamesalad..hehe
don't know what you mean, but maybe you need to use timers?
search in templates (online) zombie space invaders, they are using area's with timers to spawn zombies (don't know if this is what you're looking for^^)
saw the zombie game, and its not what I have in mind, that collide and overlap example is the one I think is perfect for what I am going to do, problem is in a certain point I need to add more shapes or colors, so if I can spawn new ones by adding a code or just destroy the whole spawn actor and replace it with the new one at game.score 200..
I already tried timers or maybe it didn't work because I put the wrong codes..hehe
I can spawn a new one at score 200 but I cant get rid of the old one, and its like the zombies got my brain already for finding a solution..hehe
so if over 200 in old actor destroy and spawn a new??... don't see how this could be a problem:P (what code do you have?)
-------------------------------
Change Attribute:
self.random to random(1,2)
-------------------------------
Rule:
Attribute self.random = 1
--
Spawn Actor:
1 Layer Order: In Front of Actor
--
Destroy:
-------------------------------
Rule:
Attribute self.random = 2
--
Spawn Actor:
2 Layer Order: In Front of Actor
--
Destroy:
-------------------------------
Rule:
Attribute game.score ≥ 200
--
Destroy:
that's the code I use with the spawner, with the actors being spawned..
-------------------------
Timer:
Every 10
--
Spawn Actor:
Spawner - in front of actor
Position: self.x - self.y
--
Destroy Actor:
-----------------------------
if you can open the collide example, its patterned there, the codes are the same, problem is I don't know how to add new spawn actors or just destroy the spawner, the other spawned that I use is tshirtsbooth example, and I can add some spawned actors there, but the effect I need is the same with the collide example..
that is why I am trying to find a way for 3 days now, with no luck..hehe
you want that the actors switch (as in the example), or you want that there come more actors? (from the spawn place), sorry my english is not that good so you must be very clear;)
oh and this:
/////////////////
Timer:
Every 10
--
Spawn Actor:
Spawner - in front of actor
Position: self.x - self.y
--
Destroy Actor:
//////////////
is in the example in front of layer;)
that is why I am finding a way to add a code to add those colors in certain scores, that code are like doors changing colors, so I need it at the start of the game and be seen at once, that is why I use that code, tshirts tutorials at youtube are different, coz blocks will spawn in time, unlike that code when you can see it at the start and change randomly..
so there are two ways to do that, add a code so at that score will produce 2 more colors in the same spawner or just destroy it and put a new spawner..
if score<200{
random (1,2)
etc.
}
if score<400{
random(1,4)
etc.
}
etc..
and blue = random 1
red = random 2
orange = random3
purple = random 4
etc.
is this what you mean?
wouter
--------------
Timer:
Every: 3 seconds
--
Change Attribute:
Change Attribute:game.random to random(1,2)
--------------
Timer:
Every: 5 seconds
--
Rule:
Attribute: game.random = 1
--
Spawn Actor:
1
-------------
Timer:
Every: 5 seconds
--
Rule:
Attribute: game.random = 2
--
Spawn Actor:
2
-----------------
Rule:
Attribute: game.score ≥ 200
--
Timer:
Every: 3 seconds
--
Change Attribute:
Change Attribute:game.random to random(3,4)
--------------
Timer:
Every: 5 seconds
--
Rule:
Attribute: game.random = 3
--
Spawn Actor:
3
-------------
Timer:
Every: 5 seconds
--
Rule:
Attribute: game.random = 4
--
Spawn Actor:
4
----------------
actually this works ok, but for the other one that I need I can't find a solution, I am thinking if I cant use that code I will try and use the same code as my other spawner, but the effect wont be perfect..
I hate codes, playing games is easier..hehe