How do I track the sequence a player does something?

0 favourites
  • 3 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi! I'm building a game in which the player will use a sprite to collect labels (on the right side of the screen in the picture below) in a specific order.

    I would like to keep track of the order the player collects these labels on the left side of the screen (in the timeline image). For example a player collects a the label "Deposition of Siltstone" and "Deposition of Siltstone" populates in the first spot of the timeline on the left. I would like for the way the timeline populates to be dependent on the order in which the player chooses to collect each label.

    I am beyond stuck as to how to accomplish this. Any help would be very much appreciated! Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Let's say you have Label sprite and TimelineLabel sprite, and both objects have the same set of animations. The default animation for TimelineLabel sprite is "Blank". Then you can do this:

    Player on collision with Label
    
    .. TimelineLabel Is Animation "Blank" playing
    .. TimelineLabel Pick nearest to (-1000000, 0)
    
    ...... TimelineLabel Set animation to Label.animationName
    ...... Label set collisions disabled
    

    This will pick the leftmost TimelineLabel instance which is still blank and assign it the same animation as the Label.

    Instead of choosing by nearest to position you can use an "ID" instance variable. Manually set IDs for each TimelineLabel and then pick an instance with the lowest ID.

  • Thank you!

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