Do you think you will play this game?
Yes
 61%  [ 8 ]
No
 38%  [ 5 ]
Total Votes : 13

One last suggestion though.

Change your DCS header to say

:DCS6

and use a 16X16 icon.
make it for me and i'll use is otherwise mine it staying the prog is already at 1900 bytes alone
Edit: 1924 to be exact with out subprograms
Edit2: BTW what do you think of the new menus
The menus are a lot better. Very Happy
It looks pretty much done graphics wise.
Thats what I thought now I think I'm ready to say I'm done with v2. whatever
the only problem with the inverted text is it requires two subprograms now
True. But if you incorporate the HighScore program into a seprated section of Lightning's programming code, you have 1 subroutine
I want it able to be used by other games not just lightning when i start my next project
Do this:

1. Find an area for the HighScore code in Lightning's programming
2. press 2nd [Rcl]
3. choose your HighScore program
4. Press enter to have the program code copied into its new spot

This means that Highscore is both its own program AND a piece of Lightning's code. That way, you can still use the HighScore program with other games and only have 1 subroutine for Lightning.
Done I just need to do some optimizing then it will be ready. Very Happy
TheStorm wrote:

the only problem with the inverted text is it requires two subprograms now


You could just use my api and it would go much faster.
I'm using an invert text asm prog TheTari made for me in class today it just changes the system flag to invert text.
Edit: And now thats the only one but thanks anyway.
current scorce code

Code:
::DCS
:"EFEFDFDFEFF7D5E3
::A
:θINVERT
::
:" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.?!→Str1
:33→dim(∟LHS
:If not(∟LHS(1
:{3,31,19,16,30,31,26,29,24,1,66,2,31,19,16,30,31,26,29,24,1,66,1,31,19,16,30,31,26,
29,24,1,66→∟LHS
:ClrDraw
:AxesOff
:0→Xmin
:94→Xmax
:0→Ymin
:62→YMax
:For(A,0,62
:Horizontal(A
:End
:StorePic 1
:Lbl C
:DelVar SDelVar DRecallPic 1
:Asm(prgmθINVERT
:Text({-}1,8,6,"LIGHTNING v2.5
:Line(6,46,88,46,0
:Text(17,25,"BY THESTORM
:Text({-}1,27,6,"1- PLAY
:Text({-}1,35,6,"2- WATCH
:Text({-}1,43,6,"3- SCORES
:Text({-}1,51,6,"4- EXIT
:{83,82,81,81,81,81,82,83,83,83,83,83,83,82,81,80,79,78,78,78,78,79,80,81,82,83,83,83,83,82,
81,80,81,82,83,82,81,80,79,78,77,78,79,80,79,78,77,78,79,80,81,82,83,82,81,80,80,80,80,79,78,77→{L1}
:For(N,0,61
:Pxl-Off(N,{L1}(N+1
:End
:DelVar {L1}
:Lbl Z
:Repeat K
:getKey→K
:End
:If K=92
:Goto 1
:If K=93
:Goto 2
:If K=94
:Goto 4
:If K=82 or K=45 or K=22
:Goto 3
:Goto Z
:Lbl 4
:RecallPic 1
:Text({-}1,8,10,"LIGHTNIN v2.4
:Text({-}1,16,16,"HIGH SCORES
:Line(6,38,88,38,0
:" →Str2
:For(A,2,11
:∟LHS(A→B
:If B=0
:1→B
:Str2+(sub(Str1,B,1→Str2
:End
:Text({-}1,28,4,Str2," ",∟LHS(1
:" →Str3
:For(A,13,22
:∟LHS(A→B
:If B=0
:1→B
:Str3+(sub(Str1,B,1→Str3
:End
:Text({-}1,38,4,Str3," ",∟LHS(12
:" →Str4
:For(A,24,33
:∟LHS(A→B
:If B=0
:1→B
:Str4+(sub(Str1,B,1→Str4
:End
:Text({-}1,48,4,Str4," ",∟LHS(23
:Pause
:DelVar Str2DelVar Str3DelVar Str4Goto C
:Lbl 1
:1→D
:Lbl 2
:DelVar L
:47→P
:RecallPic 1
:Repeat getKey=45
:(P-8(S>6))(D=1)+randInt(12,82)not(D→G
:(P+8(S>6)(D=1))+randInt(12,82)not(D→F
:randInt(0,2→O
:3+(int(S/3)-1)(D=1)+not(D→E
:For(V,61,0,{-}E
:randInt({-}1,1→A
:G+EA(G+EA>0 and G+EA<95→W
:Line(G,V+E,W,V,0
:W→G
:If (S>6)(D=1 or not(D)(O=2
:Then
:randInt({-}1,1→B
:F+EB(F+EB>0 and F+EB<95→U
:Line(F,V+E,U,V,0
:U→F
:End
:If D
:Then
:getKey→C
:If C=26 or C=24 or V≥60
:Then
:P→M
:P+2((C=26 and P<91)-(C=24 and P>3→P
:Pt-On(M,10,2:Line(M,9,M,3:Line(M+1,6,M+3,8:Line(M-1,6,M-3,8:Line(M-1,2,M-3,0:Line(M+1,2,M+3,0
:Pt-Off(P,10,2:Line(P,9,P,3,0:Line(P+1,6,P+3,8,0:Line(P-1,6,P-3,8,0:Line(P-1,2,P-3,0,0:Line(P+1,2,P+3,0,0
:End
:If (V≤13 and (abs(P-G)≤5 or (S>6)(abs(P-F)≤5)))
:Then
:1→L
:Goto A
:End
:End
:End
:Lbl A
:If (S>6)(D=1 or not(D)(O=2
:For(A,1,2
:Line(G+1,V+1,G+3,V+3,0:Line(G-1,V+1,G-3,V+3,0:Line(G-3,V,G-4,V+1,0:Line(G+3,V,G+4,V+1,0
:StorePic 2:ClrDraw:RecallPic 2
:F→G
:If S>5 or not(D
:End
:If L
:Goto G
:ClrDraw:RecallPic 1
:S+1→S
:End
:If not(D
:Goto C
:Lbl G
:If S>∟LHS(23
:Then
:ClrHome
:DispGraph
:Disp
:Disp "","   High Score","   Enter Name
:Repeat 11>length(Str2
:Input "   ",Str2
:If 10<length(Str2
:Then
:Output(2,4," To Long 
:End
:DelVar {L1}For(A,1,length(Str2
:0→{L1}(1
:inString(Str1,sub(Str2,A,1→{L1}(A+1
:11→dim({L1}
:End
:S→{L1}(1
:{∟LHS(1),∟LHS(2),∟LHS(3),∟LHS(4),∟LHS(5),∟LHS(6),∟LHS(7),∟LHS(8),∟LHS(9),∟LHS(10),∟LHS(11→{L2}
:{∟LHS(12),∟LHS(13),∟LHS(14),∟LHS(15),∟LHS(16),∟LHS(17),∟LHS(18),∟LHS(19),∟LHS(20),∟LHS(21),∟LHS(22→{L3}
:If S>{L2}(1
:Then
:augment({L1},{L2}→∟LHS
:augment(∟LHS,{L3}→∟LHS
:Else
:If S>{L3}(1
:Then
:augment({L2},{L1}→∟LHS
:augment(∟LHS,{L3}→∟LHS
:Else
:If S>∟LHS(23
:Then
:augment({L2},{L3}→∟LHS
:augment(∟LHS,{L1}→∟LHS
:End
:End
:End
:DelVar {L1}DelVar {L2}DelVar {L3}Goto 4
:Else
:Text(15,24," Ha Ha You Lose!
:End
:Text(23,25," Your Score= ",S
:Pause
:Goto C
:Lbl 3
:ClrHome:ClrDraw:AxesOn
:DelVar Pic1DelVar Pic2DelVar Str1


Please give me any optimizations you can find

Edit: aaahhh error prone code I will upload the corrected code soon

Code:

::DCS
:"EFEFDFDFEFF7D5E3
::A
:θINVERT
::
:" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghij
klmnopqrstuvwxyz.?!→Str1
:33→dim(∟LHS
:If not(∟LHS(1
:{3,31,19,16,30,31,26,29,24,1,66,2,31,19,16,30,31,26,29,
24,1,66,1,31,19,16,30,31,26,29,24,1,66→∟LHS
:StoreGDB 1
:ClrDraw
:AxesOff
:0→Xmin
:94→Xmax
:0→Ymin
:62→YMax
:For(A,0,62
:Horizontal(A
:End
:StorePic 1
:Lbl C
:DelVar SDelVar DRecallPic 1
:Asm(prgmθINVERT
:Text({-}1,8,6,"LIGHTNING v2.5
:Line(6,46,88,46,0
:Text(17,25,"BY THESTORM
:Text({-}1,27,6,"1- PLAY
:Text({-}1,35,6,"2- WATCH
:Text({-}1,43,6,"3- SCORES
:Text({-}1,51,6,"4- EXIT
:{83,82,81,81,81,81,82,83,83,83,83,83,83,82,81,80,79,78,78,78,78,79,80,
81,82,83,83,83,83,82,81,80,81,82,83,82,81,80,79,78,77,78,79,80,79,78,7
7,78,79,80,81,82,83,82,81,80,80,80,80,79,78,77→{L1}
:For(N,0,61
:Pxl-Off(N,{L1}(N+1
:End
:DelVar {L1}
:Lbl Z
:Repeat Ans
:getKey
:End
:Ans→K
:If K=92
:Goto 1
:If K=93
:Goto 2
:If K=94
:Goto 4
:If K=82 or K=45 or K=22
:Goto 3
:Goto Z
:Lbl 4
:RecallPic 1
:Text({-}1,8,10,"LIGHTNIN v2.5
:Text({-}1,16,16,"HIGH SCORES
:Line(6,38,88,38,0
:" →Str2
:For(A,2,11
:∟LHS(A→B
:If B=0
:1→B
:Str2+(sub(Str1,B,1→Str2
:End
:Text({-}1,28,4,Str2," ",∟LHS(1
:" →Str3
:For(A,13,22
:∟LHS(A→B
:If B=0
:1→B
:Str3+(sub(Str1,B,1→Str3
:End
:Text({-}1,38,4,Str3," ",∟LHS(12
:" →Str4
:For(A,24,33
:∟LHS(A→B
:If B=0
:1→B
:Str4+(sub(Str1,B,1→Str4
:End
:Text({-}1,48,4,Str4," ",∟LHS(23
:Pause
:DelVar Str2DelVar Str3DelVar Str4Goto C
:Lbl 1
:1→D
:Lbl 2
:DelVar L
:47→P
:Repeat getKey=45
:RecallPic 1
:(P-8(S>6))D+randInt(12,82)not(D→G
:(P+8(S>6))D+randInt(12,82)not(D→F
:randInt(0,2→O
:2+iPart((S/3)D+not(D→E
:For(V,62,0,{-}E
:randInt({-}1,1→A
:G+EA(G+EA>0 and G+EA<95→W
:Line(G,V+E,W,V,0
:W→G
:If (S>6)D or not(D)(O=2
:Then
:randInt({-}1,1→B
:F+EB(F+EB>0 and F+EB<95→U
:Line(F,V+E,U,V,0
:U→F
:End
:If D
:Then
:getKey→K
:If K=26 or K=24 or V≥60
:Then
:P→M
:P+2(K=26 and P<91)-(K=24 and P>3→P
:Pt-On(M,10,2:Line(M,9,M,3:Line(M+1,6,M+3,8:Line(M-1,6,M-3,8:Line(M-1,2,M-3,0:Line(M+1,2,M+3,0
:Pt-Off(P,10,2:Line(P,9,P,3,0:Line(P+1,6,P+3,8,0:Line(P-1,6,P-3,8,0:Line(P-1,2,P-3,0,0:Line(P+1,2,P+3,0,0
:End
:If V≤13 and (abs(P-G)≤5 or (S>6 and abs(P-F)≤5
:Then
:1→L
:Goto A
:End
:End
:End
:End
:End
:Lbl A
:If (S>6)D or not(D)(O=2
:For(A,1,2
:Line(G+1,V+1,G+3,V+3,0:Line(G-1,V+1,G-3,V+3,0:Line(G-3,V,G-4,V+1,0:Line(G+3,V,G+4,V+1,0
:F→G
:If (6>S)D or not(D)(O=2
:End
:StorePic 2
:ClrDraw
:RecallPic 2
:F→G
:If L
:Goto 5
:S+1→S
:ClrDraw
:End
:End
:Lbl 5
:If S>∟LHS(23
:Then
:ClrHome
:DispGraph
:Disp
:Disp "","   High Score","   Enter Name
:Repeat 11>length(Str2
:Input "   ",Str2
:If 10<length(Str2
:Then
:Output(2,4," To Long 
:End
:End
:For(A,1,length(Str2
:0→{L1}(1
:inString(Str1,sub(Str2,A,1→{L1}(A+1
:11→dim({L1}
:End
:S→{L1}(1
:{∟LHS(1),∟LHS(2),∟LHS(3),∟LHS(4),∟LHS(5),∟LHS(6),∟LHS(7),∟LHS(8),∟LHS(9),∟LHS(10),∟LHS(11→{L2}
:{∟LHS(12),∟LHS(13),∟LHS(14),∟LHS(15),∟LHS(16),∟LHS(17),∟LHS(18),∟LHS(19),∟LHS(20),∟LHS(21),∟LHS(22→{L3}
:If S>{L2}(1
:Then
:augment({L1},{L2}→∟LHS
:augment(∟LHS,{L3}→∟LHS
:Else
:If S>{L3}(1
:Then
:augment({L2},{L1}→∟LHS
:augment(∟LHS,{L3}→∟LHS
:Else
:If S>∟LHS(23
:Then
:augment({L2},{L3}→∟LHS
:augment(∟LHS,{L1}→∟LHS
:End
:End
:End
:ClrHome
:DelVar {L1}DelVar {L2}DelVar {L3}
:Else
:Text(15,24," Ha Ha You Lose!
:Text(23,25," Your Score= ",S
:Pause
:End
:Goto 4
:Lbl 3
:ClrDraw
:RecallGDB 1
:DelVar Pic1DelVar Pic2DelVar Str1DelVar GDB1


Help I can't find my errors please help. Laughing Sad
I almonst have a new 16x16 icon just in the prosess of converting to hex, but if any one else has any ideas for on send me the hex code.
:DCSS6
:"FBFFFBFFFBFFFDFFFDFFFBFFFBFFFDFFFEFFFF7FFF7FFF7FEF6FFEFFFABFEC6F

hope I copied that right.
I was go ing for somethinng more complicated this is what I have now.
FFFFA021B58BB52B802BFFEFC7DFD7DF45DFABEFC7F7EFFBEFF7EFEFD7ABBBC7
I think that is rightbut if its not tell me. Razz
Okay, here's a couple things that I saw right off the bat:

  • Just before Lbl A - "If (foobar):1->L" can be replaced by (foobar)->L. Saves a whopping 3 bytes but also takes an If out, which is always good.
  • When you're reassembling your highscore list, you can use augment(L1,L2:augment(Ans,L3 or whatever the list vars are. See this topic for details.

I still can't figure out where all the End's are supposed to go. I suppose you could say there's a lot of odd(s and) ends unaccounted for. Razz Indenting the code to see where the Ends are helped a little bit.

And you were wrong about that other End. It did execute it, because when you hit Clear to abort Watch mode, it ends the Repeat loop. Hmm... You could use that one-line If trick to make different conditions for ending Watch mode and Play mode, like:

Code:

:If D:Repeat (player was hit by lightning)     //that would be L, right?
:If not(D:Repeat (clear key hit)
:  .
:  .   //the whole game loop here
:  .
:End

And now that I think about it, the reason the guy isn't moving so fast is because you check getKey in two places: the key checker AND the beginning of the loop. getKey acts like it reads from a buffer; if the calculator is going through an operation then the value is stored in the getKey buffer until getKey is called. The point of this whole deal being, only use getKey->K in one location, then check K in the Repeat loop.
i have changed the repeat to repeat Getkey=45 or L
and am about to do your other suggestion with L
I will look into the list thing
It lives! (And apparently does something useful!)

Fixes to the LIGHTNING v2.5 code:

Code:
::DCS
:"EFEFDFDFEFF7D5E3
::A
:θINVERT
::
:" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.?!→Str1
:33→dim(∟LHS
:If not(∟LHS(1
:{3,31,19,16,30,31,26,29,24,1,66,2,31,19,16,30,31,26,29,24,1,66,1,31,19,16,30,31,26,29,24,1,66→∟LHS
:StoreGDB 1
:ClrDraw
:AxesOff
:0→Xmin
:94→Xmax
:0→Ymin
:62→YMax
:For(A,0,62
   :Horizontal(A
:End
:StorePic 1
:Lbl C
:DelVar SDelVar DRecallPic 1
:Asm(prgmθINVERT
:Text({-}1,8,6,"LIGHTNING v2.5
:Line(6,46,88,46,0
:Text(17,25,"BY THESTORM
:Text({-}1,27,6,"1- PLAY
:Text({-}1,35,6,"2- WATCH
:Text({-}1,43,6,"3- SCORES
:Text({-}1,51,6,"4- EXIT
:{83,82,81,81,81,81,82,83,83,83,83,83,83,82,81,80,79,78,78,78,78,79,80,81,82,83,83,83,83,82,81,80,81,82,83,82,81,80,79,78,77,78,79,80,79,78,77,78,79,80,81,82,83,82,81,80,80,80,80,79,78,77→{L1}
:For(N,0,61
   :Pxl-Off(N,{L1}(N+1
:End
:DelVar {L1}
:Lbl Z
:Repeat Ans
:getKey
:End
:Ans→K
:If K=92
   :Goto 1
:If K=93
   :Goto 2
:If K=94
   :Goto 4
:If K=82 or K=45 or K=22
   :Goto 3
:Goto Z
:Lbl 4
:RecallPic 1
:Text({-}1,8,10,"LIGHTNIN v2.5
:Text({-}1,16,16,"HIGH SCORES
:Line(6,38,88,38,0
:" →Str2
:For(A,2,11
   :∟LHS(A→B
   :If B=0
      :1→B
   :Str2+(sub(Str1,B,1→Str2
:End
:Text({-}1,28,4,Str2," ",∟LHS(1
:" →Str3
:For(A,13,22
   :∟LHS(A→B
   :If B=0
      :1→B
   :Str3+(sub(Str1,B,1→Str3
:End
:Text({-}1,38,4,Str3," ",∟LHS(12
:" →Str4
:For(A,24,33
   :∟LHS(A→B
   :If B=0
      :1→B
   :Str4+(sub(Str1,B,1→Str4
:End
:Text({-}1,48,4,Str4," ",∟LHS(23
:Pause
:DelVar Str2DelVar Str3DelVar Str4Goto C
:Lbl 1
:1→D
:Lbl 2
:DelVar L
:47→P
:Repeat K=45 or L
   :RecallPic 1
   :(P-8(S>6))D+randInt(12,82)not(D→G    // P is guy's position
   :(P+8(S>6))D+randInt(12,82)not(D→F    // G,F are X-coords of lightning bolts
   :randInt(0,2→O             // Watchmode # of bolts
   :2+iPart((S/3)D+not(D→E       // E is V-increment
   :For(V,62,0,{-}E          // V is bolt Y-coord
      :randInt({-}1,1→A       // Go left/right/straight...
      :G+EA(G+EA>0 and G+EA<95→W    // ...but only if within screen
      :Line(G,V+E,W,V,0       // Draw new bolt
      :W→G             // New X-coord gets stored
      :If (S>6)D or not(D)(O=2    // Second bolt if S>6 (playmode)
         :Then          // or O=2 (watchmode)
         :randInt({-}1,1→B
         :F+EB(F+EB>0 and F+EB<95→U
         :Line(F,V+E,U,V,0
         :U→F
      :End
      :If D             // If in playmode
         :Then
         :getKey→K       // Keychecking
         :If K=26 or K=24 or V≥60
            :Then
            :P→M       // Shift guy if target within bounds
            :P+2(K=26 and P<91)-(K=24 and P>3→P
            :Pt-On(M,10,2:Line(M,9,M,3:Line(M+1,6,M+3,8:Line(M-1,6,M-3,8:Line(M-1,2,M-3,0:Line(M+1,2,M+3,0
            :Pt-Off(P,10,2:Line(P,9,P,3,0:Line(P+1,6,P+3,8,0:Line(P-1,6,P-3,8,0:Line(P-1,2,P-3,0,0:Line(P+1,2,P+3,0,0
         :End
         :(abs(P-G)≤5 or (S>6 and abs(P-F)≤5→L    // L = guy hit boolean
      :End
   :End                // Bolt has hit ground or man
   :Lbl A
   :If (S>6)D or not(D)(O=2
      :For(A,1,2
   :Line(G+1,V+1,G+3,V+3,0:Line(G-1,V+1,G-3,V+3,0:Line(G-3,V,G-4,V+1,0:Line(G+3,V,G+4,V+1,0
   :F→G
   :If (S>6)D or not(D)(O=2
      :End
   :StorePic 2
   :S+1→S
:End
:End
:Lbl 5
:If S>∟LHS(23
   :Then
   :ClrHome
   :DispGraph
   :Disp
   :Disp "","   High Score","   Enter Name
   :Repeat 11>length(Str2
      :Input "   ",Str2
      :If 10<length(Str2
         :Then
         :Output(2,4," To Long 
      :End
   :End
   :For(A,1,length(Str2
      :0→{L1}(1
      :inString(Str1,sub(Str2,A,1→{L1}(A+1
      :11→dim({L1}
   :End
   :S→{L1}(1
   :{∟LHS(1),∟LHS(2),∟LHS(3),∟LHS(4),∟LHS(5),∟LHS(6),∟LHS(7),∟LHS(8),∟LHS(9),∟LHS(10),∟LHS(11→{L2}
   :{∟LHS(12),∟LHS(13),∟LHS(14),∟LHS(15),∟LHS(16),∟LHS(17),∟LHS(18),∟LHS(19),∟LHS(20),∟LHS(21),∟LHS(22→{L3}
   :If S>{L2}(1
      :Then
      :augment({L1},{L2}→∟LHS
      :augment(∟LHS,{L3}→∟LHS
   :Else
      :If S>{L3}(1
         :Then
         :augment({L2},{L1}→∟LHS
         :augment(∟LHS,{L3}→∟LHS
      :Else
         :If S>∟LHS(23
            :Then
            :augment({L2},{L3}→∟LHS
            :augment(∟LHS,{L1}→∟LHS
         :End
      :End
   :End
:ClrHome
:DelVar {L1}DelVar {L2}DelVar {L3}
:Else
   :Text(15,24," Ha Ha You Lose!
   :Text(23,25," Your Score= ",S
   :Pause
:End
:Goto 4
:Lbl 3
:ClrDraw
:RecallGDB 1
:DelVar Pic1DelVar Pic2DelVar Str1DelVar GDB1


Indenting is so we can see where loops end, etc. Also take out the comments, those were for my own good.

In short, just a few changes to Storm's code:
  • the (foobar) -> L discussed above
  • Before Lbl 5, remove: ":If L :Goto 5", all the ClrDraw's and the StorePic 2 and RecallPic 2
  • Change ":Repeat getKey=45" to ":Repeat K=45 or L"
  • Only two "End"'s before Lbl 5

But more modifications could definitely be made to the highscore system... anyway the game works so I'm done.
ummm thanks? This fixed the problem but it removed some of my functions but i will add them back in and then call this done. Yes Very Happy
Mhmrgh, over-optimization rampage. I just assumed ClrDraw meant ClrDraw and that you could just recall the darkened background pic instead, sorry. Ah well, you can handle it from here.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3, 4, 5, 6  Next
» View previous topic :: View next topic  
Page 4 of 6
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement