How do I add a 'life timer' to reward player for not dying?

0 favourites
  • 4 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I'd like to reward the player with a single power-up if they can go X minutes without dying.

    I've looked at game time but that won't let me. Timer behavior doesn't seem to work either.

    I also thought about adding dt to a GV. Then if that GV is equal to X minutes (secs) reward the player and reset the GV.

    Would this work?

  • Should do, yeah. Or 'wallclocktime' might help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using your GV:

    Initially (or at Start of Layout) set GV to [X minutes] * 60.

    Every Tick | GV-dt

    If GV <= 0 | [Reward the Life Timer]

    I don't know what you mean by life timer but I'm assuming it's a timer of your player's life that starts at a certain amount and decreases?

    If so, you need more variables. Say:

    LT [Life Timer] = [Your desired life]

    IsRewarded = 0

    You would then add:

    If GV <= 0 | [Reward the Life Timer] Set IsRewarded to 1

    If IsRewarded == 1 | LT-dt

    If LT <= 0 | Set LT to 0 (So your life timer won't go negative.)

  • No. Nothing that complex. It's just to see if the player can play (say 10 mins) without dying, they get a reward.

    After i fix this 1 bug that popped up, gonna try it out.

    Thanks for the replies.

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