none
Hi Score code made me think of loading web images to users local hard drive.

    Pergunta

  • 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
    TextWindow.Show()
    path = Program.Directory
    TextWindow.WriteLine(path)
    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)
    Else
      TextWindow.WriteLine("You did not get the hi score.")
    EndIf
     

    • Tipo Alterado JKrueg domingo, 13 de maio de 2012 03:42
    domingo, 13 de maio de 2012 01:04

Respostas

  • 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.
    • Marcado como Resposta JKrueg sábado, 19 de maio de 2012 00:19
    quarta-feira, 16 de maio de 2012 02:05
    Usuário que responde

Todas as Respostas

  • 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?


    • Editado Zock77Editor terça-feira, 15 de maio de 2012 00:15
    terça-feira, 15 de maio de 2012 00:14
    Usuário que responde
  • 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.

    terça-feira, 15 de maio de 2012 01:46
  • 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.
    • Marcado como Resposta JKrueg sábado, 19 de maio de 2012 00:19
    quarta-feira, 16 de maio de 2012 02:05
    Usuário que responde