Destroying Spawner Actor?

PangitQuestPangitQuest Member Posts: 12
edited November -1 in Working with GS (Mac)
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..

Comments

  • wouterwouter Member Posts: 174
    i don't get what you mean:
    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
  • PangitQuestPangitQuest Member Posts: 12
    yes, I was thinking of adding more actors to spawn at 200 but cant find a solution after searching in the forum and in the list of examples in making a new project, so I plan to destroy and replace it with a new one with more spawn actors...

    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..
  • wouterwouter Member Posts: 174
    euh don't know;) (am also new to gamesalad and not sure what real does xD)

    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...
  • PangitQuestPangitQuest Member Posts: 12
    I actually copied my spawn actor here, and it works great, but I cant find a way on stopping or adding more spawn actor, unlike with tshirtbooths tutorial at youtube, and thanks to entersimon I got what I want in that spawner..hehe

    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
  • PangitQuestPangitQuest Member Posts: 12
    just bumping this, can anyone help me about this or it cant be done in GS, thanks in advance..
  • wouterwouter Member Posts: 174
    mmm can't see the game (too long loading or something).

    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^^)
  • PangitQuestPangitQuest Member Posts: 12
    I get that too, maybe too much activity that is why its slows down, same with the forum, its like it is slowing down from time to time..

    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
  • wouterwouter Member Posts: 174
    just destroy the old actor??

    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?)
  • PangitQuestPangitQuest Member Posts: 12
    the ones that I posted in my first post..
    -------------------------------
    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
  • wouterwouter Member Posts: 174
    sorry but i don't see what you mean!

    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;)
  • PangitQuestPangitQuest Member Posts: 12
    there are for example 2 colors, blue, and red, when the score reach 200 I want to add orange and purple, then at 400 add 2 more colors like yellow and green and so on..

    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..
  • wouterwouter Member Posts: 174
    so make first
    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
  • PangitQuestPangitQuest Member Posts: 12
    actually my other spawner actor is configured like this..

    --------------
    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
  • wouterwouter Member Posts: 174
    haha xD
Sign In or Register to comment.