-->
0 Members and 1 Guest are viewing this topic.
.....ASMATRIXAn Lib By thababo01(C)...lbl ENTERMATRIXr1*r2->AA+2->AGetCalc("appvASMtrx",A*3)->Zr1->{Z}^rr2->{1+Z}^rReturnLbl WRITE{Z}^r->A((A*(r2-1))+r1)->AA+1->Ar3->OO->{A+Z}^rReturnLbl GET{Z}^r->A((A*(r2-1))+r1)->AA++{A+Z}->AReturnLbl EXITMATRIXDelVar "appvASMtrx"
.abcclrdraw[0000000000000000]->pic1ENTERMATRIX(8,1)WRITE(1,1,"FFFFFFFFFFFFFFFF")WRITE(2,1,"00000000000000")Repeat getkey(15)DRAW(1)EndLbl DrawClrDrawIf r1=1GET(1,1)Copy(A,pic1,length(A))pt-on(1,1,pic1)DispGraphReturnprgmMTRXLIB
.piclibLbl InitAppv.syntax: r1: Maximum amount of tiles you want to store. Max 255..output: returns pointer to appvar!if GetCalc("appvTILES")->A :.not a thing from the var menu bc you can't redefine these afaik GetCalc("appvTILES",r1*8+2)->A :.You can store 96 sprites in this appvar. Why the extra 2 bytes? I'll show you in a bit ;) 0->{A} :.the amount of tiles currently stored in the appvar r1->{A+1} :.the maximum amount of tiles the appvar can holdEndReturn ALBL StorTile :.I have no clue how long labels can be in the current version of Axe. If this doesn't work figure out how to call this yourself, it's only a label name :P.syntax: r1: pointer to 8bytes of tile data to store in the appvar. r2: Pointer to appvar. Expects the first byte of the appvar to be the amount of sprites stored, and the second byte the maximum amount of sprites the appvar can hold..output: appends 8 bytes of tile data to the end of the appvar. Returns one if successful, zero if fail (appvar is full){r2+1}->r3 :.because I'm too lazy to type r2+1 every time!If (r2 < r3) Return 0Else For(I,0,7) {r1+I}->{{r2}*8+2+r2+I} :.This should copy the contents of r1 to the end of r2. Might or might not work, please prod me if it doesn't. End {r2}++ :.adds one to the tile countEndReturn 1Lbl GetTile.syntax: .r1: pointer to appvar. Expects the same format as mentioned before..r2: tile # to fetch.Outputs: Returns the pointer to the desired tile. The first tile in the appvar is number zero, not one..This function is almost a joke. It instantly returns :PReturn ((8*{r1})+(8*r2)+r1+2)
.RANDGFX.fills an appvar with bullshit tiles and displays a random one from the appvar in the middle of the screen.where do you include programs again? at the start or at the end of the program? edit turns out that if you include at the start it gets run before start. InitAppv(12)->PFor(12) For(r1,0,7) rand^255->{L1+r1} End StorTile(L1, P)EndRepeat getKey(15) Pt-On(44,28,GetTile(P, rand^11)) DispGraphClrDrawEndDispgraphClrDrawPause 100ReturnprgmPICLIB