Author Topic: Project Snake X - help  (Read 26291 times)

0 Members and 1 Guest are viewing this topic.

_player1537

  • Guest
Re: Project Snake X - help
« Reply #15 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

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Project Snake X - help
« Reply #16 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
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Project Snake X - help
« Reply #17 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
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Project Snake X - help
« Reply #18 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
« Last Edit: August 09, 2010, 05:09:08 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Project Snake X - help
« Reply #19 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, © 2005-2010 Cemetech

It doesn't use getKey(9)-like syntax because it confuses me :P




Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Project Snake X - help
« Reply #20 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 :(
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

_player1537

  • Guest
Re: Project Snake X - help
« Reply #21 on: August 09, 2010, 09:23:37 pm »
Change the ClrHomes to ClrHome:ClrDraw

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Project Snake X - help
« Reply #22 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."
« Last Edit: August 09, 2010, 09:56:57 pm by Runer112 »

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Project Snake X - help
« Reply #23 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
« Last Edit: August 09, 2010, 10:00:51 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Project Snake X - help
« Reply #24 on: August 09, 2010, 10:23:35 pm »
  • Fixed menu selection
  • Tweaked rain effect
  • Optimized cursor movement code
  • Commented and indented everything
  • Since this will probably start becoming the actual game soon, changed header to .SNAKEX instead of .LOGO

EDIT: Wait, something is wrong.

EDIT 2: Fixed it and reattached file.
« Last Edit: August 09, 2010, 10:29:45 pm by Runer112 »

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Project Snake X - help
« Reply #25 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
« Last Edit: August 10, 2010, 09:45:21 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Project Snake X - help
« Reply #26 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?
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Project Snake X - help
« Reply #27 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
« Last Edit: August 11, 2010, 08:12:21 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Project Snake X - help
« Reply #28 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

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Project Snake X - help
« Reply #29 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)
Loved this place, still the best producers of power metal, and sparked my dreams of coding.