Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 on May 30, 2011, 02:52:37 pm

Title: Simple Hi-score using appvar
Post by: Keoni29 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?
Title: Re: Simple Hi-score using appvar
Post by: Fast Crash 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.
Title: Re: Simple Hi-score using appvar
Post by: Aichi 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)}
Title: Re: Simple Hi-score using appvar
Post by: Keoni29 on May 30, 2011, 03:03:32 pm
Crash, why is {H} buffered?
Edit::D It works. Thanks for the code!
Title: Re: Simple Hi-score using appvar
Post by: Aichi 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.
Title: Re: Simple Hi-score using appvar
Post by: Keoni29 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:
Title: Re: Simple Hi-score using appvar
Post by: ruler501 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
Title: Re: Simple Hi-score using appvar
Post by: Keoni29 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: