GameSalad

Howdy, Stranger!

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

How to add an in-level button

Hello all.
I have a hopefully simple question that I can't seem to find the answer for.
So in my game, our character can stand on his toes, essentially tippy toeing around, and I want to include in the tutorial a button that the player must press in the game to raise a wall barrier, by standing up higher and pressing the button with his elevated stance.
The problem is, I am fairly new to GameSalad, so I am unsure as to how to do so. I would really appreciate the help with this. Is there some kind of pre-made function for this, or do I have to add it myself? Please, if possible, respond as soon as possible.
Thanks-
B

Comments

  • ToqueToque Posts: 1,165Member

    Hmm. Not exactly sure what you want but....

    Add Game attribute. “Raise walll”

    Whatever triggers your Button

    Change attribute game.Raise wall true.

    In You wall you will need rule.

    Attribute. Game.Raise wall true

    Move your wall up.

  • tatiangtatiang Posts: 11,408Member, Sous Chef, PRO, Senior Sous-Chef

    Here's a demo.

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

  • bsamargiabsamargia Posts: 8Member, PRO

    @tatiang said:
    Here's a demo.

    While this is similar to what I had in mind, this is not what I am looking for. I am looking for something similar to when Mario would find a p-switch in a level, as a character he would press the button and something would happen. I am looking for something similar to this, where the in-game character would press the button and then the wall would raise

  • ToqueToque Posts: 1,165Member

    So when an actor touches something a wall rises?

  • ToqueToque Posts: 1,165Member
  • bsamargiabsamargia Posts: 8Member, PRO

    Yes, this is pretty much what I am talking about. The only difference between this and my idea is that the character will press the button, which is basically on the floor or ceiling, and the button will recess into the ceiling or floor, the wall will open, and then it will stay open. I'm curious as to how I could do this.

  • pHghostpHghost London, UKPosts: 2,283Member
    edited December 2017

    @bsamargia said:
    Is there some kind of pre-made function for this, or do I have to add it myself?

    GameSalad doesn't really have pre-made functions of this sort. The blocks in GameSalas enable you to build logic and activate physics without needing to learn to code.

    But you still need to put together the logic and maths of what you want to happen. Whenever you are struggling with something and a user on the Forums here helps with a solution, make sure to go through the logic they supplied and try to understand what they did and why. Ask followup questions to clarify, if necessary. That's really the best way to grow in becoming a GS master. ;)

  • ToqueToque Posts: 1,165Member

    Yes. In my (our) demo the player touches button and door opens.

  • bsamargiabsamargia Posts: 8Member, PRO

    @Toque said:
    Yes. In my (our) demo the player touches button and door opens.

    Oh, well then yes, I guess that could be it, then. Would there be a way to have the button be recessed into the floor or ceiling when it is pressed, and stay pressed?

  • Twayne2Twayne2 Posts: 304Member, PRO
    edited January 4

    Have the button actor just move to a certain position that you want...?
    Or have the button shrink so that it looks like it is ''pressed''?

  • bsamargiabsamargia Posts: 8Member, PRO

    @Twayne2 said:
    Have the button actor just move to a certain position that you want...?
    Or have the button shrink so that it looks like it is ''pressed''?

    The button shrinks into it's holder, making it look like it is pressed. The way that I have it set up is that behind the button holder is a stopper, that when the button is pressed, it is pushed up, collides with the stopper, and rests there, giving the look of being pressed. I'm curious as to how I could incorporate the button mechanics with this.

Sign In or Register to comment.