spawn Actor After 2 Collisions

gamedivisiongamedivision Member Posts: 807
edited November -1 in Working with GS (Mac)
hi i need to spawn an actor after 2 collisions,i know how to destroy an actor after 2 collisions but not spawn an actor

thanks

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    make a actor attribute
    named self.collide

    make a rule:
    if actor collides with something
    Change attribute:
    self.collide to self.collide + 1

    add a rule
    If self.collide = 2
    then spawn something.

    Hope it helps...
  • gamedivisiongamedivision Member Posts: 807
    works great but,
    for explanation issues the bird actor will spawn an egg actor after 2 collisions,the only problem is im recycling my bird actor and it will only spawn one egg actor no matter how many times i hit it, bird is flying from one side of the screen to the other ,
    ideal situation would be bird will spawn 1 egg after 2 hits, every time it passes

    anyone have any ideas

    thanks
  • gamedivisiongamedivision Member Posts: 807
    i solved it
    self attribute
    rule when actor collides with rock
    self.SpawnEgg to self.SpawnEgg+1
    new rule
    attribute self.SpawnEgg = 2
    spawn actor egg
    new rule
    attribute self.position.X is greater than 990
    change attribute
    self.SpawnEgg to 0

    his recycle x position is from -36 to 993
Sign In or Register to comment.