How do I use an arbitrary expression for a condition?

Get help using Construct 2

Post » Wed Oct 21, 2015 12:34 am

I need to have, as a condition, a test for the distance between the sprite and a certain target point.

Currently I'm doing it in this ugly way:

Four conditions:

target X < self.X + 10
targetX > selfX - 10
targetY < self.Y + 10
targetY > self.Y - 10

This works but I feel like if I could have an arbitrary expression, then I could simply have one condition that went something like Distance(self.X, self.Y, targetX, targetY) < 10

But what kind of condition do I need to make where I can enter an arbitrary condition. This seems like a very powerful thing one could do (arbitrary expressions on a particular obect for a condition. But I don't see a way to do it.
Posts: 33
Reputation: 345

Post » Wed Oct 21, 2015 1:58 am

It's under "system" when adding a condition. The two relevant ones are:
"Compare" and "pick by comparison". The first one doesn't do any object picking.
Posts: 5,241
Reputation: 67,768

Post » Fri Oct 23, 2015 11:39 am

Thanks that eliminated my issue at a rate of one issue per second.
Posts: 33
Reputation: 345

Return to How do I....?

Who is online

Users browsing this forum: Maverick1912, Sparkz and 3 guests