BBC BASIC for Windows
« High Score Table »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:10pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: High Score Table  (Read 689 times)
Usama Amin
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 18
question High Score Table
« Thread started on: Nov 10th, 2012, 5:28pm »

Hi Richard is it possible to store a variable which doesn't erase when BBC basic is closed e.g. for a high score leader board and can a high score table be created in BBC basic? smiley
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
question Re: High Score Table
« Reply #1 on: Nov 10th, 2012, 10:07pm »

on Nov 10th, 2012, 5:28pm, Usama Amin wrote:
Hi Richard is it possible to store a variable which doesn't erase when BBC basic is closed?

The usual method would be to store the value either in the Windows Registry or in an INI file (or indeed in any kind of data file). For the use of INI files see this Wiki article:

http://bb4w.wikispaces.com/Reading+and+writing+.INI+data+files

Of course a disadvantage of storing a High Score Table as 'plain text' in the Registry or an INI file is that it would be easy for somebody to edit it to give themselves a very high score! Therefore in that case you may want to encrypt the data before storing it.

Richard.
« Last Edit: Nov 10th, 2012, 10:12pm by admin » User IP Logged

Usama Amin
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 18
question Re: High Score Table
« Reply #2 on: Nov 11th, 2012, 09:37am »

Ok thanks how would one go about encrypting an .ini file?
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
question Re: High Score Table
« Reply #3 on: Nov 11th, 2012, 9:33pm »

on Nov 11th, 2012, 09:37am, Usama Amin wrote:
Ok thanks how would one go about encrypting an .ini file?

You could use any kind of encryption that you consider to be adequately secure, I have no specific suggestions. You could try asking other games writers what they have used (but for obvious reasons they might not want to reveal too much detail!).

If the encryption produces an output that still looks like 'text' you can store it in the INI file like any regular string. If the encryption creates 'binary' data you can store it in the INI file using WritePrivateProfileStruct.

Richard.
User IP Logged

Usama Amin
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 18
thumbup Re: High Score Table
« Reply #4 on: Nov 12th, 2012, 7:27pm »

Thanks I just multiplied it by a really large number when writing to the ini file and divided by the same number when reading worked well enough grin
Thanks for the help Richard smiley
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
question Re: High Score Table
« Reply #5 on: Nov 13th, 2012, 08:04am »

on Nov 12th, 2012, 7:27pm, Usama Amin wrote:
I just multiplied it by a really large number when writing to the ini file and divided by the same number when reading worked well enough

Works well enough until somebody playing your game reads this forum..... grin

Richard.
User IP Logged

Usama Amin
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 18
question Re: High Score Table
« Reply #6 on: Nov 13th, 2012, 08:34am »

Haha grin
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls