Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

Highscores after exiting

$
0
0

Hey so I am making an android game and it is complete except I can't figure out how to set a highscore that save after you quit the app. This is my highscore code right now. int[] loadedScores;

    void setup(){
         String path = "sco.csv";
          loadedScores = int(loadStrings(path));
     }

     void draw(){
          if (score>highScore) {
               highScore = score;
               loadedScores[0] = highScore;
               String[] s = str(loadedScores);
              saveStrings("sco.csv", s);
            }
     }

It works if I am in java mode but not if I am Android mode. In Android mode sco.csv must be saved in the data folder to work but in java mode it doesn't just needs to be in the same folder as everything else. Sorry if this doesn't make sense but if someone could help me that would be great.

I already asked this just didnt know how to format yet so reposting


Viewing all articles
Browse latest Browse all 941

Trending Articles