Changing Actors During play
![randomunicorn](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi everyone. I am currently building a game and have got to a point I can't advance past. I have a red ball on the screen that the player moves around the screen to smash red blocks. I am wanting to introduce a block that when collided with changes the red ball to blue and that blue ball will smash the blue blocks only. (and another block to change the ball back to red ball to smash the red blocks only) I have tried "change image" but it doesn't work. Any instructions on how to do this will be greatly appreciated.
Random Unicorn
Random Unicorn
Best Answers
-
gyroscope I am here.Posts: 6,598
Hi @randomunicorn
You'll need a boolean, let's call it RedorBlue.
Add a condition in your Rules of your prototype ball: When attribute RedorBlue is false
--- then your red smash/collide rules for red blocks
otherwise
--- then your blue smash/collide rules for blue blocks
Add into the red blocks:
When colliding with ActorBall,
when RedorBlue is true
Change Attribute RedorBlue to false
Change image (---to red ball image--- this should work fine; if the balls are just colours though, you don't need this, just change the colour from blue to red, of course)
Add into your the blue block(s):
When colliding with ActorBall,
when RedorBlue is false
Change Attribute RedorBlue to true
Change image (---to blue ball image--- this should work fine; if the balls are just colours though, you don't need this, just change the colour attributes from red to blue, of course)
...something like that; this is off the top of my head but should work out.""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-
Braydon_SFX Posts: 9,273
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Answers