Comparing Sprite Velocity Event???

For questions about using Classic.

Post » Tue Mar 10, 2009 3:31 pm

Okay, I've been racking my head trying to figure this out.

I want to create a compare event that tests the speed, particularly the x-component of the current velocity, of a Sprite object. However, the closest expression I found was under the Platform Tab (Is moving), which doesn't let me check the actual value.

There is an event for comparing a private variable, and if you click on that, it shows some icons of the various sprites. If I click on that one, it shows the following fields:

Private variable
Comparison
Value

And than below all that, it shows some icons of the various sprites in my project. If I double-click on the sprite in question, it brings up a window called Construct : New expression, and if you look under the Platform tab of that window, it has a much more expansive list(I'm not going to list them all), but here
are some:

Get air deceleration rate
Get jump strength
Get gravity
Get angle of motion
**** Get X component of motion <---- I think I want this one.
etc.

I noticed that they all start with 'get', so I'm not quite sure if those are what I'm looking for. Unfortunately, clicking on one of these fields and than clicking on 'Next' just returns me to the Compare a private variable New condition window and doesn't seem to do anything.

Please help, am I missing something here?

Thanks,
- cacotigon
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Tue Mar 10, 2009 3:55 pm

The expression for the X velocity is: Sprite[Platform].VectorX

To compare that, you want to use the "Compare" action under the System object.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Mar 10, 2009 3:56 pm

Have you tried some of the tutorials? It sounds like you're confused by the basic process of adding events and expressions.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Mar 10, 2009 4:35 pm

Huzzah, thanks linkman2004, that did it. I guess I didn't expect a object's property comparison to be in the System event list.

@Ashley: <abashed look> hehe. yeah, I went through the platform tutorial, but I haven't finished watching the rest of them. Apparently, I should!


@devs: This is really an amazingly cool dev kit, thanks very much for creating it!!!


Thanks,
-- cacotigon
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Tue Mar 10, 2009 4:37 pm

Something to bear in mind from a logical viewpoint is that this isn't the object's property comparison being in the System object, it's just an expression of an object which can be compared by the catch all system comparison condition. Generally this will be how you do comparing.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Mar 10, 2009 7:45 pm

Weird bug found:

https://sourceforge.net/tracker/index.p ... id=1003219

I was making up a test to show the difference between System: Compare and an object's Pick by Comparison conditions when I ran into it. The Pick by Comparison seems to be selecting the incorrect instances of objects.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests