0 Members and 1 Guest are viewing this topic.
.A2048.Sprite for the Tiles[FF818181818181FF]->Pic0[FF818199998181FF]->Pic1[FF8189B99D9181FF]->Pic2[FF81FF8181FF81FF]->Pic3[FF81BDA5A5BD81FF]->Pic4[FFA5FFA5A5FFA5FF]->Pic5[FF9999FFFF9999FF]->Pic6[FFC3A59999A5C3FF]->Pic7[FFC3BDBDBDBDC3FF]->Pic8[FFFFC3DBDBC3FFFF]->Pic9[FFFFFFE7E7FFFFFF]->Pic10[FFABD5ABD5ABD5FF]->Pic11[FFFFFFFFFFFFFFFF]->Pic12.Logo BitmapData(40,16)->Pic0A[FFFFF0FF00818190818081819F8180F999999980F999999980819981818081998181809F99F999809F99F9998081818981808181898180FFFF8FFF807FFF87FF80000000000000000000000000000000].Help screen BitmapsData(16,56)->Pic0B[FF00810081609910992081408170FF000000FF0081008940B9509D7091108110FF000000FF008100FF7081508170FF508170FF000000FF008100BD23A564A527BD258177FF000000FF00A500FF66A511A522FF14A567FF000000FF0099009934FF45FF7799519971FF00000000000000]Data(24,56)->Pic0C[0000FF0000C304CEA50C2A99044E99048AA50EEEC30000FF0000000000FF0000C30CE6BD0288BD04CEBD082ABD0ECEC30000FF0000000000FF0000FF0E4CC308C2DB0C44DB0248C30CEEFF0000FF0000000000FF0000FF44C8FFCA2AE74A4EE74A82FFE4E2FF0000FF0000000000FF0000ABC48ED52AAAAB4AEED58A2AABE42ED50000FF0000000000FF0000FF84E6FFAAA8FFEAEEFF2A2AFF24CEFF0000FF000000000000000000]DiagnosticOffExprOnFullFill(L1,16,0)0->I->J->K.Default value for the NEW subroutine, see below1->{L1+16}.Create or load an appvar for the game tableUnArchive "appvA"!If GetCalc("appvA"GetCalc("appvA",20)->QR()ElseGetCalc("appvA")->QEnd.Recover last sessionLOAD().Main LoopRepeat getKey(15)If getKeyIf getKey(1)DOWN()EndIf getKey(2)LEFT()EndIf getKey(3)RIGHT()EndIf getKey(4)UP()EndIf getKey(55)R()EndIf getKey(54)H()EndEndD()EndIf S>{Q+18}^^rS->{Q+18}^^rEndSAVE()ReturnLbl DOWN.By default, no move has been done0->theta.Check all columns (J)For(J,0,3)3->NFor(K,1,3).K is used to make a For( loop with I from 3 to 1.X is the address of the target cell, it's by default the cell below the evaluated one3-K->I+1->X.If the evaluated cell contains a numberIf {4*I+J+L1}->V!=0.Main loop to find a target position.Find a cell with the same value as the evaluated cell .or an obstacle .or X reaches the limitRepeat {4*X+J+L1}->T=V or (T!=V and (T!=0)) or (X=N)X++End{4*X+J+L1}->T.If an obstacle was found, the target cell is one row upwardsIf T!=V and (T!=0)X--End.If any movement is made (target cell is different from evaluated cell)If X!=I.If target cell is emptyIf {4*X+J+L1}=0V->{4*X+J+L1}Else.If we're there, the target cell value needs to be increasedV+1->{4*X+J+L1}.And the limit value goes upwards (see in the message for more information)X-1->Ne^(V+1)+S->SEnd.Empty the evaluated cell and tell the program a move has been made0->{4*I+J+L1}theta++EndEndEndEnd.If at least one move has been made, create a new cellIf thetaNEW()EndReturnLbl LEFT0->thetaFor(J,0,3)0->NFor(I,1,3)If {4*J+I+L1}->V!=0I-1->XRepeat {4*J+X+L1}->T=V or (T!=V and (T!=0)) or (X=N)X--End{4*J+X+L1}->TIf T!=V and (T!=0)X++EndIf X!=IIf {4*J+X+L1}=0V->{4*J+X+L1}ElseV+1->{4*J+X+L1}X+1->Ne^(V+1)+S->SEnd0->{4*J+I+L1}theta++EndEndEndEndIf thetaNEW()EndReturnLbl RIGHT0->thetaFor(J,0,3)3->NFor(K,1,3)3-K->I+1->XIf {4*J+I+L1}->V!=0Repeat {4*J+X+L1}->T=V or (T!=V and (T!=0)) or (X=N)X++EndIf (T!=V and (T!=0))X--EndIf X!=IIf {4*J+X+L1}=0V->{4*J+X+L1}ElseX-1->NV+1->{4*J+X+L1}e^(V+1)+S->SEnd0->{4*J+I+L1}theta++EndEndEndEndIf thetaNEW()EndReturnLbl UP0->thetaFor(J,0,3)0->NFor(I,1,3)I-1->XIf {4*I+J+L1}->V!=0Repeat {4*X+J+L1}->T=V or (T!=V and (T!=0)) or (X=N)X--End{4*X+J+L1}->TIf T!=V and (T!=0)X++EndIf X!=IIf {4*X+J+L1}=0V->{4*X+J+L1}ElseX+1->NV+1->{4*X+J+L1}e^(V+1)+S->SEnd0->{4*I+J+L1}theta++EndEndEndEndIf thetaNEW()EndReturnLbl SAVECopy(L1,Q,16)S->{Q+16}^^rReturnLbl LOADCopy(Q,L1,16){Q+16}^^r->SReturnLbl NEW.L is set to 16 so the new cell position changes everytime16->LRepeat {L1+L}=0rand^16->LEndrand^6/5+1->{L1+L}ReturnLbl R0->SFill(L1,16,0NEW()NEW()ReturnLbl H.Clear the screen and draw the help bitmapsClrDrawTangent(20,5,Pic0B)Tangent(52,5,Pic0C)DispGraph^^rText(58,58,"by Toctave"Repeat getKeyEndClrDraw^^r^^rReturn.Subroutine to easily create rectangles for the scores and game table itself, r1 to r4 is the same as for the Rect( command, r5 is used to tell how the corners will lookLbl RECTHLine({r2},{r1}-{r5},{r1}+{r3}+{r5}HLine({r2}+{r4},{r1}-{r5},{r1}+{r3}+{r5}VLine({r1},{r2}-{r5},{r2}+{r4}+{r5}VLine({r1}+{r3},{r2}-{r5},{r2}+{r4}+{r5}Return.No need to explain here I thinkLbl DTangent(32,3,Pic0AFor(I,0,15)L1+I->PI^4*9+31->FI/4*9+21->GIf {P}=1Pt-On(F,G,Pic1)ElseIf {P}=2Pt-On(F,G,Pic2)ElseIf {P}=3Pt-On(F,G,Pic3)ElseIf {P}=4Pt-On(F,G,Pic4)ElseIf {P}=5Pt-On(F,G,Pic5)ElseIf {P}=6Pt-On(F,G,Pic6)ElseIf {P}=7Pt-On(F,G,Pic7)ElseIf {P}=8Pt-On(F,G,Pic8)ElseIf {P}=9Pt-On(F,G,Pic9)ElseIf {P}=10Pt-On(F,G,Pic10)ElseIf {P}=11Pt-On(F,G,Pic11)ElseIf {P}=12Pt-On(F,G,Pic12)ElsePt-On(F,G,Pic0)^^rEndEndRECT(29,19,38,38,1RECT(70,21,24,14,~1RECT(70,38,24,14,~1DispGraphClrDraw^^rText(72,22,"Score:"Text(73,28,S>DecText(75,39,"Best:"Text(73,45,{Q+18}^^r>Dec
I see you use different pointers for your sprites. Instead you should use only one and use pointer offsets for that. Ie with only one command you do :pt-on(x,y,id*8+PicX)
Try manually GCing.