Have any way can let actor move around the rectangle?
Weiyu
Member Posts: 216
I have a problem about how to let actor move around the rectangle ?
I know Gamesalad can use "cos(angle)" and "sin(angle)" to move in circle.
On the other hand, have any way can let actor move around the rectangle?
Thank you.
Comments
The Move behavior allows for any degree from 0 to 360. So yes, you can specify movement in 90° amounts.
Since you mentioned cos and sin, I'm guessing you want automatic movement "around the rectangle." You could do this with a few Timers, I suspect.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
How can you make an actor move in a circle using sin and cosine? I am just curious.
One way to do this would be to use waypoints, I've attached a quick demo. I also have a more detailed tutorial on the concept if you want to check it out:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
This is very useful advice and tutorial video.
Thanks for your kindly help, I really appreciate it.
you can constrain self.position.x to A * cos(self.time*B )+C
and constrain self.position.y to A * sin(self.time*B )+C