Create a highscore im matlab GUI video game
Show older comments
Hi everyone. I need some help. I do small projekt for my matlab classes and there is a game created in matlab app designer. Everything is fine but I want to create a highscore in my videogame. Now I can write a last score but I need somehow to write the highest. I did it with function max but it dosen't work. Need some help please.
PS: my cod in attached files. It's GUI but I also use obvius matlab to write cod and now I need to create a highscore in GUI :)
Accepted Answer
More Answers (1)
Walter Roberson
on 6 May 2022
1 vote
You can store the high score in a file. Test if the file exists and if so load the previous high score information. Each time a game completes save the high score information
Or... you can use https://www.mathworks.com/help/matlab/ref/setpref.html setpref to record the high score without writing a file.
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!