Author Topic: Simple Hi-score using appvar  (Read 3271 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Simple Hi-score using appvar
« on: May 30, 2011, 02:52:37 pm »
I think this is not quite right:
Code: [Select]
:!If GetCalc("appvarThs")->H or (H<S)
:S->{GetCalc("appvarThs",785)}
:End
It gives me an incredibly high hi-score. Higher than the actual score. Is the size incorrect or something like that?
If you like my work: why not give me an internet?








Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Simple Hi-score using appvar
« Reply #1 on: May 30, 2011, 02:56:35 pm »
Wait you need a 785 bytes appvar for a simple high score ?
I would do this ( If there is only one high score ) :

Code: [Select]
!If Getcalc("appvThs")->H
0->{Getcalc("appvThs",2)->H}r
End
If S>{H}r
S->{H}r
End

Where "r" is the token in "angle" menu.
« Last Edit: May 30, 2011, 02:57:07 pm by Fast Crash »

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Simple Hi-score using appvar
« Reply #2 on: May 30, 2011, 02:59:10 pm »
1. appvar should be the appv token ( 2ND, 8 )
2. H is the byte position where the data is placed, {H} is your highscore :)
3. You can use S -> {H} instead of S->{GetCalc("appvarThs",785)}

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Simple Hi-score using appvar
« Reply #3 on: May 30, 2011, 03:03:32 pm »
Crash, why is {H} buffered?
Edit::D It works. Thanks for the code!
« Last Edit: May 30, 2011, 03:06:30 pm by Keoni29 »
If you like my work: why not give me an internet?








Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Simple Hi-score using appvar
« Reply #4 on: May 30, 2011, 03:20:33 pm »
why is {H} buffered?
{Pointer}r takes 2 bytes instead of only one. Will the player be able to get a higher score than 255? If not, you don't need to use r.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Simple Hi-score using appvar
« Reply #5 on: May 31, 2011, 01:33:13 am »
Okay. I think no-one is going to have a hi-score higher than 256*256-1 so, but if so: :evillaugh:
If you like my work: why not give me an internet?








Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Simple Hi-score using appvar
« Reply #6 on: May 31, 2011, 01:37:27 am »
Okay. I think no-one is going to have a hi-score higher than 256*256-1 so, but if so: :evillaugh:

I take that as a challenge Keoni
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Simple Hi-score using appvar
« Reply #7 on: May 31, 2011, 09:02:42 am »
I almost completed the game. I'm now working on the increasing difficulty.
I'm going to add wind to make movement harder. Maybe I swap the controlls.
You can't beat the programmer :evillaugh:
If you like my work: why not give me an internet?