Music Progress Bar

SnapFireSnapFire Member Posts: 361
edited November -1 in Working with GS (Mac)
I wasn't sure wether to post this here or in Music but here goes:

I have a game that has many different music tracks that cycle through of varying lengths. I want to show a progress bar for how far through the current song you are. But since they are different lengths, I cannot think of a way to do this. I already know what the length of each one is if that helps. There is probably so crazy complicated math solution, but I just can't think of one. Please help.

Thanks so much
-Thomas

Comments

  • SnapFireSnapFire Member Posts: 361
    Anyone? This is really essential to my game.

    Thanks
    -Thomas
  • SnapFireSnapFire Member Posts: 361
    Wow. I'm stupid.
    Thanks TSB, that should work

    you're da bomb
    -Thomas
  • SnapFireSnapFire Member Posts: 361
    Actually, In my scenario, I have a circular object between two rectangles that rifes back and forth on a line (Slider)
    Kind of like this:

    |-----0------|

    So I'm still going to use interpolate, but I'm just going to interpolate the position of my actor over and make it last the correct amount of time.

    -THomas
  • SnapFireSnapFire Member Posts: 361
    Hello,

    I am still having trouble with this.

    The problem is that the interpolation does not stop when the song changes. Instead it continues and does not reset.

    Here's what I have:

    There is a Game Atribute (MusicProgress) that tells whether or not the song is playing and how long it is.

    Inside the slider: Rule: If Game.MusicProgress > 1 ,then Interpolate Self.Position.X to Game.MusicProgress + Self.Position.X for the duration of Game.MusicProgress with the function being Linear. Otherwise, change Self.Position.X to 120

    At the end of each song, Game.MusicProgress changes to 0 for 1 second before changing to the next song. For each song Game.MusicProgress changes to the length of that particular song.

    Could anyone please help?

    -Thomas
  • SnapFireSnapFire Member Posts: 361
    Anyone?

    -Thomas
  • SnapFireSnapFire Member Posts: 361
    Bump
  • SnapFireSnapFire Member Posts: 361
    Bump
  • SnapFireSnapFire Member Posts: 361
    Sorry to bump this again but it's really important.

    -Thomas
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    You need to create self.start.x real attribute that you change to your x position because self.x is constantly moving, so will always be going up and if your start x is 100 and midway through is 250, your equation is starting as game.MusicProgress+100 but half way along it would be game.MusicProgress+250 and so on.

    Ace
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Also, it's the duration that wants to be affected by the time of the song, not the x position.
    If you want this:

    1-----o-----2

    And the 'o' is the marker you will just need to set the x value of the marker to that of '1' and interpolate it to the x value of '2' and the duration is what needs to be set to game.songDuration

    Ace
  • SnapFireSnapFire Member Posts: 361
    Hey all,

    Thanks Ace for that. It must have slipped my brain.

    However, I'm having another problem. I have an interpolation rule that is controled by a atribute. When the atribute is 1, I want it to interpolate. When the atribute is 0, I want the interpolation to stop. Then, when the atribute goes back to 1, I want it to start again.

    Just putting an interpolate withen a rule that says when atribute = 1 is apparently not enough. When I do the the interpolation stops but will not start again. It's almost like I need the rule to keep checking back to make sure everything is as it should be.

    Thanks,
    Thomas
  • SnapFireSnapFire Member Posts: 361
    BTW, I decided not to use this in my game. However, thanks for all the feedback!

    -Thomas
Sign In or Register to comment.