ArcadEd's Recent Forum Activity

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

  • 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.

  • 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.

  • 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?

  • 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.

  • 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" />

  • There are a few ways.

    1. Use CocoonJS

    2. Use AppMobi

    3. Use a wrapper like Phonegap and compile the project in Eclipse

    to name a few.

  • Yeah, it would be great to be able to subscribe to threads.

  • Where in your code are you saving the high score to web storage? I don't see it in the snippet you posted.

    Do you mind posting up a CAPX?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As far as I know, if you are building the app with CocoonJS, there is no way to then go into Eclipse and edit it.

  • What I mean is, right now your code is never setting a highscore to the webstorage, so naturally it's 0.

    Maybe this will help if you haven't seen it yet.

              

    Subscribe to Construct videos now
  • Ok, the only place you are setting the high score is on the start of layout. Since varHighScore is 0 at that point, it setting 0 to the webstorage.

    Try creating another Keyboard event to give yourself a score to play around with it. Or 2 keys to give different scores for testing.

ArcadEd's avatar

ArcadEd

Early Adopter

Member since 3 Jul, 2012

Twitter
ArcadEd has 7 followers

Connect with ArcadEd

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x10
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies