Hi xyloFUN .. I'm fairly new here .. but want to contribute as I am taking advantage of others help also. That said someone may want to correct me if any of this is wrong.

First create two actors (one the button, the other the object). Then create an attribute like ButtonTouch can be an integer and a value of zero.

Click on the button actor and create a rule 'when actor is touched' and add a behavior 'change attribute' and select the attribute ButtonTouch and change to 1.

Then click on the object actor and create a rule 'when attribute "ButtonTouch is 1' ... add a behavior 'Move to' and select Self.PositionX +50, a Y position which will match the height the object is already at and a speed.

then also add a 'change attribute' and change ButtonTouch back to zero.

simo103 said:Hi xyloFUN .. I'm fairly new here .. but want to contribute as I am taking advantage of others help also. That said someone may want to correct me if any of this is wrong.

First create two actors (one the button, the other the object). Then create an attribute like ButtonTouch can be an integer and a value of zero.

Click on the button actor and create a rule 'when actor is touched' and add a behavior 'change attribute' and select the attribute ButtonTouch and change to 1.

Then click on the object actor and create a rule 'when attribute "ButtonTouch is 1' ... add a behavior 'Move to' and select Self.PositionX +50, a Y position which will match the height the object is already at and a speed.

then also add a 'change attribute' and change ButtonTouch back to zero.

I believe that should be all you need.

This is correct. Just make sure when your chaning the attribute to 1 its in the touch is pressed rule, and in the rule when you change it back to zero its when touch is released. Let me know if you run into any trouble

I just tried to follow the instructions and experiment so that I wouldn't have to ask more questions but .... i have to!

I made the two buttons you suggested!

Where do I create the attribute "ButtonTouch" in the scene or on one of the 2 buttons??

Also, navigating to "Self.PositionX is hard because I can't type it in like in ActionScript. Maybe it was not possible to do because the attribute was not created correctly in the first place? I created it in the scene ... was that wrong?

the attribute ButtonTouch is created in the left upper window when looking at your scene (it should have Actors/Attributes/Devices at the top so click attributes and then click the + sign to add one. You will need to click on it to edit the name and make it ButtonTouch.

The Self.Position.X part you get when adding the moveto behavior ... where it show position: and a right arrow (ie: X axis) click on the 'e' .. then teh first down triangle and it should show three (or more items ... Game, Devices and then Actor names). select the Actor in which you are applying the behavior then Position in the next column that loads and then the X in the next column that shows. You will likely need to double click to get that to load into the field and then click the 'green tick' to apply

Simo103,THANK YOU for clearing that up and adding the extra information!

I was not able to get it working but because there has been so much information posted and daily more new users start to work with gamesalad, it would be an advantage and do it proper. In order to save you the typing, I will write out the tutorial and hopefully you or another kind soul will fill in the details

Goal:Have 2 buttons in a scene that move an image on the Y axis up or down by 50 pixels as often as clicked

1) add two actors to your scene, call one button and the other picture2) click on "Attributes" (beside Actors) and add and integer attribute with a value of 03 rename the attribute ButtonTouch (double click to rename)

4) double click the button actor which will open the attributes window bellow the button and to the right of the screen and new page where you can enter rules needed to give an actor functionality5) create a new rule > Actor receives event > touch > pressed6) drag "Change Attribute" behaviour into that rule: Change Attribute: game.Button.Touch ... > 1

Click the back arrow (left upper screen) once to leave the button attribute window

7) double click the actor names "picture (the second one we added at the beginning)8) add a rule > Attribute > game.Button.Touch ????? (i'm lost how to do this step?????????)9) drag an "Move to" behaviour onto the rule and select (again self. is not an option so I assume "Game" to begin with ????? can you please clarify this as well??

Please add what ever needs to be done to complete still

I know this is not easy but for those of us who are new to GS, this will help a lot so BIG THANKS for finishing this ))

9) double click the actor names "picture (the second one we added at the beginning)

10) add a rule and change the 'Actor receives event' (pulldown) to Attribute click the '...' part select 'Game' then 'ButtonTouch' set it to = 1 (which means when the attribute ButtonTouch is equal to one ie: the button has been pressed)

11) drag a moveto into that rule where it shows 'position:' and a right arrow (ie: X axis) click on the 'e' .. then the first down triangle and it should show three (or more items ... Game, Devices and then Actor names). select the Actor (which gets named 'self' automatically) in which you are applying the behavior (picture) then 'Position' in the next column that loads and then the 'X'in the next column that shows. You will likely need to double click to get that to load into the field, then type +50 and then click the 'green tick' to apply. so it should look like this: Self.Position.X +50

think that should do it. Work it thru and come back for further clarification if need be so we can get the instructions clear.

for 8) when game.button.touch is 1 then have your behaviors under it. And for 9) When you click on the ... to bring up the attributes, its will be game on top, then devices, then under devices will be the name of the actor thats where you want to click. Then go to position, and y. Then in the part where you state where you want to change it to do the same thing, make sure the position.y attribute is in the blue bubble thing, then click to the right of the bubble and type +50 then click the check mark to complete it. THat should do it for you

Put the following rule in the UP button:When touch is pressed, change attribute game.up to 1....OTHERWISE, change attribute game.up to 0

Put the following rule in the DOWN button:When touch is pressed, change attribute game.down to 1....OTHERWISE, change attribute game.down to 0

Next go into your moving actor

Put in the following rules:

1. When attribute game.up=1

change attribute: self.position.Y to self.position.Y+50

OTHERWISE....change attribute game.up to 0

2. When attribute game.down=1

change attribute: self.position.Y to self.position.Y-50

OTHERWISE....change attribute game.down to 0

If you wanted a left and right button then you would do the same but using the X axis rather then the Y axis...

And you do not have to use the move to behavior. Remember, the position of the actor is an attribute itself...take advantage of that

I just made a demo right now, its not letting me upload for some reason tho....email me at artonskyblue(@)gmail(dot)com and I can send over the game file to you if you still haven't worked everything out...

xyloFUN said:Also, do you know how I can cover an actor so that once it is bellow another actor, it is no longer movable?

thought I might give a go at my thoughts on the other part of your query whilst you see if our descriptions above help the first item.

In this case I think you need to create an attribute say 'Picture2_move' and set it to 1 (1 will mean Picture2 can be moved. Then put you move code into a rule which say when attribute 'Picture2' = 1 ... then the move code will run.

You will then need to create an attribute for Actor1 positionX and Actor1 positionY and have Actor1 code assign its self.position.x to the appropriate attribute and self.positionY likewise.

Lastly you would create a rule for Picture2 that says when attribute self.position.x = attribute Actor1_positionX and a second condition of that rule when self.position.Y = attribute Actor1_positionY then drag change attribute and have it set attribute Picture2 to 0.

thus when the images are in the same position attribute Picture2 is 0 which will not allow you move code to execute.

Haven't tried it myself but thought it would give you a place to start and for others to redirect you if I'm on the wrong tack.

If I can figure out why the iPad does not shut off when I run my own app AND when I close the app, WHY it does not start from scene one ... than I'm more or less ready to submit (did a lot of reworking everything)