Calling Points In Javascript Variable Help

Discussion in 'Technical Discussion' started by JSeeger6, Jul 15, 2019.

  1. JSeeger6

    JSeeger6 Avid Boxer

    Joined:
    Aug 29, 2018
    Messages:
    100
    Likes Received:
    12
    I'm aware that when adding points to an action, you write: this.scene().addScorePoint( amount ); etc.
    However I'm looking to be able to call those points AFTER they've been added.
    So, if "addScorePoint( 1);" adds 1 point per action, I'm looking to call "ScorePoint" or "1" so that I can do something with that variable instead of "addScorePoint." That way I'm no longer adding the point, but rather calling the already existing points that have been added. Does that make sense?
    So if I scored 10 points during a game, I'd like to be able to get that variable, 10 points, and do something with it. In other words I'm looking to be able to call "total points." How do I do this?!

    Any help would be extremely appreciated!!
     
  2. Eugene Vilder

    Eugene Vilder Boxer

    Joined:
    Sep 11, 2018
    Messages:
    16
    Likes Received:
    0
    I would like to know that either. Anyone can help?
     
  3. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    var points = this.scene().totalGlobalPoints();
     
  4. Eugene Vilder

    Eugene Vilder Boxer

    Joined:
    Sep 11, 2018
    Messages:
    16
    Likes Received:
    0
    Thank you so much !!!
    btw.. just curious... how you managed to find this? were you using some DOcumentation or something? I couldn't find anything...
     
  5. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
  6. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190

Share This Page