need help getting actor to move to the mouse click
![bootp](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I need my actor to move towards the mouse automatically so you don't have to keep the mouse pressed. I would like screenshots as I've seen processes talked about but don't understand acne need screenshots or a video. Will be very grateful.
Regards
Niall
Regards
Niall
Comments
Basically if you want your actor to move towards the mouse coordinates other than when the mouse is down, simply change down to up.
If you can't find the help file, here's one way of doing what you're after:
Make a boolean attribute called Go
Put one actor over the complete scene to register the mouse clicks/touches.
In its Rules:
When actor receives event: mouse button is down
Change Attribute game.go To false
When actor receives event: mouse button is up
Change Attribute game.go To true
And then in the following actor's Rules:
When Attribute game.go is true
Move To Behaviour: in the X box put game.Touches.Touch1.X and in the Y box put game.Touches.Touch1.Y
Relative to Scene, speed whatever you want; keep Run to completion unchecked.
Hope that helps!
:-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
anyway here it is
http://gamesalad.com/ontheappstore/23468
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Regards
also watch these vids
http://www.youtube.com/user/GameSaladCookbook#p/
______________________________________
http://www.gamesaladforum.com/
screenshots
very new like an hour new.
try my demo
even with plug in
can you describe how to get the actor to move towards the last click position please
I will really appreciate your help.
I've got the idea that, seeing as you've just started, you haven't even run through any help stuff at all, so OK, I'll run through it for you step by step:
• Make a boolean attribute called Go
An attribute is a variable, if you are familiar with any sort of progging. If not, it's a way of giving something a value, then the ability to change that value. There are different types of attributes, you'll find explanations in the help files, etc. The one we want is a boolean. This type of attribute can be considered a switch, or true and false.
In the Game Inspector, click on the button marked "Attributes". you'll see there are some already there as default.
Now click the + sign. A dialog will appear to pick a type. Boolean will already be selected. Click Choose. The new attribute will appear at the end of the list. Double-click the words "New Attribute, and rename it Go, press return. (You can name attributes to whatever you want). You'll notice the check box is unchecked; leave it like that. This means that the attribute Go is set to 0 (zero) or false.
• Put one actor over the complete scene to register the mouse clicks/touches.
Click on the Game button, add a new actor with the + button.
Drag the actor onto the stage/screen. Move it to the top left corner of the screen and hold down on the bottom right of the actor and drag it to the bottom right of the screen. Then double-click it. This'll bring you to the actor's editor page where you can put in Rules.
There are two types of Actors: Prototypes and Instances. You can learn about these from help files/vids, etc.
Click on the button in the top left corner which is called Edit Prototype. Click on button in top right which is marked Create Rule.
In the behaviours list on the left, drag the behaviour called Change Attribute to where it says Drag your behaviors here (first one). Click on the 3 little dots, the Attribute Browser will appear, so we can find our attribute we made. Click on Game then in the next column, double-click on Go. Now after where it says "To:' click in the box and type the word false.
Hold mouse down on the grey bar at the top, where it says Rule, and with alt held down, drag down so that a copy is made. Where it says "down" in this second one, hold it and select "up".
Now change false in this second one to true.
Click on the Scenes icon and select Initial Scene. Make another actor, drag it onto the screen. Double click it. In the left column, click the white box next to Color, select a colour.
Click on Edit Prototype button. Click on Create Rule.
Hold on "Actor Receives event and select Attribute. Find "Go" again by clicking on the three little dots.
Drag over a Move To behavior from the list on the left.
click on the first "e" symbol, this brings you to the Expression Editor. Click on first down arrow, click on Devices, then Touches, then Touch 1, then double click the X. Click green tick symbol.
Click the second "e" symbol, same as above except at the end pick "Y". You can experiment with the speed later, but for now, make it 100.
OK, if you run through all that step by step, it'll start to click into place for you. Good luck!
:-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps