Comparing Sprite Velocity Event???

This forum is currently in read-only mode.
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • 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
  • The expression for the X velocity is: Sprite[Platform].VectorX

    To compare that, you want to use the "Compare" action under the System object.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Have you tried some of the tutorials? It sounds like you're confused by the basic process of adding events and expressions.

  • 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

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)