31 August 2018, 20:36 | #1 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
High score saving to disk
In my gaem (it's nearly ready) I have high score saving to disk (have no idea where the code came from but I used it in my Flappy Bird game).
It seems to work when running the game from hard disk but when you run (from my now working) floppy, it hangs when it saves a new high score. I thought it might be a dodgy disk drive on my 1200 but it does the same thing in Amiga Forever. Any clues as to why? Here is the code to load the high score at the beginning: If OpenFile (0,"highscoret.dat")=-1 Fields 0,highold Get 0,0 CloseFile 0 high=highold End If Here is the code when you die and it checks to see if you have a high score: If score>high dummy= OpenFile (0,"highscoret.dat")=-1 Fields 0,high Put 0,0 CloseFile 0 high=score End If Thanks in advance. |
31 August 2018, 21:51 | #2 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
Are you checking for success when writing to the file? Are you running in Blitz mode? Perhaps you're not waiting long enough to complete the write.
I've never actually used the fields method, but I know that using FileOutput and NPrint to write, and FileInput and Edit() works fine. |
01 September 2018, 11:07 | #3 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
Doh - wasn't coming out of Blitz mode! Strange that it works on hard disks without leaving Blitz mode but doesn't on floppy?
Created another problem though - when I leave Blitz mode it shows the shell for the duration of the save and I lose the game screen - how do I stop this? |
01 September 2018, 11:10 | #4 | |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
|
Quote:
|
|
01 September 2018, 12:16 | #5 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,893
|
That does the trick - thanks!
A couple more things to do and then I'll upload game. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What does High score or Trainer mean? | Starglider 2 | support.Games | 6 | 01 March 2018 18:14 |
Hi Score saving in New Zealand Story | andyhants | support.Games | 4 | 13 June 2016 21:27 |
Games missing high score saving feature | Shoonay | project.WHDLoad | 5 | 21 May 2006 18:56 |
RoboCop 3 (US)[0978] high score | demoniac | project.SPS (was CAPS) | 15 | 19 May 2006 10:09 |
EAB High Score Table | Dastardly | project.EAB | 37 | 11 September 2003 23:14 |
|
|