0 Members and 2 Guests are viewing this topic.
:.AXETEST:identity(3FFC3FFC30CF30CF300C300C0C300C303FFC3FFC330C330C3FFC3FFCF00FF00F):0→X:56→Y:[7E4B42247E527EC3]→Pic1:Repeat getKey(15):StorePic :Pt-On(X,Y,Pic1):DispGraph:Pt-Change(X,Y,Pic1:RecallPic :If getKey(2):Lbl PIP:[7ED242247E4A7EC3]→Pic2:X-1→X:Goto LEFT:End:If getKey(3):Lbl PI:X+2→X:End:If getKey(4):Lbl IP:[7E7E42247EC37EC3]→Pic3:Y-1→Y:Goto UP:End:If getKey(1):Lbl PIPI:[7E665A247EC37EC3]→Pic4:Y+1→Y:Goto DOWN:End:End:Lbl LEFT:Repeat getKey(15):StorePic :Pt-On(X,Y,Pic2):DispGraph:Pt-Change(X,Y,Pic2:RecallPic :If getKey(2):X-2→X:End:If getKey(3):Goto PI:End:If getKey(4):Goto IP:End:If getKey(1):Goto PIPI:End:End:Lbl UP:Repeat getKey(15):StorePic :Pt-On(X,Y,Pic3):DispGraph:Pt-Change(X,Y,Pic3):RecallPic :If getKey(4):Y-1→Y:End:If getKey(2):Goto PIP:End:If getKey(3):Goto PI:End:If getKey(1):Goto PIPI:End:End:Lbl DOWN:Repeat getKey(15):StorePic :Pt-On(X,Y,Pic4:DispGraph:Pt-Change(X,Y,Pic4:RecallPic :If getKey(1):Y+1→Y:End:If getKey(2):Goto PIP:End:If getKey(3):Goto PI:End:If getKey(4):Goto IP:End:End:
:.AXETEST:identity(3FFC3FFC30CF30CF300C300C0C300C303FFC3FFC330C330C3FFC3FFCF00FF00F)::[]→Pic1:[7E665A247EC37EC3] .DOWN:[7ED242247E4A7EC3] .LEFT:[7E4B42247E527EC3] .RIGHT:[7E7E42247EC37EC3] .UP::.START FACING RIGHT AT (0,56)::2*8+Pic1→S:0→X:56→Y:.THIS DOESN'T NEED TO BE INSIDE THE LOOP::StorePic ::While 1: Pt-On(X,Y,S): DispGraph: .ERASING WITH Pt-Change() UNNECESSARY BECAUSE:: RecallPic : If getKey(1): Y+2→Y: 0*8+Pic1→S: End: If getKey(2): X-2→X: 1*8+Pic1→S: End: If getKey(3): X+2→X: 2*8+Pic1→S: End: If getKey(4): Y-2→Y: 3*8+Pic1→S: End:.OPTIMIZED POST-CHECK LOOP::End!If getKey(15)
:.AXETEST:identity(3FFC3FFC30CF30CF300C300C0C300C303FFC3FFC330C330C3FFC3FFCF00FF00F)::[]→Pic1:[7ED242247E4A7EC3] .LEFT:[7E7E42247EC37EC3] .UP:[7E4B42247E527EC3] .RIGHT:[7E665A247EC37EC3] .DOWN::56→Y: and 0→X:→S::While 1: ClrDraw: Pt-On(X,Y,S*8+16+Pic1): DispGraph: If getKey(1)-getKey(4): →S: *2+Y→Y: End: If getKey(3)-getKey(2): -1→S+1: *2+X→X: End:EndIf getKey(15)
ClrDrawDiagnosticsOff.A=x_pos, B=y_pos, C=direction_faced0->A->B->C[sprite data, one after another, ordered up, down, left, right stored here]->Pic1Repeat getkey(15)if getkey(4)-getkey(1).go upif getkey(4)-1->CB--end.go downif getkey(1)->CB++endendif getkey(2)-getkey(3).go leftif getkey(2)+1->CA--end.go rightif getkey(3)+2->CA++endendClrDrawPt-On(A,B,C*8+Pic1DispGraphend
:.KARRACE:identity(318C4BD24FF24E724FF2366C0FF0166818181BD87BDE981997E99FF99FF967E6):.KAR:[314B4F4E4F360F16]→Pic1:[8CD2F272F26CF068]→Pic2:[181B7B98979F9F67]→Pic3:[18D8DE19E9F9F9E6]→Pic4:.DRAW:Repeat getKey(15):Pt-On(0,0,Pic1:Pt-On(0,8,Pic3:Pt-On(8,0,Pic2:Pt-On(8,8,Pic4:DispGraph:End
:.KARRACE:identity(318C4BD24FF24E724FF2366C0FF0166818181BD87BDE981997E99FF99FF967E6):.KAR:[314B4F4E4F360F16]→Pic1:[8CD2F272F26CF068]→Pic2:[181B7B98979F9F67]→Pic3:[18D8DE19E9F9F9E6]→Pic4:.DRAW:Repeat getKey(15):Pt-On(0,,Pic1:Pt-On(0,8,Pic3:Pt-On(8,0,Pic2:Pt-On(8,,Pic4:DispGraph:End
Code:Code: [Select]:.KARRACE:identity(318C4BD24FF24E724FF2366C0FF0166818181BD87BDE981997E99FF99FF967E6):.KAR:[314B4F4E4F360F16]→Pic1:[8CD2F272F26CF068]→Pic2:[181B7B98979F9F67]→Pic3:[18D8DE19E9F9F9E6]→Pic4:.DRAW:Repeat getKey(15):Pt-On(0,,Pic1:Pt-On(0,8,Pic3:Pt-On(8,0,Pic2:Pt-On(8,,Pic4:DispGraph:Endthat's all i seeEdit: It will be best to stick with Pt-On IMO, as you already have the command in the previous and assumed related code
What is this "peephole optimizer" of which you speak? How do I use it?
Even this is unnecessary due to the new peephole optimizer
Although I believe (I need Runer to confirm) that a While 1 : EndIf getKey(15) might be better than Repeat getKey(15) : End
Quote from: squidgetx on April 05, 2012, 10:32:07 pmEven this is unnecessary due to the new peephole optimizer It would make sense to think this, but this is actually not true. A peephole optimization to do this was added in Axe 1.0.5, but it was disabled in the next version (Axe 1.1.0) and has been ever since. Don't ask me why because I don't know; a quick test with Axe 1.0.5 appears to suggest that the optimization works fine. Perhaps I'll ask Quigibo in a more appropriate thread why this optimization (called o_PushPop5 in Commands.inc) is disabled.Quote from: squidgetx on April 05, 2012, 10:32:07 pmAlthough I believe (I need Runer to confirm) that a While 1 : EndIf getKey(15) might be better than Repeat getKey(15) : EndThis is true.
I was looking through the code of Eat Nethams(it seemed easy) to try to understand it. I'm having trouble figuring out how it is displaying so many lobsters at once. Can someone explain this to me?
Quote from: Spenceboy98 on January 02, 2013, 10:51:41 pmI was looking through the code of Eat Nethams(it seemed easy) to try to understand it. I'm having trouble figuring out how it is displaying so many lobsters at once. Can someone explain this to me?*BUMP*Can no one help me with this^^^^?