English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 31 August 2018, 20:36   #1
Havie
Registered User
 
Havie's Avatar
 
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.
Havie is offline  
Old 31 August 2018, 21:51   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
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.
Daedalus is offline  
Old 01 September 2018, 11:07   #3
Havie
Registered User
 
Havie's Avatar
 
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?
Havie is offline  
Old 01 September 2018, 11:10   #4
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by Havie View Post
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?
Use QAMIGA mode. It's functionally identical to AMIGA except it doesn't remove your Blitz display setup.
earok is offline  
Old 01 September 2018, 12:16   #5
Havie
Registered User
 
Havie's Avatar
 
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.
Havie is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:51.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06859 seconds with 13 queries