Destroy actor then replace with a different actor
This seemed easy enough but I am having some issues. Basically I am destroying an actor with certain points associated with it then I want to replace it with a different actor in the same location worth more points.
i.e. Single grape worth 10 points, replaced with a vine of grapes worth 100 points in the same location.
I appreciate your help.
Thanks guys
i.e. Single grape worth 10 points, replaced with a vine of grapes worth 100 points in the same location.
I appreciate your help.
Thanks guys
Comments
You could use the same actor if you wanted. Have a self attribute called points. Have that set to 10 and the image set as the single grape. Then whenever you want to replace it change attribute points to 100 and change image to vine image. Also use change attribute behaviors in there to change the size to the size of the new image if its bigger.
Then if you wanted you could use particles or interpolate the alpha out and back in during the switch for a transition or poof affect
To clarify, "ball" collides with grape, image changes to vine of grapes, then when "ball" collides with vine of grapes the vine is destroyed.
Thanks for your help
I would do it like this. In the single grape have 2 attributes, one called points (set that to 10)and one called hitCount (set that to 0)
Have a rule when actor collides with ball
-change image to vine of grape image
-change attribute points to 100
-change attribute hitCount to hitCount+1
then have one more rule when attribute hitCount =2
-destroy actor
cheers