How do I fix my high score? [Please Help]

  • ArcadeEd, could you still help me out?

  • How do you know the High Score is staying at 0?

    I don't see anyplace you are updating the high score text with the high score. Does that make sense?

    On start of layout you are setting the text of the HighScore text object to varHighscore.

    But you never update the text box if the highscore is beaten. So it's always showing whatever the high score was when you start the game.

    <img src="http://content.screencast.com/users/ArcadEd/folders/Jing/media/786d58ad-4a14-46a2-b2f8-1a5df91e2f1f/2013-05-28_1634.png" border="0" />

  • Hey, I changed it the way you told me to, but it still doesn't work... <img src="https://dl.dropboxusercontent.com/u/54192518/example2.PNG" border="0" />

    Can you fix the capx and then, post it, please? What am I doing wrong now lol?

  • Well there are many places in your code where that same line of code I highlighted is used.

    Basically, Text objects are not updated automatically, so any time you change the variable that you are showing with a text object, you need to set the text to the variable again.

    Or set them to update every tick.

  • Can you please show me with the capx I sent you? I just need a visual idea of what you're talking about man. I mean, I get it , but I don't get exactly how to do it. Can you please show me? It would be the biggest help...

  • Well, I'm having a hard time with your CAPX because there seems to be the same event blocks in several places and I'm not sure why.

    Right now in your game. Where are you wanting me to put the code so you can test it? Which line number?

  • Can you put it right end (line 77)? If not, just put it wherever you feel is best. Thanks a lot.

  • That's just at the bottom, it won't solve the issue. I'm probably just not explaining myself well enough.

    The flow of the game should be something like this.

    1. Start game, import high score (if one exists) and set it to varHighscore. Set text highscore to varHighscore

    2. Play game, player earns score.

    3. When game is over, check if the score is larger than varHighscore

    If it is, set webstorage high score to SCORE.

    4. Restart layout since the game is now restarting because it's game over. Upon restarting the layout, you go back to step 1.

    Just sticking the code in the bottom of you current code isn't going to solve the problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I here what you're saying, but can you PLEASE show me the capx? I really need to see it to understand what your saying lol. I'm lost without a visual.

  • I just don't know where to put the code so you can test it. I'm a bit confused by your code, which is why it's making it difficult. I don't know where exactly you want the high score to show up for the player to see.

    I'm sorry, I really trying to help.

  • Oh, I see, I want the High Score to show up everytime the player wins or looses (on the "gameWin" and "gameOver" layers). I don't want them to see the High Score while they're actually playing. They should only see their score while actually playing.

  • Gotcha, I am just creating a function and you can call it whenever you need to fetch the score or update it.

  • Thanks a lot man:)

  • Ok, new capx. Let me know if something doesn't make sense.

    http://www.arcadeinabox.com/guannstar.capx

    <img src="http://content.screencast.com/users/ArcadEd/folders/Jing/media/4780cd41-319e-4d6d-bc05-3df37c1d49a2/2013-05-28_2010.png" border="0">

    The Function

    <img src="http://content.screencast.com/users/ArcadEd/folders/Jing/media/b6b8b5f3-4feb-402c-90c7-02459622ce9b/2013-05-28_2011.png" border="0">

  • The capx link doesn't work? Do you have a dropbox account? It never fails.

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