13 Mayıs 2012 Pazar 01:04
I made this Hi Score test code below. JRB424 It won't work on the web, won't work to import either, you have to cut and past to sb.
It gave me an idea about loading images from the web and saving them to the users local hard drive for the next time the program is loaded. If the user has the files on the hard drive then I assume there will be less lag to get things started the second time a program is loaded. But I just noticed that all the file handling lines are commented out when a file is published, is there any way around this?
'Hi score File creator
path = Program.Directory
TextWindow.Write("Enter your score, ")
score = TextWindow.Read()
hiscore = File.ReadContents(path + "\HiScore.txt")
TextWindow.WriteLine("Hi Score is " + hiscore)
If score > hiscore Then
TextWindow.WriteLine("Your hi score of " + score + " has been saved!")
File.WriteContents(path + "\HiScore.txt",score)
TextWindow.WriteLine("You did not get the hi score.")
- Değiştirilmiş Tür JKrueg 13 Mayıs 2012 Pazar 03:42
15 Mayıs 2012 Salı 00:14Yanıtlayıcı
If you are worried about the commenting out part, try somthing like this:
On line seven: hiscore = FilePlus.ReadContents(path + "\HiScore.txt")
On line eleven: FilePlus.WriteContents(path + "\HiScore.txt",score)
this will stop the commenting out because SB does not see fileplus. as the same as file.
BTW, nice program. do you mind if I use it for part of mine?
- Düzenleyen Zock77Editor 15 Mayıs 2012 Salı 00:15
15 Mayıs 2012 Salı 01:46
What about trying to stay with the stock small basic code so it, "just works for everyone"? How many people with small basic go the next step and load any extensions? I have only loaded the LD extensions, haven't really tried any yet, just looked at sample code.
As far as using parts of the code, go for it, I would like to see what becomes of it. This was a test to see it work before I put into Soda Pop Showdown.
16 Mayıs 2012 Çarşamba 02:05YanıtlayıcıSo I spent about two hours revewing this and I think that unless you use a data extention, there is no way to do it. the reason it comments it out is because you can save things on a hard disk and it might be a bug.
- Yanıt Olarak İşaretleyen JKrueg 19 Mayıs 2012 Cumartesi 00:19