Distance(Specific sprite)

For questions about using Classic.

Post » Sat Aug 14, 2010 4:20 am

Is there a way to make the distance event reference a specific instance of a sprite?

distance(Object.X, Object.Y, Cloud.X, Cloud.Y)

Say i have 10 Clouds, but want the distance to a specific one?
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Sat Aug 14, 2010 4:52 am

This is what object picking is for.

Here's the relevant wiki entry:

http://sourceforge.net/apps/mediawiki/c ... ct_picking
B
2
S
1
G
2
Posts: 35
Reputation: 870

Post » Sat Aug 14, 2010 5:31 am

well obviously since its an expression for use in an action its going to run within the context of certain conditions, those determine which object is used/picked.

(when i say object i mean sprite)
the conditions (things on the left) will specify under what conditions (hence the name) the objects will be picked, and then for every object that meets those conditions the actions referencing those objects or using them in anyway, be it through object specific actions, or through an expression reference like sprite.x will select the object(s) meeting the conditions.

this question is kind of odd to me, i feel your probably having a specific problem that would be better answered if you told us what it is. you need to build your conditions so that you refer to specific instance of the object, you cant just use ALWAYS and expect it to work, you either need to use variables, or some other circumstance under which the desired instance(s) will be picked

if your using system compare, that might be the source of your problem, since no instance of cloud can be specified. try making cloud have a variable with its distance, then comparing that instead. assuming this is the problem, of course. That way any cloud with 'PV distance' greater than X will be picked.

im not sure what else i can say.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests