Jumping progress bar

bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375

As seen in this video, the progress bar does not shrink except for when it reaches the final quarter of the countdown. Is this a GameSalad bug, or is there an error in the coding?

Here is the constrain rule. The actor is 824x4px and located by 0,733. I have tried creating new actors and they will not display even when dragged on screen. That is what leads me to think this is a bug.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    @bjandthekatz said:
    As seen in this video, the progress bar does not shrink except for when it reaches the final quarter of the countdown.

    I can't see any progress bar, where should we be looking for it ?

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    edited June 2015

    @Socks Top of the screen in the left corner you can see it in the very beginning. Between 1 and 2 seconds, right before the score interpolates down. Its roughly 4 pixels high.

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2015

    @bjandthekatz said:
    Socks Top of the screen in the left corner you can see it in the very beginning. Between 1 and 2 seconds, right before the score interpolates down. Its roughly 4 pixels high.

    :o Lol ! You were expecting us poor forum users to spot that without pointing it out !!!? :D

    If I were making a video of this I would have been tempted to quickly made the bar bright red, and made it 100 pixels high - and even zoomed into the relevant area, as it stands it's hard to say much as it's so subtle and so fleeting, but looking at your code, the constrain behaviour you are using is expanding (rather than shrinking) the width of the bar (from its centre) at a rate of 412 pixels a second and your iPhone 6+ portrait scene is 414 pixels wide.

    So if the bar is located at x0, then it should take ~2 seconds to expand to the width of the screen.

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2015

    This is how you shrink a bar from one side . . .

    Interpolate width to 0 (or whatever you want)
    Interpolate position x to position x - (width /2)

    Or if you are using Constrain and game.time and all that stuff then . . .

    Constrain width to 200 - game.Time *100
    Constrain x position to 100+( self.Size.Width /2)

    (obviously you can change the values to whatever you want)

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    edited June 2015

    @Socks said:
    So if the bar is located at x0, then it should take ~2 seconds to expand to the width of the screen.

    Sorry it should be shrinking from the right to the left as a time bar. Would would the constrain rule for that be?

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2015

    @bjandthekatz said:
    Sorry it should be shrinking from the right to the left as a time bar.

    Interpolate width to 0 (or whatever you want)
    Interpolate position x to position x - (width /2)

    @bjandthekatz said:
    Will the interpolate width behavior work if time is being added to the attribute as it is shrinking?

    Sorry, I don't know what that means. :/

    EDIT. I think I know what you mean, do you mean as the bar is shrinking you want to able to add to it (to increase its value / width) ? If so, then try this . . .

    Constrain width to (555 -game.Time *100)+ extra width
    Constrain position x to 222 +( self.Size.Width /2)

    (555 = the initial width / 222 = the position of the bar (lefthand side) / 100 = speed)

    Then when you want to add width simply add value to 'extra width'. So for example 'extra width' would start out with a default value of 0, then every time you hit the space bar, or kill an enemy or get a question right (or whatever) you could change 'extra width' to 'extra width' +100.

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2015

    Example attached, press the space bar to add an extra 100 pixels to the shrinking bar.

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375

    @Socks I got it to work! Thank you very much.

  • SocksSocks London, UK.Member Posts: 12,822

    @bjandthekatz said:
    Socks I got it to work! Thank you very much.

    Success ! :smile:

Sign In or Register to comment.