Nooby Question how to use Touches to move up then when letting go of the touch move down
Synlight Development
Member Posts: 3
Hey there guys!
As I finish up on my first GameSalad game (thank you all for the help in learning) I'm trying to finish my controls. I would like to move the actor up upon touching the screen then when letting go the actor falls down. As well as figuring out how to keep them from going off the screen. Now iv used the move with touch to move up but getting the actor to stay on the screen as well as come down is my troubles. Just looking for a direction to move with I don't mind playing with it from there.
Thanks in advance!
As I finish up on my first GameSalad game (thank you all for the help in learning) I'm trying to finish my controls. I would like to move the actor up upon touching the screen then when letting go the actor falls down. As well as figuring out how to keep them from going off the screen. Now iv used the move with touch to move up but getting the actor to stay on the screen as well as come down is my troubles. Just looking for a direction to move with I don't mind playing with it from there.
Thanks in advance!
Comments
.....Constrain Attribute self.position.Y to min(game.mouse.position.Y,768-self.Size.Height/2)
*768 is the scene height.
And if you also want to constrain to the bottom of the scene, change it to:
When Touch is Pressed
.....Constrain Attribute self.position.Y to max(0+self.Size.Height/2,min(game.mouse.position.Y,768-self.Size.Height/2))
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
1. Only if you touch the plane will it move up
2. When the plane is touched it is still going off of the scene
3. When releasing the touch the plane is not going down
Not sure if I am entering that wrong
Thanks!
1. isn't that what you wanted?
2. height of 768 is for iPad---adjust if you are using iphone or whatever
3. do you have a 'when touch is released' rule---(touch pressed go up and touch released go down)
cheers
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User