Actor shrinking

bds62bds62 Member Posts: 31
edited February 2014 in Working with GS (Mac)
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.

Comments

  • bds62bds62 Member Posts: 31
    Update. Originally, I had interpolate self.size.height to self.size.height-5.

    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.
  • Thunder_ChildThunder_Child Member Posts: 2,343
    Interpolate both height and width while button is pressed.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    There is a video on this over at GSHelper.
  • bds62bds62 Member Posts: 31
    @Thunder_Child Just did and It's still cropping image. http://imageshack.com/a/img823/9003/p0fx.png
  • bds62bds62 Member Posts: 31
    @FryingBaconStudios thanks buddy, I'll go check them seems they are the place to be for help :)
  • Thunder_ChildThunder_Child Member Posts: 2,343
    I clearly misunderatood..did not catch what you were saying. It looks like to me your original art was not centered inside the png file.
  • bds62bds62 Member Posts: 31
    Hey @Thunder_Child it's centered. I'm not new to Photoshop lol. I've become ok with the top crushing down.
  • Thunder_ChildThunder_Child Member Posts: 2,343
    Sorry bro...Im a noob...wasnt sure about your noobness. :D Sorry couldn't help. Hope you figure it out. I would not stop until I had a resolution myself.
  • bds62bds62 Member Posts: 31
    Haha not a problem. I'm a noob to GS. I'll figure it out eventually if not I move the anchor point to cent and top so the bottom flattens out and not top, look better I guess haha.
  • kolabokolabo Member Posts: 240
    Make a second image 45 x 45.
    - 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)
  • bds62bds62 Member Posts: 31
    edited February 2014
    @Kolabo that's what I was thinking I'd have to do but wasn't sure if there was a way to do in GS in an animated way. I did however forget I was going to do this as a last resort so thanks for the reminder haha.
Sign In or Register to comment.