Buildbox 3 Progression Bar

Discussion in 'Buildbox 3.0' started by arsalanengr, Mar 21, 2019.

  1. arsalanengr

    arsalanengr Boxer

    Joined:
    Dec 9, 2017
    Messages:
    8
    Likes Received:
    1
    I want to increase Progression bar when we collect coins not distance. like in helix jump or tenkyu game. Can some please right a code for that i was trying for 3 days and it's not working for me
     
  2. weboha

    weboha Avid Boxer

    Joined:
    Aug 8, 2018
    Messages:
    237
    Likes Received:
    174
    Progression bar is an object width, so you can use anything not just distance.
    if value 1 mean %100.

    function update(dt){
    let path = this.scene().path();
    let pathPos = path.pathPosition();
    let value = pathPos/_distance;
    if(value > 1){
    value = 1;
    }
    _bar.setPosition(-(1-value)*2.88,0,0);
    _bar.setScale(value,1,1);
    }
     
  3. arsalanengr

    arsalanengr Boxer

    Joined:
    Dec 9, 2017
    Messages:
    8
    Likes Received:
    1
    i want to increase it with points not distance. for example if i collect 1 coin progression increase 25% on 2nd coin 50% etc
     

Share This Page