How do I write every time it's true?

0 favourites
  • 6 posts
From the Asset Store
It's here!
$4.95 USD
Creepy and nasty horror track. It's terrifying from the beginning till the end. Goosebumps guaranteed
  • C3/Mobile Game

    Every time the fairy makes it by the platform the game should add 1 to the score.

    If I have trigger once while true, it only adds 1 to the score - Ever! It doesn't add 1 to the score again when the fairy makes it by another platform.

    If I remove trigger once while true, well you know what happens then, it adds 980234532198457+ to score every time the fairy makes it by a platform with crashing in to it.

    I have it set to every tick set text to score, which you probably guessed.

    How do I tell the game each time the fairy makes it by a platform add 1 to score?

    drive.google.com/file/d/1la4UwGKxrqMJYOfrY6nIq0rH2amkHbqa/view

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since the platforms appear to be evenly spaced why don't you just make the score proportional to the character's distance traveled? Or if the background is scrolling, make the score proportional to the total amount scrolled?

  • That's only level 1, the rest won't be evenly spaced and there will be other things that come flying at the sprite. I need it to add one to score each time the sprite goes by the platform. Next, the score will need to add 1 after to goes by a falling anvil. So it needs to add 1 to score when whatever it gets passed something.

    I know there is away, I've seen it happen before, I just can't figure out how.

  • ,

    That's level 1. The next level is going to have falling anvils. The next level has uneven platforms.

    I need it to add one every time X goes by the fairy.

    I know it's possible. It's written like that in other games, but I can't seem to make it stick in this one.

  • Your event picks all platforms which are below the player. You need to exclude platforms which you've already counted. For example, you can disable their collisions and pick only platforms with enabled collisions:

    Platform Collisions enabled
    and Platform Y>Player.Y+18
    Trigger Once
    	Platform set collisions disabled
    	Add 1 to score
    

    Or use a boolean instance variable.

  • dop2000,

    Thank you. That worked.

    I can't wrap my head around how it works, but I'm impressed.

    Thanks again.

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