GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Change Size

ktortiktorti Posts: 27Member
edited February 2014 in Miscellaneous
Hello all, I've been working on an app, and I'm nearly finished but have one last problem!

Basically, when my character jumps you have the ability to change size by pressing the up and down keys; up is small, down is large. But I can't figure out how to cycle through the sizes, small, large, and original. Right now when I press up, my character becomes small, and when I press down it gets big, but I can't get it to cycle through the different sizes.

Any advice would be appreciated!

Comments

  • AppTacoAppTaco Posts: 125Member
    Hey there, basically all you have to do is make six rules in your actor.

    Rule#1 If self.height is 100 (saying that the original height is 100) and button up arrow is pressed, then change attribute self.height to 150.

    Rule #2 if self.height is 150 and button up arrow is pressed, then change attribute self.height to 50.

    Rule #3 if self.height is 50 and button up arrow is pressed, then change attribute self.height to 100 (back to original height).

    Then you can do the same thing for the down arrow, switching it around in whichever order you would like.

    Good luck on your app!

    Josh
  • ktortiktorti Posts: 27Member
    Okay so, right now it starts at 50hx30w. When I press up the size changes to 25x15. When I press down from the original size the size changes to 100x60. But when I press down from the smallest it goes directly to the largest. It can't seem to make it go from small, to medium, to large or vice versa without it jumping directly between the smallest and largest

    Right now I have 4 rules:
    1. when height is 50 and key up > change height to 25 change width to 15
    2. when height is 25 and key down > change height to 50 change width to 30
    3. when height is 50 and key down > change height to 100 change width to 60
    4. when height is 100 and key up > change height to 50 change width to 30
  • ktortiktorti Posts: 27Member
    I have one last problem to face with my app. Basically when up or down is pressed my character will change sizes (up to be smaller, and down to be larger).

    Okay so, right now it starts at 50hx30w. When I press up the size changes to 25x15. When I press down from the original size the size changes to 100x60. But when I press down from the smallest it goes directly to the largest. It can't seem to make it go from small, to medium, to large or vice versa without it jumping directly between the smallest and largest

    Right now I have 4 rules:
    1. when height is 50 and key up pressed > change height to 25 change width to 15
    2. when height is 25 and key down pressed > change height to 50 change width to 30
    3. when height is 50 and key down pressed> change height to 100 change width to 60
    4. when height is 100 and key up pressed > change height to 50 change width to 30

    What can I do to be able to be able to key between each size without going in a circle between sizes? Imagine a character traveling on the z plane moving further and closer to you.
  • tatiangtatiang Posts: 11,796Member, Sous Chef, PRO, Senior Sous-Chef
    [merged threads]

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • AppTacoAppTaco Posts: 125Member
    edited February 2014
    Alright. The problem with the rules that you have are that they are using a greater than function instead of using an equals function.

    Try, when height = 50 and key up pressed, change height to 25 change width to 15 etc...
Sign In or Register to comment.