Infinite jumper platform scoring (not distance)

0 favourites
  • 7 posts
From the Asset Store
Create the right kind of drama with Film Scoring Tools sound library!
  • Trying my brain at an infinite jumper, i got everything working but the scoring system.

    Right now i have:

    Event - platform on landed

    Condition - platform (family) > compare Y > platforms 'greater than' player.Y

    Problem is, if the player keeps jumping on the same platform it will add to the score.

    How can i get it so it will not continue to add to the score if the player just keeps jumping on the same platform.

    Thanks for any help and input.

  • Are the platforms separate instances of the same platform object? if so, give them an instance variable or boolean that toggles when the event first triggers/score is given. Then add a second condition into the landed event that checks that the variable/bool isn't set.

    So something like :

    Event - platform on landed

    Condition - platform (family) > compare Y > platforms 'greater than' player.Y

    Condition - hasScored(inverted) --------- give score, toggle hasScored true

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh yeah, works perfect. Thank you again,

  • I just noticed that your events don't actually count each/every platform.

    Example: if there is 1 platform a few pixels directly underneath another platform it will only count the platform the player actually landed on.

    I've been trying for a couple hours to mess with the code but just cant figure it out.

    If you could give some assistance...please.

  • What are you looking for it to do? Yeah the logic above is for when you land on a platform, what do you want to happen with nearby platforms? Not sure I fully understand the game mechanics you are trying to achieve. Why would there be another platform only a few pixels underneath another platform?

  • In the infinite jumper demo the platforms are created randomly (layout width -20) and when they hit viewport bottom, and at a random Y spacing 8, 80 pixels apart.

    Wen the game starts > player jumping. He jumps up from the 1st platform he is on > add 100 to Score.

    But there are other platforms next to and underneath the player (greater than Player.X, Player.Y)

    Those platforms (greater than) do not get scored unless the player has landed on them or untill they are destroyed.

    I'd like the platforms that the player DOES NOT land on but that are greater than Player.Y to be counted also.

    So if there are 5 platforms 20 pixels apart in a line on the Y axis, if the player jumps on to the highest plaform, those other 4 below the player are not counted until they reach the bottom of the viewport and are destroyed.

    So there are 2 scoring modes- when the player lands on a platform, that platform and ALL others GREATER THAN Player.Y are scored, AND when the platforms are destroyed, they are scored also.

  • So they are scored when you jump past them basically? I guess you could record the x,y of the player at the start of the jump and on landed, say for all platforms if y is greater then add score.

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