How do I randomly select a sprite's image point?

Get help using Construct 2

Post » Thu Aug 06, 2015 1:41 am

Hi, i'm trying to get a pathfinding sprite to "return" back to its base (another sprite). I want the pathfinding sprite to go to 1 of 4 locations on the base sprite, mapped using image points.

My only problem is I don't know the language for the action- it should be something like:

find path to > base.imagepointx(random)
base.imagepointy(random)

I don't know what I'm doing wrong and I've been googling for hours can someone help me?
B
4
Posts: 27
Reputation: 254

Post » Thu Aug 06, 2015 2:50 am

@KyleSousDor

set a global (or local) variable ReturnPoint to > Choose(1,2,3,4)

then find path to > base.imagepointx(ReturnPoint) base.imagepointy(ReturnPoint)



that assumes that imagepoint 0 is the origin and not one of the possible return points...
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Thu Aug 06, 2015 5:00 am

thank you!
B
4
Posts: 27
Reputation: 254


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 49 guests