Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Snake X on August 08, 2010, 10:18:24 pm

Title: Project Snake X - help
Post by: Snake X on August 08, 2010, 10:18:24 pm
ok, so I have decided to start working on my snake game again so this time I will be sharing not the entire source code, but what I have produced so far because I need help on it. what I need help on is how the menu on this program works because i need to add the function to tell if someone has pressed enter or not. If you want to know.. runner made most of this code because im not that advanced, i just had my concepts :(

Code: [Select]
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE00 \
00000000000000000001FF000000078 |
0000000000003FF0000000FC0000000 |
001F87FF7CF0000FC0000000787F87F |
F7DF87E0FC0000001F87F07BF7FF8FF |
0FC0000003F87E079E7FF8FF8FC0000 |
003FC7C07F07FF9FFCFC1000001FEF8 |
07FE7FF8FFCFC7C00000FFF807FF7FF |
8FFCFDFE1E0007FF807FF7FF8FFEFDF |
E3FC003FF001FF7FF9FFEFFFC7FC001 | SNAKE X LOGO
FE0001F7FF9FFEFFF8FFC001FF0039F |
7EF9FFEFFE0FFC000FF8079F7EFDFFE |
FFC1FBC001FFC0FFF7EFDFFEFFE1FFC |
003FFF0FFF7C30FFEFFE1FFC003FFFC |
7FE3C00FDFFFF1FF8007E7FC1F00000 |
00EFDFFFDE00FC3FC00000000007CFE |
FBE01F83F80000000000187EFFE03F8 |
3F80000000000003E7FE03F80400000 |
00000000003FC03F000000000000000 |
00000000E]→Pic1 /
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv {^r}
:ClrDraw \
:For(A,0,63) |
:Line(0,A,95,63-A) |
:DispGraph |
:End |This makes the screen black
:For(A,0,95) |
:Line(A,0,95-A,63) |
:DispGraph |
:End /
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:While getKey→K≠15
:If K=1
:min(M+8,52)→M
:End
:If K=4
:max(M-8,28)→M
:End
:M>N-(M<N)+N→N
:DS<(A,3
:Pt-Off(rand^96,A,Pic2)
:End
:Z+1→Z
:Vertical +
:conj({L6},{L1},708)
:sub(DM)
:DispGraph
:conj({L1},{L6},708)
:End
:Fix 0
:Fix 4
--------------------------
bitwise operations for logo (I think)
--------------------------
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}{^r}→D{box}65535{dot}{B*2+{L6}→C}{^r}{cross}({B*2+Z}{^r}{dot}D)→{C}{^r}
:End
:For(B,168,353)
:{B*2+{L3}}{^r}{dot}{B*2+{L6}→C}{^r}→{C}{^r}
:End
:Pt-On(22,N,Pic3)
:Pt-Change(22,N,Pic3)
:Return
Title: Re: Project Snake X - help
Post by: _player1537 on August 08, 2010, 11:01:42 pm
Edit: Nevermind
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 08, 2010, 11:15:57 pm
This is not for the contest I hope, right? (since it's against the rules to post executables of your entry)
Title: Re: Project Snake X - help
Post by: Snake X on August 08, 2010, 11:18:11 pm
uhh what executable?/me hides
what rule says no executables? I might have skipped that part. I did delete it before any downloads were made though
Title: Re: Project Snake X - help
Post by: _player1537 on August 08, 2010, 11:18:38 pm
Change this line:
Code: [Select]
:While getKey→K≠15to:
Code: [Select]
:While getKey→K≠15 and (K≠9
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 08, 2010, 11:22:45 pm
OK thank you snake. Cuz if the count said 1 it could have been kinda bad x.x

Using too many source code from someone else can also affect originality score too, so you need to keep that in mind, too (especially since originality counts for 20% of the entire score)
Title: Re: Project Snake X - help
Post by: Snake X on August 08, 2010, 11:25:58 pm
yeah.. your welcome though :)
Title: Re: Project Snake X - help
Post by: _player1537 on August 08, 2010, 11:30:06 pm
after these lines:
Code: [Select]
:Fix 0
:Fix 4
add some code like this:
Code: [Select]
If M=28
Do stuff for first option
End
if M=36
Second option
End
If M=44
Third option
End
If M=52
fourth option
End
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 12:21:25 am
that didn't work when i put sub(XX in the if blocks.. I started lbl XX for the subroutines after the very last line (return)
Title: Re: Project Snake X - help
Post by: _player1537 on August 09, 2010, 12:33:17 am
Just to clarify you've got something like this:
Code: [Select]
If M=something
Sub(XX)
End
Return
Lbl XX
Disp "BLAH
Return
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 10:17:36 am
yes.. now to put in the function to detect if enter was pressed.

would it look like something like this:
Code: [Select]
while getkey != 9
If M=28
Do stuff for first option
End
if M=36
Second option
End
If M=44
Third option
End
If M=52
fourth option
End
End
Title: Re: Project Snake X - help
Post by: _player1537 on August 09, 2010, 10:29:34 am
Oh, that's where your problem is I believe.  Go up to the loop earlier that says ":While getKey→K≠15" and change that line to ":While getKey→K≠15 and (K≠9"  Should fix it :D
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 10:51:29 am
sorry m8 but that gave my calculator the brick (if you don't understand what that ment, basically that bricked my calculator)
Title: Re: Project Snake X - help
Post by: _player1537 on August 09, 2010, 11:13:15 am
brick != crashed
crashed ~ endless loop.

You have an endless loop.

Which is quite wierd...

Edit:
Code: [Select]
:While getKey→K≠15to
Code: [Select]
:Repeat getkey(15) or Getkey(9)
:getkey->K
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 11:29:29 am
ok here's the updated code on what i have so far:
Code: [Select]
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv r
:ClrDraw
:For(A,0,63)
:Line(0,A,95,63-A)
:DispGraph
:End
:For(A,0,95)
:Line(A,0,95-A,63)
:DispGraph
:End
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:While getKey→K≠15
:If K=1
:min(M+8,52)→M
:End
:If K=4
:max(M-8,28)→M
:End
:M>N-(M<N)+N→N
:DS<(A,3
:Pt-Off(rand^96,A,Pic2)
:End
:Z+1→Z
:Vertical +
:conj(L6,L1,708)
:sub(DM)
:DispGraph
:conj(L1,L6,708)
:End
:Fix 0
:Fix 4
:Repeat getKey(9)
:If M=28
:sub(SX
:End
:If M=36
:sub(HP
:End
:If M=44
:sub(SC
:End
:If M=52
:End
:End
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:End
:For(B,168,353)
:{B*2+L3}r
Title: Re: Project Snake X - help
Post by: _player1537 on August 09, 2010, 12:12:27 pm
Code: [Select]
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv r
:ClrDraw
:For(A,0,63)
:Line(0,A,95,63-A)
:DispGraph
:End
:For(A,0,95)
:Line(A,0,95-A,63)
:DispGraph
:End
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:Repeat getKey(9) or getKey(15) //changed
:getKey->K  //changed
:If K=1
:min(M+8,52)→M
:End
:If K=4
:max(M-8,28)→M
:End
:M>N-(M<N)+N→N
:DS<(A,3
:Pt-Off(rand^96,A,Pic2)
:End
:Z+1→Z
:Vertical +
:conj(L6,L1,708)
:sub(DM)
:DispGraph
:conj(L1,L6,708)
:End
//changed
:Fix 0
:Fix 4
//changed
:If M=28
:sub(SX
:End
:If M=36
:sub(HP
:End
:If M=44
:sub(SC
:End
:If M=52
:End
:Return //changed
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:End
:For(B,168,353)
:{B*2+L3}r
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 12:53:01 pm
updated. ERR: BLOCK (goes to end before fix 0)
Code: [Select]
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv r
:ClrDraw
:For(A,0,63)
:Line(0,A,95,63-A)
:DispGraph
:End
:For(A,0,95)
:Line(A,0,95-A,63)
:DispGraph
:End
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:getKey→K
:If K=1
:min(M+8,52)→M
:End
:If K=4
:max(M-8,28)→M
:End
:M>N-(M<N)+N→N
:DS<(A,3
:Pt-Off(rand^96,A,Pic2)
:End
:Z+1→Z
:Vertical +
:conj(L6,L1,708)
:sub(DM)
:DispGraph
:conj(L1,L6,708)
:End
:Fix 0
:Fix 4
:
:If M=28
:sub(SX
:End
:If M=36
:sub(HP
:End
:If M=44
:sub(SC
:End
:If M=52
:End
:Return
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:End
:For(B,168,353)
:{B*2+L3}r∙{B*2+L6→C}r→{C}r
:End
:Pt-On(22,N,Pic3)
:Pt-Change(22,N,Pic3)
:Return
:Lbl SX
:ClrHome
:Disp "A"
:Return
:Lbl HP
:ClrHome
:Disp "B"
:Return
:Lbl SC
:ClrHome
:Disp "C"
:Return
:Lbl EN
:ClrHome
:Disp "D"
:Return
Title: Re: Project Snake X - help
Post by: Quigibo on August 09, 2010, 04:42:25 pm
Indenting your code can help you find block errors:
Code: [Select]
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv r
:ClrDraw
:For(A,0,63)
:   Line(0,A,95,63-A)
:   DispGraph
:End
:For(A,0,95)
:   Line(A,0,95-A,63)
:   DispGraph
:End
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:While getKey→K=/=15    ;You were missing this line.  Otherwise the "End" is not ending anything.
:   If K=1
:      min(M+8,52)→M
:   End
:   If K=4
:      max(M-8,28)→M
:   End
:   M>N-(M<N)+N→N
:   DS<(A,3
:      Pt-Off(rand^96,A,Pic2)
:   End
:   Z+1→Z
:   Vertical +
:   conj(L6,L1,708)
:   sub(DM)
:   DispGraph
:   conj(L1,L6,708)
:End
:Fix 0
:Fix 4
:
:If M=28
:   sub(SX
:End
:If M=36
:   sub(HP
:End
:If M=44
:   sub(SC
:End
:If M=52
:End
:Return
:Lbl DM
:For(B,0,148)
:   {B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:End
:For(B,168,353)
:   {B*2+L3}r∙{B*2+L6→C}r→{C}r
:End
:Pt-On(22,N,Pic3)
:Pt-Change(22,N,Pic3)
:Return
:Lbl SX
:ClrHome
:Disp "A"
:Return
:Lbl HP
:ClrHome
:Disp "B"
:Return
:Lbl SC
:ClrHome
:Disp "C"
:Return
:Lbl EN
:ClrHome
:Disp "D"
:Return
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 05:08:39 pm
yeah.. I got that problem solved. Anyways.. now to move on to my next stage of coding.... problem now is, I need to find a way to quit the program entirely after enter has been pressed. Right now, it does what its supposed to after enter was pressed, then it re-runs the whole program again instead of ending it. I tried putting returns before the ends but that didn't help. Atm my code looks like this since i realized that I didn't need subroutines although it would help with the code. here it is:
Code: [Select]
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv r
:ClrDraw
:For(A,0,63)
:Line(0,A,95,63-A)
:DispGraph
:End
:For(A,0,95)
:Line(A,0,95-A,63)
:DispGraph
:End
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:Repeat getKey(9) or getKey(15)
:getKey→K
:If K=1
:min(M+8,52)→M
:End
:If K=4
:max(M-8,28)→M
:End
:M>N-(M<N)+N→N
:DS<(A,3
:Pt-Off(rand^96,A,Pic2)
:End
:Z+1→Z
:Vertical +
:conj(L6,L1,708)
:sub(DM)
:DispGraph
:conj(L1,L6,708)
:End
:Fix 0
:Fix 4
:
:If M=28
:ClrHome
:Disp "A"
:End
:If M=36
:ClrHome
:Disp "B"
:End
:If M=44
:ClrHome
:Disp "C"
:End
:If M=52
:Return
:End
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:End
:For(B,168,353)
:{B*2+L3}r∙{B*2+L6→C}r→{C}r
:End
:Pt-On(22,N,Pic3)
:Pt-Change(22,N,Pic3)
:Return
Title: Re: Project Snake X - help
Post by: Deep Toaster on August 09, 2010, 06:51:35 pm
yeah.. I got that problem solved. Anyways.. now to move on to my next stage of coding.... problem now is, I need to find a way to quit the program entirely after enter has been pressed. Right now, it does what its supposed to after enter was pressed, then it re-runs the whole program again instead of ending it. I tried putting returns before the ends but that didn't help. Atm my code looks like this since i realized that I didn't need subroutines although it would help with the code. here it is:
Code: [Select]
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv r
:ClrDraw
:For(A,0,63)
:Line(0,A,95,63-A)
:DispGraph
:End
:For(A,0,95)
:Line(A,0,95-A,63)
:DispGraph
:End
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:Repeat getKey(9) or getKey(15)
:getKey→K
:If K=1
:min(M+8,52)→M
:End
:If K=4
:max(M-8,28)→M
:End
:M>N-(M<N)+N→N
:DS<(A,3
:Pt-Off(rand^96,A,Pic2)
:End
:Z+1→Z
:Vertical +
:conj(L6,L1,708)
:sub(DM)
:DispGraph
:conj(L1,L6,708)
:End
:Fix 0
:Fix 4
:
:If M=28
:ClrHome
:Disp "A"
:End
:If M=36
:ClrHome
:Disp "B"
:End
:If M=44
:ClrHome
:Disp "C"
:End
:If M=52
:Return
:End
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:End
:For(B,168,353)
:{B*2+L3}r∙{B*2+L6→C}r→{C}r
:End
:Pt-On(22,N,Pic3)
:Pt-Change(22,N,Pic3)
:Return

How about this?

Quote from: BASIC Code
:.LOGO
:DiagnosticOff
:ClrDraw
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[0010181C18100000]→Pic3
:0→C
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:StorePic
:DrawInv ^r^
:ClrDraw
:For(A,0,63)
:Line(0,A,95,63-A)
:DispGraph
:End
:For(A,0,95)
:Line(A,0,95-A,63)
:DispGraph
:End
:1→A→Z
:[FDFDFDFDFFFFFFFF]→Pic2
:While 1
:getKey→K
:If K=9 or (K=15)
:ClrDraw
:Goto DM
:End
:If K=1
:min(M+8,52)→M
:End
:If K=4
:max(M-8,28)→M
:End
:M>N-(M<N)+N→N
:DS<(A,3
:Pt-Off(rand^96,A,Pic2)
:End
:Z+1→Z
:Vertical +
:conj(L6,L1,708)
:sub(DM)
:DispGraph
:conj(L1,L6,708)
:End
:Fix 0
:Fix 4
:
:If M=28
:ClrHome
:Disp "A"
:End
:If M=36
:ClrHome
:Disp "B"
:End
:If M=44
:ClrHome
:Disp "C"
:End
:If M=52
:Return
:End
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}^r^→D□65535∙{B*2+L6→C}^r^┼({B*2+Z}^r^∙D)→{C}^r^
:End
:For(B,168,353)
:{B*2+L3}^r^∙{B*2+L6→C}^r^→{C}^r^
:End
:Pt-On(22,N,Pic3)
:Pt-Change(22,N,Pic3)
:Return
Generated by SourceCoder (http://sc.cemetech.net), © 2005-2010 Cemetech (http://www.cemetech.net)

It doesn't use getKey(9)-like syntax because it confuses me :P
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 09:09:59 pm
still doesn't work. it ends the program upon enter, but it doesn't display the letter like it should unless it does it and not clears the home screen before doing so which is what should happen :(
Title: Re: Project Snake X - help
Post by: _player1537 on August 09, 2010, 09:23:37 pm
Change the ClrHomes to ClrHome:ClrDraw
Title: Re: Project Snake X - help
Post by: Runer112 on August 09, 2010, 09:55:53 pm
Don't the Axe contest rules specify that posting the entire source code for your project is not allowed until the end of the contest? Just saying. :-\

Not to mention, as DJ Omni said in the rules, "keep in mind that usage of other people's code may affect your originality score considerably."
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 09:58:06 pm
this is not the entire source, but what has been produced so far! :)

...Runer...RUNER! Holy crap, I need some commenting on what the different code's do.. just a basic outline of it, so when i work with it more, i won't have to ask myself what does that do or what's this for.

edit: heh.. i dug up those logs when you explained to me about the bitwise operations, and I think i might need a little brushing up on that.. there's still some things that I can't figure out
Title: Re: Project Snake X - help
Post by: Runer112 on August 09, 2010, 10:23:35 pm

EDIT: Wait, something is wrong.

EDIT 2: Fixed it and reattached file.
Title: Re: Project Snake X - help
Post by: Snake X on August 09, 2010, 10:25:49 pm
runner, upload it somewhere else.. its not allowing me to download it

edit2: THANK YOUUU now i can actually make the real game this time  ;D

EDIT: ok, now the problem is... appearantly, there is an error with this block: (I mean, it has all its ends to it)

Code: [Select]
:  !If M-28
:    ClrDraw
:    DrawInv
:    While getKey≠9 or getKey≠15
:    DS<(A,3)
:    Pt-On(rand^96→B,A,Pic2)
:    Pt-Change(B,A,Pic2
:   End
:   Vertical +
:   DispGraph
:  End
Title: Re: Project Snake X - help
Post by: Quigibo on August 10, 2010, 10:01:09 pm
No it doesn't.  In fact you're missing 2 of them.  Where should the "While" end and where does the "DS<" end?
Title: Re: Project Snake X - help
Post by: Snake X on August 11, 2010, 06:49:04 pm
this is interesting.. what I want it to do when I press play is to just draw the rain effect for the moment.. i'm getting some pretty interesting stuff on this code. This was in the if block. When you insert this, and press play, it draws a blank screen but after you press clear for a fair amount of times, it will exit without cleardrawing (obviously) but also show what was running (but not displaying) from the rain effect.

edit: ok, now this is just out of hand.. I messed up the main menu with this code  :(

edit 2: Runer112, can you comment more deeply in this code? I need to know what all the variables are ment for and the different numbers in the bitwise operations are for. Just as elaborate as you can I guess.

Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDrawr
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:  
:  .MOVE CURSOR
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:  
:  .ADD RAIN
:  DS<(A,5)
:    Pt-On(rand^96→B,A,Pic2)
:    Pt-Change(B,A,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  Z+1→Z
:  Vertical +
:  conj(L6,L1,708)
:  sub(DM)
:  DispGraph
:  conj(L1,L6,708)
:  
:End
:
:
:.<MENU HANDLER>
:Fix 0
:Fix 4
:ClrHome
:If K-15 and (M-52)
:  !If M-28
:    ClrDraw
:    DrawInv
:    While getKey≠9 or getKey≠15
:      DS<(A,5)
:       Pt-On(rand^96→B,A,Pic2)
:       Pt-Change(B,A,Pic2
:      End
:    End
: DispGraph
: vertical +
:  conj(L6,L1,708)
:  sub(DM)
:  DispGraph
:  conj(L1,L6,708)
:  End
:  !If M-36
:    Disp Str2
:  End
:  !If M-44
:    Disp Str3
:  End
: Else
:  
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:
:  .DRAW LOGO AND SANDSTORM
:  For(B,0,148)
:    {B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:  End
:
:  .DRAW MENU ITEMS
:  For(B,168,353)
:    {B*2+L3}r∙{B*2+L6→C}r→{C}r
:  End
:
:  .DRAW CURSOR
:  Pt-On(22,N,Pic3)
:  Pt-Change(22,N,Pic3)
:
:Return
Title: Re: Project Snake X - help
Post by: Runer112 on August 12, 2010, 01:25:31 pm
To draw just the rain, you would execute a loop with only these parts:

Code: [Select]
:  .ADD RAIN
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  Vertical +
:  DispGraph

As for a more thoroughly commented source:

Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:Fix 0
:Fix 4
:ClrHome
:
:.If user did not quit
:If K-15 and (M-52)
:
:  .If PLAY
:  !If M-28
:    Disp Str1
:  End
:
:  .If HELP
:  !If M-36
:    Disp Str2
:  End
:
:  .If SCORES
:  !If M-44
:    Disp Str3
:  End
:
:.If QUIT
:Else
:  Disp Str4
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D{box}65535{dot}{B*2+{L6}→C}{^r}{cross}({B*2+Z}{^r}{dot}D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}{dot}{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp
:.D=Temp
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.Z=Sandstorm offset
:.{L1}=Rain image backup
:.{L3}=Menu items image
:.{L6}=Rain image
Title: Re: Project Snake X - help
Post by: Snake X on August 12, 2010, 03:59:43 pm
O.O Holy crap that deserves an A+ Imho. Thanks for that. So now I can continue making the game and There is a lot I don't know about. I'll edit this when i reach another problem.. (probably soon knowing me XD)
Title: Re: Project Snake X - help
Post by: Runer112 on August 12, 2010, 04:05:25 pm
O.O Holy crap that deserves an A+ Imho. Thanks for that. So now I can continue making the game and There is a lot I don't know about. I'll edit this when i reach another problem.. (probably soon knowing me XD)

You know, if you really like a post you can click the little thumbs up in the upper right corner of it ;D
Title: Re: Project Snake X - help
Post by: Snake X on August 12, 2010, 07:10:44 pm
heh.. yeah. Ok now what im trying to do is to add another menu. I'm gonna try to make this one on my own but it might be a little difficult for me. Can you explain in specific the line:
min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N

and even more specific what the M>N-(M<N)+N→N is about? That's probably the only thing that's left that confuses me. Thanks runner. After this, im bound to get it

edit: Yikes! I tried to make a new menu for the play menu to enter Different Modes!  :o so yeah. Here's what I got so far :S (I copied and modified some parts. O and P are corresponding to M and N (O-M and N-P). Y also corresponds to K. I'm gonna test this code out right now and see how it runs so far.. Also, X mode replaces the name of the mode that is going to be the main mode of the game (I wanted it to be secret until release)

edit 2: I tried to parse it after going through a lot of token fixing, and I seem to have stumbled upon an ERR: BAD SYMBOL when it just took me to an exclamation mark. I deleted the spacing to see if that was the problem or not, but it wasn't... I know an exclamation mark is not a bad symbol. The error is on !If O-28.

Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"SELECT GAME MODE"→Str5
:"X MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDrawr
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj(L6,L1,708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj(L1,L6,708)
:
:End
:
:
:.<MENU HANDLER>
:Fix 1
:Fix 5
:ClrHome
:
:.If user did not quit
:If K-15 and (M-52)
:
:  .If PLAY
:  !If M-28
:      .ADD RAIN
:
:Repeat getKey→X=15 or (X=9)
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  Vertical +
:  DispGraph
:End
:Text(30,18,Str5)
:Text(30,28→O→P,Str6)
:Text(30,36,Str7)
:Text(30,44,Str8)
:Text(30,52,Str9)
:
:Repeat getKey→Y=9 and (O=P) or (K=15)
:  min(max(Y=1-(Y=4)*8+O,28),52)→O>P-(O<P)+P→P
:
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+L3}r∙{B*2+L6→C}r→{C}r
:  End
:  Pt-On(22,P,Pic3)
:  Pt-Change(22,P,Pic3)
:<MENU HANDLER>
:       !if O-28
:       sub(X
:       End
:       !if O-36
:       sub(TM
:       End
:       !if O-44
:       sub(Cl
:       !f O-52
:       End
:End
:  .If HELP
:  !If M-36
:    .<code>
:  End
:
:  .If SCORES
:  !If M-44
:    .<code>
:  End
:
:.If QUIT
:Else
:  Disp Str4
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+L3}r∙{B*2+L6→C}r→{C}r
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:LBL X
:Return
:LBL TM
:Return
:LBL CL
:Return
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp
:.D=Temp
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: Quigibo on August 12, 2010, 10:17:51 pm
The "<MENU HANDLER>" comment doesn't have a period in front of it.  Was that just a typo or did you actually forget it?  That could be the problem.
Title: Re: Project Snake X - help
Post by: Snake X on August 13, 2010, 06:24:27 pm
Ah. that would be the solution! thanks for that. Next problem: its all compiled, but when i ran it, the code for the original menu got messed up. I have no idea where to begin to debug that thing!  ???

edit: attached screenie. When the deformed curser goes away and it speeds up was when i pressed enter while it was on play.

edit: here it goes.. im spilling the beans. Well, ive been keeping my secret mode for a while now and ive wanted it to be a nice supprise. But, it was kind of obvious, and I would definitely need help on it. So, here goes...
My original idea was to have wall's/courses to navigate through to get to the dot. some supprise, eh? Well, i then came up with an idea to combine the game with pacman principals to create a pacman-like field to collect all the dots to advance to the next level. No ghosts of course. I was initially going to start out with 20 levels.. fat chance. 10 levels I think will be sufficient for this game. This now free's me up to ask for help when i need it ESPECIALLY with wall detection x.x.

Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"SELECT GAME MODE"→Str5
:"X MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDrawr
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj(L6,L1,708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj(L1,L6,708)
:
:End
:
:
:.<MENU HANDLER>
:Fix 1
:Fix 5
:ClrHome
:
:.If user did not quit
:If K-15 and (M-52)
:
:  .If PLAY
:  !If M-28
:      .ADD RAIN
:
:Repeat getKey→X=15 or (X=9)
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  Vertical +
:  DispGraph
:End
:Text(30,18,Str5)
:Text(30,28→O→P,Str6)
:Text(30,36,Str7)
:Text(30,44,Str8)
:Text(30,52,Str9)
:
:Repeat getKey→Y=9 and (O=P) or (K=15)
:  min(max(Y=1-(Y=4)*8+O,28),52)→O>P-(O<P)+P→P
:
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+L3}r∙{B*2+L6→C}r→{C}r
:  End
:  Pt-On(22,P,Pic3)
:  Pt-Change(22,P,Pic3)
:End
:.<MENU HANDLER>
:!If O-28
:sub(X
:End
:!If O-36
:sub(TM
:End
:!If O-44
:sub(CL
:End
:!If O-52
:End
:End
:  .If HELP
:  !If M-36
:    .<code>
:  End
:
:  .If SCORES
:  !If M-44
:    .<code>
:  End
:
:.If QUIT
:Else
:  Disp Str4
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}r→D□65535∙{B*2+L6→C}r┼({B*2+Z}r∙D)→{C}r
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+L3}r∙{B*2+L6→C}r→{C}r
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl X
:Return
:Lbl TM
:Return
:Lbl CL
:Return
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp
:.D=Temp
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: Runer112 on August 14, 2010, 12:44:16 am
The easiest way to do hit detection is a simple pixel test. This would cover both the walls and your tail, although you'd have to make sure to filter out collisions with dots so they can be handled differently.
Title: Re: Project Snake X - help
Post by: Snake X on August 14, 2010, 09:21:01 am
yes.. thank's for that suggestion.
Can you help me with my debugging situation though?

edit: that's weird.. I tried to add things step by step to find out what caused that menu to go bizarre, it happened right after I put in those extra strings!
edit 2: this is so weird! even after removing those extra strings to the way it was, it still doesn't fix it!  :-\ its if I add 1 more string, then it screws it all up. Which means.. my code actually works but either axe parser does this or Str5 is taken up temperately or something.

edit 3: I'm uploading a video. I think thats the best way to explain whats going on here. ill edit this edit when it uploads
Title: Re: Project Snake X - help
Post by: Runer112 on August 14, 2010, 01:15:35 pm
I don't know what's going on, I just copied the code you posted line for line, fixed the symbols so the calculator would accept it, and it runs fine. Here's the SourceCoder code:

Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"SELECT GAME MODE"→Str5
:"X MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:Fix 1
:Fix 5
:ClrHome
:
:.If user did not quit
:If K-15 and (M-52)
:
:  .If PLAY
:  !If M-28
:      .ADD RAIN
:
:Repeat getKey→X=15 or (X=9)
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  Vertical +
:  DispGraph
:End
:Text(30,18,Str5)
:Text(30,28→O→P,Str6)
:Text(30,36,Str7)
:Text(30,44,Str8)
:Text(30,52,Str9)
:
:Repeat getKey→Y=9 and (O=P) or (K=15)
:  min(max(Y=1-(Y=4)*8+O,28),52)→O>P-(O<P)+P→P
:
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}{dot}{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:  Pt-On(22,P,Pic3)
:  Pt-Change(22,P,Pic3)
:End
:.<MENU HANDLER>
:!If O-28
:sub(X
:End
:!If O-36
:sub(TM
:End
:!If O-44
:sub(CL
:End
:!If O-52
:End
:End
:  .If HELP
:  !If M-36
:    .<code>
:  End
:
:  .If SCORES
:  !If M-44
:    .<code>
:  End
:
:.If QUIT
:Else
:  Disp Str4
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D{box}65535{dot}{B*2+{L6}→C}{^r}{cross}({B*2+Z}{^r}{dot}D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}{dot}{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl X
:Return
:Lbl TM
:Return
:Lbl CL
:Return
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp
:.D=Temp
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image

Or were you referring to a problem with new code?
Title: Re: Project Snake X - help
Post by: Snake X on August 14, 2010, 01:17:02 pm
watch:


that was what was happening

edit: that code works.. hmm. Also, the menu that was supposedly supposed to show up when i press play isn't showing up. How would I fix that problem?
Title: Re: Project Snake X - help
Post by: Runer112 on August 14, 2010, 01:34:15 pm
The easiest thing to do would be to simply reuse the menu code that already exists. To do that, you'd want to have a label before the menu loop so you can just jump to it from the play option. That menu system uses four entries, so you'd probably want to get rid of the "SELECT GAME MODE" item (since it's not an actual option anyways) and just display the actual entries (3 game modes, 1 return to main menu). To actually display the new entries, you'd have to use a modified version of the "STORE MENU TO BACK BUFFER" code with the different string pointers before entering the menu loop. You would now need more than one menu handler, so I suggest designating another variable to hold which menu you're in (just assign different menus arbitrary numbers) and simply check which menu you're in at the menu handler so it can be processed appropriately.

EDIT: By the way, this has always bugged me. Why does the banner in your signature say both "Windows 7 User" and "Think Different - Apple"
Title: Re: Project Snake X - help
Post by: Snake X on August 14, 2010, 01:38:41 pm
Right. The "SELECT GAME MODE" is the menu title.. just like all other menu's have titles. I did copy and paste the code and modified the variables to correspond to those that already exist (for example, M corresponds with O while N corresponds with P. X corresponds with K). The only thing I don't get now is what M>N-(M<N)+N→N does. That's the last bit of info before I can truly understand the whole entire program.

edit: I have a mac and i use bootcamp to dualboot with windows 7. That's goin away soon because im gonna get a laptop this christmas
edit 2: I have been working on the code so far and when I press play, it shows just the rain as it has been.. but the interesting part is when I press clear it then shows the new menu for a split second before ending the program as seen in the screenshot.
edit 3: modified the code a tiny bit and when I press play, and then press clear, it shows the main menu but faded! and the cursor scrolls! I added another screenshot to show.
code:
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"SELECT GAME MODE"→Str5
:"X MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:Fix 1
:Fix 5
:ClrHome
:
:.If user did not quit
:If K-15 and (M-52)
:
:  .If PLAY
:  !If M-28
:      .ADD RAIN
:
:Repeat getKey→X=15 or (X=9)
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  Vertical +
:  DispGraph
:End
:Text(30,18,Str5)
:Text(30,28→O→P,Str6)
:Text(30,36,Str7)
:Text(30,44,Str8)
:Text(30,52,Str9)
:
:Repeat getKey→Y=9 and (O=P) or (K=15)
:  min(max(Y=1-(Y=4)*8+O,28),52)→O>P-(O<P)+P→P
:
:sub(DSM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:  Pt-On(22,P,Pic3)
:  Pt-Change(22,P,Pic3)
:DispGraph
:End
:.<MENU HANDLER>
:!If O-28
:sub(X
:End
:!If O-36
:sub(TM
:End
:!If O-44
:sub(CL
:End
:!If O-52
:End
:End
:  .If HELP
:  !If M-36
:    .<code>
:  End
:
:  .If SCORES
:  !If M-44
:    .<code>
:  End
:
:.If QUIT
:Else
:  Disp Str4
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D{box}65535{dot}{B*2+{L6}→C}{^r}{cross}({B*2+Z}{^r}{dot}D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}{dot}{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:Return
:
:Lbl DSM
:.DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}{dot}{B*2+{L6}→E}{^r}→{E}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,P,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,P,Pic3)
:Return
:
:Lbl X
:Return
:Lbl TM
:Return
:Lbl CL
:Return
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp
:.D=Temp
:.E=Temp
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: Runer112 on August 14, 2010, 06:17:12 pm
Is there anything wrong with having the play menu be exactly like the main menu, with the rain and logo with sandstorm? If so, you don't even need to make a new menu loop or anything else fancy, you just need to redraw the menu items to the back buffer, invert it, and re-enter the menu loop that's already there. No new cursor position variables or new anything else needed. You will, however, need a new variable to keep track of which menu you're in, because both menus will bring you to the same menu handler system and you'll need to split that up based on what menu is currently active.

I still don't see why you need the select game mode text. If the user hits play and enters a menu with options like "timed mode" and "classic mode," I think they'll probably realize they're in the game mode selection menu.
Title: Re: Project Snake X - help
Post by: Snake X on August 14, 2010, 07:00:19 pm
Ok. Well, I'll go from there.. Thanks runner for all this. I truely understand (most) of the program now including most of the bitwise operations. I don't understand the point of 'C' since its only being stored to, and what the heck is M>N-(M<N)+N→N for? I would understand the ┼({B*2+Z}r∙D), but I don't need to for the moment. I'll edit this post when i need help again
Title: Re: Project Snake X - help
Post by: Runer112 on August 14, 2010, 07:34:46 pm
C is not only being stored to, look at the end of the lines with C in it. As for M>N-(M<N)+N→N, there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.

Now, to address ┼({B*2+Z}r∙D). The loop this is in handles the logo part of the screen, and at this point in the calculation, is currently a completely white logo and rain on a black background. Inside of the parentheses, Z is the sandstorm offset, so {B*2+Z}r simple grabs the random sandstorm data. The next step is AND D. If you look back in the code, the line starts with {B*2+Pic1}→D, so D will contain the original, black logo on white background data. Combining these too with AND logic means that anything outside the logo, which is white (0) in D, will always be unaffected by the sandstorm data. The inside of the logo is black (1) in D, so the result of pixels inside the logo data will just be random according to the sandstorm. The final resulting image inside the parentheses will be a randomized sandstorm logo and a white background. This is then OR'ed onto everything else we have (a completely white logo and rain on a black background), so the white logo (before this) and the randomized logo (resulting from this) will combine to form a randomized logo, and the black background + white rain (before this) and the white background (resulting from this) will combine to form a black background + white rain. Final result: randomized logo with a black background and white rain on top of the background.
Title: Re: Project Snake X - help
Post by: Snake X on August 14, 2010, 07:54:19 pm
yeah, but C is only being something that is used for storing into.. what do you mean .→ Buffer though. I am assuming C represents the buffer? if so, then how is it being used when all there is is a →{C}r and nothing more?
Title: Re: Project Snake X - help
Post by: nemo on August 14, 2010, 08:09:32 pm
Code: [Select]
{B*2+{L3}}{^r}{dot}{B*2+{L6}→C}{^r}→{C}{^r}
see where it says {B*2+{L6}->C}? well, L6 is the area of RAM that is the buffer. the buffer has to have an address in memory. so when you store B*2+L6 to C, that makes C "point" to the address of the buffer. then when it says ->{C}{^r}, it stores to the two bytes of where C points, which is the buffer.
Title: Re: Project Snake X - help
Post by: Snake X on August 14, 2010, 08:11:23 pm
yeah.. That's the only thing that I could think of, but when you put it that way, it makes sense to me now. Thanks for that clarification nemo!

edit: I tried what you said runner about going through all the steps again and well.. it didn't work for me. here's the code and a screenie.
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj(L6,L1,708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj(L1,L6,708)
:
:End
:
:
:.<MENU HANDLER>
:Fix 0
:Fix 4
:ClrHome
:
:.If user did not quit
:If K-15 and (M-52)
:
:  .If PLAY
:  !If M-28
:Text(30,28→M→N,Str6)
:Text(30,36,Str7)
:Text(30,44,Str8)
:Text(30,52,Str9)
:DrawInv
:StorePic
:ClrDraw
:0→X
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj(L6,L1,708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj(L1,L6,708)
:
:End
:End
:  .If HELP
:  !If M-36
:    Disp Str2
:  End
:
:  .If SCORES
:  !If M-44
:    Disp Str3
:  End
:
:.If QUIT
:Else
:  Disp Str4
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:.∙=bitwise and
:.□=bitwise xor
:.┼=bitwise or
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D□65535∙{B*2+L6→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+L3}{^r}∙{B*2+L6→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp (buffer)
:.D=Temp (pic1 data)
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: nemo on August 14, 2010, 10:07:23 pm
copy/paste into SC.
umm.. i got rid of all your comments. sorry. i was trying to keep them, but they cluttered up my workspace. i didn't change very much.. just reordered some stuff around. added a ClrDraw and a DrawInv. make sure you use sourcecoder to parse it.
Code: [Select]
:.WHATYEAH
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:[8080808000000000]→Pic2
:[0010181C18100000]→Pic3
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:For(A,0,63)
:Line(0,A,95,63-A)
:DispGraph
:End
:For(A,0,95)
:Line(A,0,95-A,63)
:DispGraph
:End
:1→A→Z
:Repeat getKey→K=9 and (M=N)
:ReturnIf getKey(15)
:min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:DS<(A,5)
:Pt-Change(rand^96,1,Pic2)
:End
:Z+1→Z
:Vertical +
:conj({L6},{L1},708)
:sub(DM)
:DispGraph
:conj({L1},{L6},708)
:End
:ClrHome
:If K-15 and (M-52)
:!If M-28
:ClrDraw
:ClrDraw{^r}
:Fix 0
:Fix 5
:Text(30,28→M→N,Str6
:Text(30,36,Str7
:Text(30,44,Str8
:Text(30,52,Str9
:Fix 4
:DrawInv
:StorePic
:ClrDraw
:DrawInv
:0→X+1→A→Z
:Repeat getKey→K=9 and (M=N) or (K=15)
:min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:DS<(A,5)
:Pt-Change(rand^96,1,Pic2)
:End
:Z+1→Z
:Vertical +
:conj({L6},{L1},708)
:sub(DM)
:DispGraph
:conj({L1},{L6},708)
:End
:End
:!If M-36
:Disp Str2
:End
:!If M-44
:Disp Str3
:End
:Else
:Disp Str4
:End
:Return
:Lbl DM
:For(B,0,148)
:{B*2+Pic1}{^r}→D□65535∙{B*2+{L6}→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:End
:For(B,168,353)
:{B*2+{L3}}{^r}∙{B*2+{L6}→C}{^r}→{C}{^r}
:End
:Pt-On(22,N,Pic3)
:Pt-Change(22,N,Pic3)
:Return
:LBL X
:Return
:LBL TM
:Return
:LBL CL
:Return

first attempt at a screenshot, win/fail?


(http://img.removedfromgame.com/imgs/1281837616-Menu_Is_Flawless.gif)
Title: Re: Project Snake X - help
Post by: Snake X on August 15, 2010, 02:45:23 pm
I'm sorry.. really I am, but I need the commentary and the proper spacing. I almost went insane trying to work without it  ;). Now, I see what you mean runer and apparently it won't recognize the bit I set to determine which menu it is in. I set the bit as 0 in the first menu and 1 in the second. I used !if M-28 and X-0 for example to determine which menu I was in. Well.. that didn't help so now im lost.
code:
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:  For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N)
:ReturnIf getKey(15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N)
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:ClrHome
:   If K-15 and (M-52)
:.set menu bit
:0→X
:
:!If M-28 and X-0
:     ClrDraw
:     ClrDraw{^r}
:     Fix 0
:     Fix 5
:     Text(30,28→M→N,Str6
:     Text(30,36,Str7
:     Text(30,44,Str8
:     Text(30,52,Str9
:     Fix 4
:
:     DrawInv
:     StorePic
:     ClrDraw
:     DrawInv
:     1→A→Z→X
:
:
:   .<MENU LOOP>
:
:
:  Repeat getKey→K=9 and (M=N) or (K=15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:  .ADD RAIN
:  .Add a new rain sprite every 5 iterations of the menu loop
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  Vertical +
:  conj({L6},{L1},708)
:  sub(DM)
:  DispGraph
:  conj({L1},{L6},708)
:  End
:
:  .<MENU HANDLER>
:  !If M-28 and X-1
:     sub(ADV)
:   End
:  !If M-36 and X-1
:     sub(TM)
:   End
:End
:  .If HELP
:  !If M-36 and X-0
:    Disp Str2
:  End
:  .If SCORES
:  !If M-44 and X-0
:    Disp Str3
:  End
:
:
:.If QUIT
:Else
:  Disp Str4
:End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:.∙=bitwise and
:.□=bitwise xor
:.┼=bitwise or
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D□65535∙{B*2+{L6}→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}∙{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl ADV
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str6
:Return
:Lbl TM
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str7
:Return
:Lbl CL
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str8
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp (buffer)
:.D=Temp (pic1 data)
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.X=current menu bit
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: Runer112 on August 15, 2010, 04:03:26 pm
Using things like !If M-28 is a sort of cheap, smaller (byte-wise) way of saying If M=28. However, the problem with these types of statements is that they often will not work when trying to combine statements. If you want I can explain it, just trust me, it doesn't work. You either need to do it the right way, like:
Code: [Select]
If M=28 and (X=0)Or nest the two, like:
Code: [Select]
!If X
  !If M-28
By the way, the easiest way to split up your menu processing would be not to check individually at each value of M for the X value, but instead put an !If X in front of the whole menu handler and put all the menu 0 checks in there, and after it use Else to handle all the menu 1 checks.
Title: Re: Project Snake X - help
Post by: Snake X on August 15, 2010, 04:59:23 pm
ahh I see. Ok, so I'll edit this post if I need help.
edit: I do. at 99% 1st pass - ERR: BLOCK. It takes me to the last line! I double checked everything...
code:
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:  For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N)
:ReturnIf getKey(15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N)
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:ClrHome
:
:
:   If K-15 and (M-52)
:
:    .set menu bit
:    0→X
:
:    .If menu bit is 0
:    !If X
:
:!If M-28
:     ClrDraw
:     ClrDraw{^r}
:     Fix 0
:     Fix 5
:     Text(30,28→M→N,Str6
:     Text(30,36,Str7
:     Text(30,44,Str8
:     Text(30,52,Str9
:     Fix 4
:
:     DrawInv
:     StorePic
:     ClrDraw
:     Drawinv
:     1→A→Z
:
:
:.<MENU LOOP>
:
:
:  Repeat getKey→K=9 and (M=N) or (K=15)
:
:      .MOVE CURSOR
:      .Update the cursor destination and current position, although does not draw cursor
:      .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:      min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:      .ADD RAIN
:      .Add a new rain sprite every 5 iterations of the menu loop
:      DS<(A,5)
:        Pt-Change(rand^96,1,Pic2)
:      End
:
:      .DRAW LOGO AND MENU
:      .Shift sandstorm
:      Z+1→Z
:      Vertical +
:      conj({L6},{L1},708)
:      sub(DM)
:      DispGraph
:      conj({L1},{L6},708)
:
:  End
:
:  .<MENU HANDLER>
:  !If M-28
:     sub(ADV)
:   End
:  !If M-36
:     sub(TM)
:   End
:  !If M-44
:     sub(CL)
:  End
:  !If M-52
:  End
:.If menu bit is 1
:Else
:  .If HELP
:  !If M-36
:    Disp Str2
:  End
:  .If SCORES
:  !If M-44
:    Disp Str3
:  End
: .If QUIT
: !If M-52
:   Disp Str4
:  End
:Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:.∙=bitwise and
:.□=bitwise xor
:.┼=bitwise or
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D□65535∙{B*2+{L6}→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}∙{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl ADV
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str6
:Return
:Lbl TM
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str7
:Return
:Lbl CL
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str8
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp (buffer)
:.D=Temp (pic1 data)
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.X=current menu bit
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: Runer112 on August 15, 2010, 06:19:37 pm
Let's correctly indent this code, shall we?

Code: [Select]
:If K-15 and (M-52)
:
:  .set menu bit
:  0→X
:
:  .If menu bit is 0
:  !If X
:
:    !If M-28
:      ClrDraw
:      ClrDraw{^r}
:      Fix 0
:      Fix 5
:      Text(30,28→M→N,Str6
:      Text(30,36,Str7
:      Text(30,44,Str8
:      Text(30,52,Str9
:      Fix 4
:
:      DrawInv
:      StorePic
:      ClrDraw
:      Drawinv
:      1→A→Z
:
:
:      .<MENU LOOP>
:
:
:      Repeat getKey→K=9 and (M=N) or (K=15)
:
:        .MOVE CURSOR
:        .Update the cursor destination and current position, although does not draw cursor
:        .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:        min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:        .ADD RAIN
:        .Add a new rain sprite every 5 iterations of the menu loop
:        DS<(A,5)
:          Pt-Change(rand^96,1,Pic2)
:        End
:
:        .DRAW LOGO AND MENU
:        .Shift sandstorm
:        Z+1→Z
:        Vertical +
:        conj({L6},{L1},708)
:        sub(DM)
:        DispGraph
:        conj({L1},{L6},708)
:
:      End
:
:      .<MENU HANDLER>
:      !If M-28
:        sub(ADV)
:      End
:      !If M-36
:        sub(TM)
:      End
:      !If M-44
:        sub(CL)
:      End
:      !If M-52
:      End
:      .If menu bit is 1
:    Else
:      .If HELP
:      !If M-36
:        Disp Str2
:      End
:      .If SCORES
:      !If M-44
:        Disp Str3
:      End
:      .If QUIT
:      !If M-52
:        Disp Str4
:      End
:      Return

Looks like you're three mismatched Ends short.
Title: Re: Project Snake X - help
Post by: Snake X on August 15, 2010, 06:35:12 pm
thanks for that.. heh, nemo deleted that and I hand-added it.. guess I didn't do a good job =p

edit: x.x still get an err: block
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:  For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N)
:ReturnIf getKey(15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N)
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:ClrHome
:
:
:If K-15 and (M-52)
:
:  .set menu bit
:  0→X
:
:  .If menu bit is 0
:  !If X
:
:    !If M-28
:      ClrDraw
:      ClrDraw{^r}
:      Fix 0
:      Fix 5
:      Text(30,28→M→N,Str6
:      Text(30,36,Str7
:      Text(30,44,Str8
:      Text(30,52,Str9
:      Fix 4
:
:      DrawInv
:      StorePic
:      ClrDraw
:      Drawinv
:      1→A→Z
:
:
:      .<MENU LOOP>
:
:
:      Repeat getKey→K=9 and (M=N) or (K=15)
:
:        .MOVE CURSOR
:        .Update the cursor destination and current position, although does not draw cursor
:        .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:        min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:
:        .ADD RAIN
:        .Add a new rain sprite every 5 iterations of the menu loop
:        DS<(A,5)
:          Pt-Change(rand^96,1,Pic2)
:        End
:
:        .DRAW LOGO AND MENU
:        .Shift sandstorm
:        Z+1→Z
:        Vertical +
:        conj({L6},{L1},708)
:        sub(DM)
:        DispGraph
:        conj({L1},{L6},708)
:
:      End
:
:      .<MENU HANDLER>
:      !If M-28
:        sub(ADV)
:      End
:      !If M-36
:        sub(TM)
:      End
:      !If M-44
:        sub(CL)
:      End
:      !If M-52
:      End
:      .If menu bit is 1
:    Else
:      .If HELP
:      !If M-36
:        Disp Str2
:      End
:      .If SCORES
:      !If M-44
:        Disp Str3
:      End
:      .If QUIT
:      !If M-52
:        Disp Str4
:      End
:      Return
:
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:.∙=bitwise and
:.□=bitwise xor
:.┼=bitwise or
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D□65535∙{B*2+{L6}→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}∙{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl ADV
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str6
:Return
:Lbl TM
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str7
:Return
:Lbl CL
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str8
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp (buffer)
:.D=Temp (pic1 data)
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.X=current menu bit
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: Runer112 on August 15, 2010, 07:20:38 pm
I didn't properly indent all that code for nothing you know... There's a reason...
Title: Re: Project Snake X - help
Post by: Snake X on August 15, 2010, 07:34:57 pm
what do you mean? I looked at it and the endings look proper to me.. ¯\(°_o)/¯
thanks for indenting the code.. ill examine it a little closer here.. I just wish the Axe parser would go to the actual block if you know what i mean
edit: Ohhhh I got it now.
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 15, 2010, 08:01:48 pm
What I usually do instead of indenting is counting each loop/condition starts by 1 each time then substract 1 everytime I encounter an end, then if the final number is not 0, I miss some ends or have too many.
Title: Re: Project Snake X - help
Post by: Snake X on August 15, 2010, 08:54:32 pm
hmm.. this is weird. If i press help or scores, it displays the timed mode and classic mode which should only happen in the second menu :s
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N)
:ReturnIf getKey(15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N)
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:ClrHome
:
:
:If K-15 and (M-52)
:
:  .set menu bit
:  0→X
:
:  .If menu bit is 0
:  !If X
:
:    !If M-28
:      ClrDraw
:      ClrDraw{^r}
:      Fix 0
:      Fix 5
:      Text(30,28→M→N,Str6
:      Text(30,36,Str7
:      Text(30,44,Str8
:      Text(30,52,Str9
:      Fix 4
:   
:      DrawInv
:      StorePic
:      ClrDraw
:      Drawinv
:      1→A→Z
:   
:   
:      .<MENU LOOP>
:   
:     
:      Repeat getKey→K=9 and (M=N) or (K=15)
:   
:        .MOVE CURSOR
:        .Update the cursor destination and current position, although does not draw cursor
:        .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:        min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:   
:        .ADD RAIN
:        .Add a new rain sprite every 5 iterations of the menu loop
:        DS<(A,5)
:          Pt-Change(rand^96,1,Pic2)
:        End
:   
:        .DRAW LOGO AND MENU
:        .Shift sandstorm
:        Z+1→Z
:        Vertical +
:        conj({L6},{L1},708)
:        sub(DM)
:        DispGraph
:        conj({L1},{L6},708)
:   
:      End
:    End
:      .<MENU HANDLER>
:      !If M-28
:        sub(ADV)
:      End
:      !If M-36
:        sub(TM)
:      End
:      !If M-44
:        sub(CL)
:      End
:      !If M-52
:      End
:      .If menu bit is 1
:    Else
:      .If HELP
:      !If M-36
:        Disp Str2
:      End
:      .If SCORES
:      !If M-44
:        Disp Str3
:      End
:      .If QUIT
:      !If M-52
:        Disp Str4
:      End
:    End
:End
:      Return
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:.∙=bitwise and
:.□=bitwise xor
:.┼=bitwise or
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D□65535∙{B*2+{L6}→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}∙{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl ADV
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str6
:Return
:Lbl TM
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str7
:Return
:Lbl CL
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str8
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp (buffer)
:.D=Temp (pic1 data)
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.X=current menu bit
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: nemo on August 15, 2010, 09:14:56 pm
sorry for straightening your code.. i hate indented code. even in computer languages it bothers me when it's indented with brackets.
Title: Re: Project Snake X - help
Post by: Snake X on August 15, 2010, 09:17:17 pm
x.x nemo, idk how you would go without it tbh
Title: Re: Project Snake X - help
Post by: nemo on August 15, 2010, 09:19:44 pm
whenever i make a repeat, while, if, or for statement, i enter in a few lines and add the corresponding End statement. that way i never get an Err:Block.
Title: Re: Project Snake X - help
Post by: Snake X on August 15, 2010, 09:21:16 pm
I guess that works.. We all have our individual coding styles
Title: Re: Project Snake X - help
Post by: Builderboy on August 16, 2010, 12:41:36 am
I <3 indented code ^^ I <3 it so much I started writing a small font editor in Axe so i could edit my Axe programs with indented code in real time :)
Title: Re: Project Snake X - help
Post by: Snake X on August 16, 2010, 04:05:23 pm
yeah.. but still, my code has an issue. Once I get this sorted out, I can actually start coding the game! issue is if I press help or scores, it will go into the subroutines which makes it display timed mode/classic mode which should only happen if the bit is set to 1 I think it is?
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N)
:ReturnIf getKey(15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N)
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End
:
:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:
:.<MENU HANDLER>
:ClrHome
:
:
:If K-15 and (M-52)
:
:  .set menu bit
:  0→X
:
:  .If menu bit is 0
:  !If X
:
:    !If M-28
:      ClrDraw
:      ClrDraw{^r}
:      Fix 0
:      Fix 5
:      Text(30,28→M→N,Str6
:      Text(30,36,Str7
:      Text(30,44,Str8
:      Text(30,52,Str9
:      Fix 4
:    
:      DrawInv
:      StorePic
:      ClrDraw
:      Drawinv
:      1→A→Z
:    
:    
:      .<MENU LOOP>
:    
:    
:      Repeat getKey→K=9 and (M=N) or (K=15)
:    
:        .MOVE CURSOR
:        .Update the cursor destination and current position, although does not draw cursor
:        .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:        min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:    
:        .ADD RAIN
:        .Add a new rain sprite every 5 iterations of the menu loop
:        DS<(A,5)
:          Pt-Change(rand^96,1,Pic2)
:        End
:    
:        .DRAW LOGO AND MENU
:        .Shift sandstorm
:        Z+1→Z
:        Vertical +
:        conj({L6},{L1},708)
:        sub(DM)
:        DispGraph
:        conj({L1},{L6},708)
:    
:      End
:    End
:      .<MENU HANDLER>
:      !If M-28
:        sub(ADV)
:      End
:      !If M-36
:        sub(TM)
:      End
:      !If M-44
:        sub(CL)
:      End
:      !If M-52
:      End
:      .If menu bit is 1
:    Else
:      .If HELP
:      !If M-36
:        Disp Str2
:      End
:      .If SCORES
:      !If M-44
:        Disp Str3
:      End
:      .If QUIT
:      !If M-52
:        Disp Str4
:      End
:    End
:End
:      Return
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:.∙=bitwise and
:.□=bitwise xor
:.┼=bitwise or
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D□65535∙{B*2+{L6}→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}∙{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl ADV
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str6
:Return
:Lbl TM
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str7
:Return
:Lbl CL
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str8
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp (buffer)
:.D=Temp (pic1 data)
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.X=current menu bit
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: Runer112 on August 16, 2010, 07:58:05 pm
Notice a problem?

Code: [Select]
:.<MENU HANDLER>
:ClrHome
:
:
:If K-15 and (M-52)
:
:  .set menu bit
:  0→X
:
:  .If menu bit is 0
:  !If X
Title: Re: Project Snake X - help
Post by: Snake X on August 16, 2010, 08:06:10 pm
ohh, the ! shouldn't be there, should it
edit: that would make it work.. but not the second menu.. ill work on that
edit 2: This should be COMPLETELY working. Idk why it isn't because all if's and ends are all tied together and I made sure of that through and through over and under, in and out times 2. I'll even make sure this is correct before i click the save button for this edit to show up
Code: [Select]
:If K-15 and (M-52)
:
:  0→X
:  If X=0
:   
:    !If M-28
:   
:      ClrDraw
:      ClrDraw{^r}
:      Fix 0
:      Fix 5
:      Text(30,28→M→N,Str6
:      Text(30,36,Str7
:      Text(30,44,Str8
:      Text(30,52,Str9
:      Fix 4 
:      DrawInv
:      StorePic
:      ClrDraw
:      DrawInv
:      1→A→Z
:     
:      Repeat getKey→K=9 and (M=N) or (K=15)
:        min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:     
:        DS<(A,5)
:          Pt-Change(rand^96,1,Pic2)
:        End
:     
:        Z+1→Z
:        Vertical +
:        conj({L6},{L1},708)
:        sub(DM)
:        DispGraph
:        conj({L1},{L6},708)
:      End
:     
:      !If M-28
:        sub(ADV)
:      End
:      !If M-36
:        sub(TM)
:      End
:      !If M-44
:        sub(CL)
:      End
:      !If M-52
:      End
:    End
:     
:    If X=1
:      .If HELP
:      !If M-36
:        Disp Str2
:      End
:      .If SCORES
:      !If M-44
:        Disp Str3
:      End
:      .If QUIT
:      !If M-52
:        Disp Str4
:      End
:    End
:End
:      Return
Title: Re: Project Snake X - help
Post by: Runer112 on August 16, 2010, 08:47:38 pm
Notice a problem?

Code: [Select]
:.<MENU HANDLER>
:ClrHome
:
:
:If K-15 and (M-52)
:
:  .set menu bit
:  0→X
:
:  .If menu bit is 0
:  !If X

Let me try to more accurately pin down the problem...

Code: [Select]
:  .set menu bit
:  0→X
:
:  .If menu bit is 0
:  !If X
Title: Re: Project Snake X - help
Post by: Snake X on August 16, 2010, 09:04:37 pm
Runer, I don't see what your getting at to be honest. I have inverted the bits (:1->x :.if bit is 1 :If X), flipping them both ways (:1->X :!If X) (0->X :If X) and none of those 3 options have worked. I know its the most obvious thing for you, but for me, it's not.
Title: Re: Project Snake X - help
Post by: calcdude84se on August 16, 2010, 09:13:01 pm
What he's saying is that you're setting it and immediately after checking it.
Either eliminate the condition or move the 1->X to where it belongs, outside the first conditional. (Almost certainly the latter)
Title: Re: Project Snake X - help
Post by: Snake X on August 16, 2010, 10:04:23 pm
Ok. I put the bit outside of the !If K-15 and (M-52). I found out if I set it to 1, the first menu works. If I set it to 0, the second menu works. I can't seem to get both of them to work together
Title: Re: Project Snake X - help
Post by: Runer112 on August 17, 2010, 12:19:45 am
*Facepalm*





EDIT: See http://ourl.ca/6612/110367 (http://ourl.ca/6612/110367)
Title: Re: Project Snake X - help
Post by: Snake X on August 17, 2010, 07:01:23 am
What he's saying is that you're setting it and immediately after checking it.
Either eliminate the condition or move the 1->X to where it belongs, outside the first conditional. (Almost certainly the latter)
wait are you sure it was 1->x?
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 17, 2010, 09:03:34 am
*Facepalm*
Sorry but I had to rate down this comment as it was rude and uncalled for. You know Omnimaga is supposed to be free from hostility towards new members, right? If you cannot help Snake X in a respectful manner, you should just ignore his questions and let someone else do it. Not that he was even supposed to receive this much help anyway (even less posting this much source code for his program), because now his program is disqualified from the Axe contest.
Title: Re: Project Snake X - help
Post by: calcdude84se on August 17, 2010, 12:46:12 pm
Oh, disqualified? Poor Snake_X :(
Well, we can still help you make a great game, even if not for the contest :)
Title: Re: Project Snake X - help
Post by: LordConiupiter on August 17, 2010, 03:19:01 pm
Oh, disqualified? Poor Snake_X :(
Well, we can still help you make a great game, even if not for the contest :)
when he wants to continue, I'm willing to help too,  cuz it looks like it's gonna be a great game!
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 17, 2010, 03:23:34 pm
Yeah same, or he could create a spinoff for the contest and release Snake later. He would still get a lower originality score if he reused a lot of code (and the title screen) but it would be eligible if he did not post that many code.

Plus I warned him on IRC a while ago, not to mention Runer112 did on this topic at the beginning.
Title: Re: Project Snake X - help
Post by: Runer112 on August 17, 2010, 03:33:28 pm
I'm sorry about the "facepalm" post, I was just a little disappointed that you were taking a while to understand what I was getting at. It was uncalled for.

Anyways, it looks like I guided this project right into the garbage can. I'm sorry Snake X. :'(
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 17, 2010, 03:51:57 pm
Nah I don't think you are the one responsible for the disqualification. It's the contestant's own responsibility for not breaking the contest rules. By page 1 it was ok, all he would have gotten away with is a drop on his originality score, but then on Page 3, the source code he was posting was pretty much the entire game progress so far, meaning he would have posted a 8xp and it would've been the same thing. It was up to him to tell you he cannot post more source code or to not request help requiring the posting of everything.

As for the comment, I think it's best to remember that not everyone understands everything as fast as each others. I personally never got how your Zooming routine worked, despite your explanations. Also, sometimes it takes multiple people to explain things, as everyone got different methods to explain stuff.
Title: Re: Project Snake X - help
Post by: Snake X on August 17, 2010, 04:11:10 pm
I'm gonna continue it. Runer112, a note: I just would never suspect how the spacing would matter between when the bit is set and the bit is checked. In real-time processing, it doesn't even know that it's going to get checked until it comes across that point of code.

another note: To be completely honest, I knew this program was going to not make it. I knew it the instant I realized how much would have to go into this now I know how long it would take to program such a game. Runer112, you were only trying to help. I personally give you credit for that and I just want you to know that whatever you did, you were only trying to make the game succeed.
Title: Re: Project Snake X - help
Post by: Quigibo on August 17, 2010, 04:35:21 pm
Well, since its not for the contest anymore, it will certainly be easier to debug and you can post the source code directly.  The problems you seem to be having are really not Axe related but usually programming in general, that is the same type of problems you would get had you been working on a BASIC program or Java or C.  I'm not sure if Axe is the best language to start off with because it is a mid-level language that requires more experience with programming languages to be good at.  That doesn't mean you shouldn't work on Axe projects, it just means that you're going to need a lot more guidance and assistance since you're learning the fundamentals of programming at the same time as the difficulties of Axe itself.

calcdude said the reverse when he was trying to explain what runer meant so that probably let to more confusion.  What they were trying to say was that you first set the X variable to 0 then have a conditional "Is X zero?" in which case it will always be zero since you just set it to that.  You have to set X to 0 outside of the main loop near the start of the program so that it doesn't keep resetting it back to zero after each iteration of the loop.
Title: Re: Project Snake X - help
Post by: Snake X on August 17, 2010, 04:54:43 pm
Alright, Enough said. I FINALLY got the menu working and now I can start creating sprites for the actual game now!
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 17, 2010, 04:57:12 pm
I think he did BASIC before, when he was Revsoft member. I'M not sure how far he went, though. That said, I recommend some TI-BASIC or z80 ASM background knowledge before attempting Axe, but fortunately a lot of people around here can help. If you only know TI-BASIC, you might have a bit of an hard time with pointers at first, though.
Title: Re: Project Snake X - help
Post by: LordConiupiter on August 17, 2010, 05:05:54 pm
Alright, Enough said. I FINALLY got the menu working and now I can start creating sprites for the actual game now!
you can easily create sprites with my MaskConverter (http://ourl.ca/6704).
the tiles.bmp file can be created with any program you like. personally I like to use Paint.NET.

good luck!
Title: Re: Project Snake X - help
Post by: Snake X on August 17, 2010, 07:11:09 pm
thanks, but I think 16x16 is too big in this case ;)
Title: Re: Project Snake X - help
Post by: LordConiupiter on August 18, 2010, 04:34:28 pm
Tou see 4 lines of data when it is converted. you can just only use the first line, which is the left topmost sprite of 8x8 pixels!
Title: Re: Project Snake X - help
Post by: Snake X on August 18, 2010, 06:33:59 pm
Alright.. since I have been working to get the menu done for such a long time (in my eyes), im going to put the project in a sleep state. I'll work on it again in maybe 1-2 weeks if I feel like it, don't have homework to do, etc.
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 20, 2010, 12:23:33 pm
Aw sorry to hear, I hope you don't kill the project/lose interest :S

GOod luck!
Title: Re: Project Snake X - help
Post by: Snake X on August 20, 2010, 12:27:43 pm
no way. I didn't put all that to nuthin you know =p. Nahh i won't loose interest. Just.. a break for now
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 22, 2010, 06:38:25 pm
kk, I can't wait for progress to resume again :)
Title: Re: Project Snake X - help
Post by: Snake X on August 31, 2010, 07:16:34 am
Alright! It broke my heart when i saw http://www.ticalc.org/archives/files/fileinfo/401/40143.html as number 11 on the top downloads list for the past 7 days. The thing i need to focus on right now is designs for the actual snake. I want to do something really neat with this but im not sure what.. I might consider suggestions, but this needs to be original. I'll be brainstorming throughout the day about some design's but for now im just getting this post out.
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on August 31, 2010, 02:53:46 pm
Wha...? Darn why such random files (that are not necessarly bad, but not even close from being special or standing out) gets so much downloads while even better Snake games barely get any? I mean, I would rather get more downloads on Reuben Quest and Metroid II than Axe Tunnel and Illusiat TI-81 remake.

Well good luck Snake_X with your snake project. I hope you finish it.
Title: Re: Project Snake X - help
Post by: Snake X on September 03, 2010, 07:15:56 pm
I have got to the point where I just need to find the appropriate position for 1->x
Code: [Select]
:.SNAKEX
:
:.<DATA>
:.LOGO
:[07C0000000000000000000001FE0000000000000000000001FF0000000780000000000003FF0000000FC0000000001F87FF7CF0000FC0000000787F87FF7DF87E0FC0000001F87F07BF7FF8FF0FC0000003F87E079E7FF8FF8FC0000003FC7C07F07FF9FFCFC1000001FEF807FE7FF8FFCFC7C00000FFF807FF7FF8FFCFDFE1E0007FF807FF7FF8FFEFDFE3FC003FF001FF7FF9FFEFFFC7FC001FE0001F7FF9FFEFFF8FFC001FF0039F7EF9FFEFFE0FFC000FF8079F7EFDFFEFFC1FBC001FFC0FFF7EFDFFEFFE1FFC003FFF0FFF7C30FFEFFE1FFC003FFFC7FE3C00FDFFFF1FF8007E7FC1F0000000EFDFFFDE00FC3FC00000000007CFEFBE01F83F80000000000187EFFE03F83F80000000000003E7FE03F8040000000000000003FC03F00000000000000000000000E]→Pic1
:
:.MENU RAIN
:[8080808000000000]→Pic2
:
:.MENU ARROW
:[0010181C18100000]→Pic3
:
:.MENU ITEMS
:"PLAY"→Str1
:"HELP"→Str2
:"SCORES"→Str3
:"QUIT"→Str4
:"ADVENTURE MODE"→Str6
:"TIMED MODE"→Str7
:"CLASSIC MODE"→Str8
:"MAIN MENU"→Str9
:
:.<INITIALIZING>
:DiagnosticOff
:ClrDraw
:ClrDraw{^r}
:
:.STORE MENU TO BACK BUFFER
:Fix 1
:Fix 5
:Text(30,28→M→N,Str1)
:Text(30,36,Str2)
:Text(30,44,Str3)
:Text(30,52,Str4)
:DrawInv
:StorePic
:ClrDraw
:
:.INTRO EFFECT
:For(A,0,63)
:  Line(0,A,95,63-A)
:  DispGraph
:End
:For(A,0,95)
:  Line(A,0,95-A,63)
:  DispGraph
:End
:
:1→A→Z
:  0→X
:
:.<MENU LOOP>
:Repeat getKey→K=9 and (M=N)
:ReturnIf getKey(15)
:
:  .MOVE CURSOR
:  .Update the cursor destination and current position, although does not draw cursor
:  .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N)
:  min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:  DS<(A,5)
:    Pt-Change(rand^96,1,Pic2)
:  End

:  .DRAW LOGO AND MENU
:  .Shift sandstorm
:  Z+1→Z
:  .Move rain down
:  Vertical +
:  .Backup rain image
:  conj({L6},{L1},708)
:  .Draw logo, sandstorm, menu, and cursor
:  sub(DM)
:  .Update screen
:  DispGraph
:  .Restore rain image
:  conj({L1},{L6},708)
:
:End
:
:.<MENU HANDLER>
:ClrHome
:
:If K-15 and (M-52)
:
:  .set menu bit

:  .If menu bit is 0
:  !If X
:     
:    !If M-28
:      ClrDraw
:      ClrDraw{^r}
:      Fix 0
:      Fix 5
:      Text(30,28→M→N,Str6
:      Text(30,36,Str7
:      Text(30,44,Str8
:      Text(30,52,Str9
:      Fix 4
:     
:      DrawInv
:      StorePic
:      ClrDraw
:      DrawInv
:      1→A→Z
:     
:     
:      .<MENU LOOP>
:     
:     
:      Repeat getKey→K=9 and (M=N) or (K=15)
:     
:        .MOVE CURSOR
:        .Update the cursor destination and current position, although does not draw cursor
:        .there are three things being combining to get a new value of N. First, M>N will be 1 if M (destination) is greater than N (current position), so the expression will be 1 so far. Second is -(M<N), which will evaluate to -1 if M is less than N, so this subtracts 1 in this case. This can only be true if the first expression is false, so the expression will now equal 1 if M>N, -1 if M<N, or 0 is neither are true (M=N). This offset is then applied to N, either moving N in the appropriate direction towards M or, if N already equals M, not changing it at all.
:        min(max(K=1-(K=4)*8+M,28),52)→M>N-(M<N)+N→N
:     
:        .ADD RAIN
:        .Add a new rain sprite every 5 iterations of the menu loop
:        DS<(A,5)
:          Pt-Change(rand^96,1,Pic2)
:        End
:     
:        .DRAW LOGO AND MENU
:        .Shift sandstorm
:        Z+1→Z
:        Vertical +
:        conj({L6},{L1},708)
:        sub(DM)
:        DispGraph
:        conj({L1},{L6},708)
:     
:      End
:      .<MENU HANDLER>
:      !If M-28
:        sub(ADV)
:      End
:      !If M-36
:        sub(TM)
:      End
:      !If M-44
:        sub(CL)
:      End
:      !If M-52
:      End
: 1→X
:    End
:      .If menu bit is 1
:  Else
:      .If HELP
:      !If M-36
:        Disp Str2
:      End
:      .If SCORES
:      !If M-44
:        Disp Str3
:      End
:      .If QUIT
:      !If M-52
:        Disp Str4
:      End
:  End
:End
:      Return
:
:.<SUBROUTINES>
:.DRAW MENU
:Lbl DM
:.∙=bitwise and
:.□=bitwise xor
:.┼=bitwise or
:
:  .DRAW LOGO AND SANDSTORM
:  .Loop through the logo, 2 bytes at a time
:  For(B,0,148)
:    .Logo data - End state: Black logo image on white bg
:    .XOR 65535 - Inverts logo data - End state: White logo image on black bg
:    .AND Rain image - If either is white (0), output is white, so logo and rain remain white - End state: White logo image and white rain on black bg
:    .OR *Must wait for data in parentheses to be parsed* :
:      .Sandstorm garbage
:      .AND Logo data - This is the original, black on white logo. For the outside of the logo text, which is white (0), all ANDs will result in staying white (no change, so outside of logo text is unaffected) - The black text of the logo is all black (1), so the end state will be determined by the random data of the sandstorm - End state: Random black/white image on white bg
:    .OR ^ - The only areas of ^ which can be black are the logo text, so everything outside the logo text will be unaffected, while areas inside (previously white) will take on the random sandstorm image - End state: Sandstorm logo image and white rain on black bg
:    .→ Buffer
:    {B*2+Pic1}{^r}→D□65535∙{B*2+{L6}→C}{^r}┼({B*2+Z}{^r}∙D)→{C}{^r}
:  End
:
:  .DRAW MENU ITEMS
:  .Loop through the menu image, 2 bytes at a time
:  For(B,168,353)
:    .Menu image - End state: White text on black bg
:    .AND Rain image - If either is white (0 - menu text and rain droplets), result will be white (0) - End state: White menu items and rain on black bg
:    .→ Buffer
:    {B*2+{L3}}{^r}∙{B*2+{L6}→C}{^r}→{C}{^r}
:  End
:
:  .DRAW CURSOR
:  .Draw black cursor, turning any rain that might have been there black
:  Pt-On(22,N,Pic3)
:  .Invert cursor, turning cursor white
:  Pt-Change(22,N,Pic3)
:
:Return
:
:Lbl ADV
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str6
:Return
:Lbl TM
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str7
:Return
:Lbl CL
:  ClrDraw
:  ClrDraw{^r}
:  Disp Str8
:Return
:
:
:.<VARIABLES>
:.A=Counter to add rain
:.B=Temp loop variable for Lbl DM
:.C=Temp (buffer)
:.D=Temp (pic1 data)
:.K=getKey
:.M=Menu cursor destination
:.N=Menu cursor current display position
:.X=current menu bit
:.Z=Sandstorm offset
:.L1=Rain image backup
:.L3=Menu items image
:.L6=Rain image
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on September 07, 2010, 02:16:40 am
bump in case no one notices the edit (since it was pretty low in the list)
Title: Re: Project Snake X - help
Post by: Snake X on September 07, 2010, 08:23:26 pm
thanks for that DJ. Right now, I think that either _player or runer112 would be able to help me at this point.. or quigibo. They are the ones who actually understand how this thing is coded and the workings of it. Until I get this nasty bug fixed, im afraid the project is on hold.
Title: Re: Project Snake X - help
Post by: Runer112 on September 07, 2010, 09:17:18 pm
I don't know what you mean exactly. Why don't you just rework the menu system so there's just one menu displaying routine and one menu input handling routine, it would save a lot of space and make control easier to handle.
Title: Re: Project Snake X - help
Post by: Snake X on September 07, 2010, 09:22:22 pm
I wouldn't know how to do that exactly :s
Title: Re: Project Snake X - help
Post by: Snake X on September 22, 2010, 05:05:58 pm
Ok, so the project is going in a hybernation as I don't have as much time, knowledge, and most of all, motivation. THE PROJECT IS NOT CANCELED!!! I NEVER CANCEL PROJECTS I DONT FINISH :D

edit: even if that means years to come, i still wont cancel it (once i actually had a project that was delayed for 2 years!)
Title: Re: Project Snake X - help
Post by: DJ Omnimaga on September 22, 2010, 11:18:26 pm
I hope you stick around, though, and find some time to work on another project. I hope you resume this one soon. :(