Heartbeat Gradual Speed Increase [Solved]

0 favourites
  • 7 posts
From the Asset Store
Have you ever dreamed of playing in a Speedball game or tournament?
  • Hi,

    This is a bit of a head scratcher (for me at least), it appeared simple at first, but then I became steadily stumped!

    A beating heart sound, two sound samples played apart, but gradually playing slight faster over a few minutes - the samples stay the same length, just the time between them needs changing and the trigger.

    But the issue is that the Event has to be in sync at the same time, decreasing with the spacing of the heart beat samples, otherwise, you get the two beats close together, but the Event ends up too slow or fast starting them playing the next time around. Maybe I'm doing it all wrong, and there's an obvious way and I'm not thinking logically.


  • Something like this? This is a single heart beat sound sample though.


    Could be refined further by using different sound samples for faster heart rates ( sounds realistic up to 120 bets per minute, after that I would switch samples ) , but events pretty much stay the same

  • Thanks, no not exactly what I was looking for.

    The best similar example to explain would be to say Atari Asteriods beat. That's exactly what I'm looking for.

    Broken down in my head...

    Timer_vairable = amount of seconds

    Trigger started by Timer_vairable for Event that plays two different sounds each seperate by Timer_vairable

    Reduce Timer_vairable by an amount

    But what kind of trigger can start an Event and also be used like a Wait to place between two playing sounds?

    There has to be something obvious I'm missing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Then I would have a global variable, something like "whichsound" if whichsound = 0 you play sound 0, and switch variable to 1, so next time event is triggered it plays sound 1 and switches back to 0. Sounds will alternate and you only need a single trigger.

    In my sample you have a variable ( call it triggersound or whatever ) that's reduced by 1 each tick, from 60 to 0. When it reaches 0 event is triggered and variable reset to 60 to start the countdown again . Now 60 is the starting value stored in a variable called stress. You simply set this to stress = 30 and sound will be triggered twice as fast, you can set it to anything to speed up or slow down triggering. That stress variable can be set by anything you want ( in my sample by position of the square you drag ).

    To simplify ( hopefully )

    soundvar = 0

    rate = 60

    triggerspeed = rate

    System Every Tick > subtract 1 from triggerspeed

    if triggerspeed = 0 trigger sound ( 0 or 1 )

    If sound 0 played, set soundvar to 1 so next time it plays sound 1 ( and the other way around )

    set triggerspeed back to rate

    Changing rate variable will speed up or slow down triggering of sounds

    I am sure there are other ways to do it, but I am used to using timers like this.

  • I was on the right track, I knew it was going to be simple.

    I have a Global Variable 'Beat_Timer'

    I trigger the Event with 'Every X Seconds' (using Beat_Timer)

    Then in the Event I just added the beat sound effect 1

    Wait Beat_Timer

    I added another Event for the beat sound effect 2

    Using System I subtracted a small amount from Beat_Timer

    That was it! The problem I had originally was that I had used another Wait after the last sound effect thus putting it all out of sync.

    Anyway, thanks.

  • in catapult physics templet how can I move the block according to pig and on touch end spawn another pig too hit again anyone knows please help me.

  • in catapult physics templet how can I move the block according to pig and on touch end spawn another pig too hit again anyone knows please help me.


    Stop hijacking threads that have nothing to do with your problem.

    Also, using the Reporting system just to ask the same question is a big no-no. You are very close to a temporary ban for spamming. Stop it, please.

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