How to make straight movement between 2 actor with touch movement ?
Haris01
Member Posts: 8
Hi.. i want to make my actor(actor1) can move foward backward straight with touch movement between 2 actor or 2 position x,y(actor2) to x,y(actor3). I already know to make straight movement x to x or y to y. I'am new in GameSalad. Help me please..
Best Answer
-
Socks London, UK.Posts: 12,822
@Haris01 said:
Yes.. that image... can someone teach me how to do that ?Constrain X position to:
max(100,min(800, game.Mouse.Position.X ))
Constrain Y positon to:
( self.Position.X /2)+200
. . . . . .
Obviously you would need to play with the values to get what you need.
Answers
Hello @Haris01,
Can you please be more specific with what you are trying to accomplish. A bit confused.
Thanks
So you want the player to tap on actor2 and have actor1 move to actor2 and then when the player taps on actor3, actor1 moves to actor3? By the way, are you using a Mac or PC?
Edit: here's a little demo made on the Mac.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Sorry, make you all confuse.. what i mean is the rule more like this..
Rule:
When touch is : inside
do
Constrain attribute
Constrain : self.position.X to max(self.Actor Min , min(self.Actor Max, game.Touch.Position.X ))
this will move my actor min and max only in X position,
what i need is my actor will move between min(as actor2 location) and max(as actor3 location. When i change actor2 and actor3 location, my actor(actor1) still move depend actor2 and actor3 with any angle and distance. Example, i change Actor2 in position X=0,Y=0 , Actor3 in position X=10,Y=10. so, actor1 will move in 45 degree from 0,0 to 10,10.
One more sorry if make you all confuse. Maybe because i'm not familiar with terminology GameSalad or my english is bad..
sincerely hope
Thanks Tatiang for your little demo, I appreciate it..
I'm using pc, nevermind if your demo made on mac..
does anyone can help me ?
In the demo I attached, I created two real attributes called game.targetX and game.targetY. In actor2 and actor3, If Touch is Pressed change attribute game.targetX to self.Position.X and change attribute game.targetY to self.Position.Y. In actor1, if Mouse Button is Down moveTo game.targetX, game.targetY relative to scene at whatever speed you want (I used 150).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
i can't see an image.... this project make my brain freeze....
https://picasaweb.google.com/112108030239991017713/2015011903?feat=embedwebsite
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes.. that image... can someone teach me how to do that ?
That the answer..
so.. i make new rule here...
I made a demo for this a while ago. I'll see if I can find it.
Edit: Found it:
http://forums.gamesalad.com/discussion/comment/488023/#Comment_488023
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Yes Armelline, but i need your 'red actor' speed follow my finger..
However, thank's because enlivened my question.. after 1 month headache.
i give u (*)