Destroy actor then replace with a different actor

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

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Hey There,

    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
  • DreamLabDreamLab Member Posts: 2,127
    EDIT: john beat me to it :)
  • GrubGamesGrubGames Member Posts: 77
    Hey John you ROCK on these forums.. you helped me out a couple days ago too. One last thing.. the same "ball" actor that initiates the change image will also destroy the vine of grapes. Any pointers on doing this correctly?

    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
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Glad i could 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
Sign In or Register to comment.