0 Members and 1 Guest are viewing this topic.
.SPRITE . headerDiagnosticOff . turn off indicator/done10->X->Y . initialize sprite position[FFFFFFFFFFFFFFFF]→Pic0 . squares are for squares. therefore, a black circle is stored to pic0.[3C7EFFFFFFFF7E3C] .add more data after the spritedataRepeat getKey(15) . repeat until clear is pressedX+getkey(3)-getkey(2)->X . movementY+getkey(1)-getkey(4)->Y . codePt-Change(X,Y,8*getKey(2)+Pic0 . draw sprite to bufferDispGraph . display what's on the bufferPt-Change(X,Y,8*getKey(2)+Pic0 . draw same sprite to buffer. since it's pt-change, the sprite is erased on the buffer, leaving no End . residue from movement.ClrHome . clear the screen, move cursor to upper left corner of the screen.ClrDraw . clear the buffer.
HoMM: [==--------] Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :PtiDE: [----------] Explored and understood the main part of the code: just started writing a Tokenizer.
.ATST11->N0->ODiagnosticOffClrDraw[0000000000000000]->Pic00[FFFF03030303FFFF][FFFFC0C0C0C0FFFF][386CD6AAFED6D67C][FFFFE7C3C3E7FFFF][FFE7C38181C3E7FF]Data(1,4,4,4,4,4,4,4,2,1,1,1,1,1,4,4,4,4,2,4,1,2,4,4,3,3,1,2)->GDB1 .this is just random and the fact that it is, is irrelevantrepeat getKey(15)N+(getkey(3))->NO+(getkey(3))->ON-(getkey(2))->NO-(getkey(2))->OClrDrawFor(A,O,N)pt-on((A*8),56,((({GDB1}+A)*8)+Pic00))DispGraphEnd
N+(getkey(3)-getkey(2)->T)->NO+T->O
Instead of {GDB1}+A you want {GDB1+A}. Also, you're using way too many parenthesis, they actually do add to the code size usually. The getkey's don't need the extra pair, A*8 doesn't, and the thing after it has a lot. Axe reads strictly left to right for its order of operations so most of those parenthesis are unnecessary.
7+8*3-9*2=13
7+8*3-9*2=72
7+(8*3)-(9*2)=13
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
problem is still unsolved. thanks for the optimizations though. Let me try to explain it again. I have a list (GDB1) which contains numbers. Each number represents a tile. Now the first value in GDB1 is the first tile the second value the second tile etc. The thirteenth tile is not drawn because only twelve fit on the screen. The thirteenth tile is drawn when you press the <right> key, however the first tile is NOT drawn then (because all the tiles shifted left once. So basically the list contains the tiles and now I want to be able to scroll through the tiles by pressing left or right. By pressing right the tiles shift to the left once and by pressing left the tiles shift right once. This is what I am trying to accomplish and so far has failed epically .
Code: [Select].ATST11->N0->ODiagnosticOffClrDraw[0000000000000000]->Pic00[FFFF03030303FFFF][FFFFC0C0C0C0FFFF][386CD6AAFED6D67C][FFFFE7C3C3E7FFFF][FFE7C38181C3E7FF]Data(1,4,4,4,4,4,4,4,2,1,1,1,1,1,4,4,4,4,2,4,1,2,4,4,3,3,1,2)->GDB1 .[s]this is just random and the fact that it is, is irrelevant[/s] [i]not entirely random each number is a sprite but it is random in the sense that i choose the numbers randomly (within a range from 1-5)[/i]repeat getKey(15)N+getkey(3)-getKey(2)->NO+getkey(3)-getKey(2)->OClrDrawFor(A,O,N)pt-on(A*8,56,({GDB1+A}*8)+Pic00)DispGraphEnd
.ATST11->N0->ODiagnosticOffClrDraw[0000000000000000]->Pic00[FFFF03030303FFFF][FFFFC0C0C0C0FFFF][386CD6AAFED6D67C][FFFFE7C3C3E7FFFF][FFE7C38181C3E7FF]Data(1,4,4,4,4,4,4,4,2,1,1,1,1,1,4,4,4,4,2,4,1,2,4,4,3,3,1,2)->GDB1 .[s]this is just random and the fact that it is, is irrelevant[/s] [i]not entirely random each number is a sprite but it is random in the sense that i choose the numbers randomly (within a range from 1-5)[/i]repeat getKey(15)N+getkey(3)-getKey(2)->NO+getkey(3)-getKey(2)->OClrDrawFor(A,O,N)pt-on(A*8,56,({GDB1+A}*8)+Pic00)DispGraphEnd
.ATST0->C . Since we're always displaying 12 sprites on the screen, you only need one var to keep track of position in the data.DiagnosticOffClrDrawZeroes(8)->Pic1 . just a different way of writing it.[FFFF03030303FFFF][FFFFC0C0C0C0FFFF][386CD6AAFED6D67C][FFFFE7C3C3E7FFFF][FFE7C38181C3E7FF]Data(1,4,4,4,4,4,4,4,2,1,1,1,1,1,4,4,4,4,2,4,1,2,4,4,3,3,1,2)->GDB1 . unchanged data.Repeat getKey(15)C!=16 and getKey(3) - (C!=0 and getKey(2))+C->C . "!=" is does not equal. they're used to be boundaries, so we don't scroll into undefined data.Pause 150 . pauses for 150 milliseconds to slow the program down.ClrDrawFor(A,C,C+12pt-On(A-C*8,56,{GDB1+A}*8+Pic00 . A-C instead of A so we always start displaying the sprites at (0,56).EndDispGraphEnd
"vPBWMAP1"->Str0Getcalc(Str0,16)->PIf P[FFFF03030303FFFF]->{P}End
For(A,0,15)1->{P+A}End