Actor shrinking
bds62
Member Posts: 31
Hey all,
So I have an actor I want him to shrink to be able to fit under a platform to collect a coin. This will be achievable by pressing the down key. Then when the key is not pressed (up) he will return to normal size.
In my key down press rule I had change size with a function of self.size.height-5 When I previewed and performed the action my character stayed the same size but shot up and flew off screen, odd.
So I switched the Change Size behavior to Change Attribute self.size.height-5. While this worked, it didn't shrink the image (a ball) so the top part became flat. Also if I held the down key it would continue on until the image is gone (don't have a return to size when key is released put in yet).
During my research on youtube and in the forms I found a video of a guy changing size via buttons that are on screen through game attribute but they continued to shrink until he'd hit + button the same amount of times he pressed - to stop it... No bueno...
I came across this post on the forums http://forums.gamesalad.com/discussion/23825/shrink-and-then-grow-problem-need-help and liked the animation effect of the @LudwigHeijden response using interpolate.
But using interpolate with self.size.height-5 it continues shrinking until it disappears. AND still flattens the top.
So, is there a way to change size of the actor without the image being cropped? Also, is there a way to make a set size to go to?
It's size is 50X50. I need it to go to 45x45 without cropping image. I tried setting self.size.height45 and nothing happened and also tried self.size.height45px and nothing happened.
I'm feeling this can all be achieved fairly easy and I'm just not seeing it.
So I have an actor I want him to shrink to be able to fit under a platform to collect a coin. This will be achievable by pressing the down key. Then when the key is not pressed (up) he will return to normal size.
In my key down press rule I had change size with a function of self.size.height-5 When I previewed and performed the action my character stayed the same size but shot up and flew off screen, odd.
So I switched the Change Size behavior to Change Attribute self.size.height-5. While this worked, it didn't shrink the image (a ball) so the top part became flat. Also if I held the down key it would continue on until the image is gone (don't have a return to size when key is released put in yet).
During my research on youtube and in the forms I found a video of a guy changing size via buttons that are on screen through game attribute but they continued to shrink until he'd hit + button the same amount of times he pressed - to stop it... No bueno...
I came across this post on the forums http://forums.gamesalad.com/discussion/23825/shrink-and-then-grow-problem-need-help and liked the animation effect of the @LudwigHeijden response using interpolate.
But using interpolate with self.size.height-5 it continues shrinking until it disappears. AND still flattens the top.
So, is there a way to change size of the actor without the image being cropped? Also, is there a way to make a set size to go to?
It's size is 50X50. I need it to go to 45x45 without cropping image. I tried setting self.size.height45 and nothing happened and also tried self.size.height45px and nothing happened.
I'm feeling this can all be achieved fairly easy and I'm just not seeing it.
Comments
I now have it at: interpolate self.size.height to 45 (when down 50 when up) and it works great.
I still am having image clipping happening as it makes the top flat but will deal with it and if I can't find a fix to this will just work it into the game I suppose.
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
- Then add a change image behavior to the rule:
- change self.size.height to 45 (when down 50 when up)
- change self size.width to 45 (when down 50 when up)
- change image to smaller image (when down and larger when up)