Change Image with buttons!
Mr.Noname
Member Posts: 37
Hey all,
I want to know how can I change my actor by pressing buttons.
Here an better description: When I press button 1 I want to change my actor in an rectangle when I press button 2 in a triangle and when I press button 3 in a circle.(ps: when I press button 1 I want it to change in a rectangle again and so on)
I hope you can help me with this problem
thanks in advance
Comments
getting the graphics to swap is easy, changing the collision shape is not as easy. Pluss game salad really just does circle/oval/elypses & Squares/rectangles, if they added triangles thats news to me.
there is a change graphic script that will instantly swap images of your actor, this choppy change can be masked with fancy particles. this would be the most simple method and require the least effort.
you could technically animate each morph, no problem , maybe even work out some cool inbetween shapes. using this logic
if player.shape =1
and
if button 2 is pressed
Play animation 12
else if player.shape = 2
and
if button 1 is pressed
play animation 11
This is simple to do. First off make sure you have a real game attribute. Lets call it Button_Pressed. In each of your buttons when they are pressed you need to make the Button_Pressed attribute equal the button being pressed.
In Button 1, have a rule;
-When touch is pressed
-Change game.Button_Pressed to 1
In Button 2, have a rule;
-When touch is pressed
-Change game.Button_Pressed to 2
In Button 3, have a rule;
-When touch is pressed
-Change game.Button_Pressed to 3
Next, in the shape actor you will have 3 rules.
-When game.Button_Pressed = 1
-Change Image to Rectangle
-When game.Button_Pressed = 2
-Change Image to Triangle
-When game.Button_Pressed = 3
-Change Image to Circle
If you have more buttons and shapes you want to add, just continue adding new rules. Hope that helps and is what you are looking for.
Killer Penguin Studios
Thanks @KillerPenguinStudios this helped me a lot , but how can I change there sizes?
I tried a lot but I dont know how to change the 3 actors sizes!
I hope you can help me with this