How to add an in-level button
bsamargia
Member, PRO Posts: 8
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
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.
Here's a demo.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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
So when an actor touches something a wall rises?
Sort of like this?
Modified demo https://www.dropbox.com/s/m8yqz3qfygc0plc/wall demo modified.zip?dl=0
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.
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.
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?
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.