destroy/spawn actor problems

Hi there,
i'm new to gamesalad but i already love it. i want to make an arcade game like in the tutorials... but:
i want to have 3 different coins (A, B, C).
if the ball hits a C coin -> destroy that C coin & spawn a B coin instead*
if the ball hits a B coin -> destroy that B coin & spawn a A coin instead*
if the ball hits an A coin -> destroy that A coin
*of course exactly at the same place the old coin has been.
Question now is:
How to DO that?! Problem is, that i might have 5 C Coins, 3 B Coins and 10 A Coins in one level. And i just want to have that particular Coin the ball has hit altered/destroyed. Can I do this with just 3 actors (1xA, 1xB, 1xC-Coin) or do i have to make 18 actors with 18 x n attributes?
Any options?
i'm new to gamesalad but i already love it. i want to make an arcade game like in the tutorials... but:
i want to have 3 different coins (A, B, C).
if the ball hits a C coin -> destroy that C coin & spawn a B coin instead*
if the ball hits a B coin -> destroy that B coin & spawn a A coin instead*
if the ball hits an A coin -> destroy that A coin
*of course exactly at the same place the old coin has been.
Question now is:
How to DO that?! Problem is, that i might have 5 C Coins, 3 B Coins and 10 A Coins in one level. And i just want to have that particular Coin the ball has hit altered/destroyed. Can I do this with just 3 actors (1xA, 1xB, 1xC-Coin) or do i have to make 18 actors with 18 x n attributes?
Any options?
Comments
Love your username BTW, very clever!
not working right now. here is, what i've done so far:
coin C:
contrain attribute "game.coinstate" to 3 (integer)
rule: on collide with ball + if game.coinstate = 3 ->
- change image to coin B
- change attribute "game.coinstate" to 2
rule: on collide with ball + if game.coinstate = 2 ->
- change image to coin A
- change attribute "game.coinstate" to 1
rule: on collide with ball + if game.coinstate = 1 ->
- destroy
When i'm testing, the coin is instantly destroyed.
I just had to set the coinstate-attribute to 3 by default.
Problem NOW is:
It counts for EVERY Coin. So if Coin 1 gets 2 hits, Coint 2 is destroyed instantly, because the attibute is at 1. Is there a way to have it individual for every coin without having to have as many attributes as coins in the game?
if for Coin C i make this rule, everything works fine:
"if collide, change attribute self.image to Coin B" - works fine-
if i add a conditon for a 2. hit:
"- if collide, change attribute self.image to Coin B
- if collide + self.image is Coin B then change attribute self.image to Coin A"
-> does not work. Coin C jumps on first hit to Coin A. Any suggestions?