0 Members and 1 Guest are viewing this topic.
*Indents are here solely for viewability.0:Return ;The header"USprite→A ;Stores the string location to A (used for optimisation since the string is used several times)Get(A ;Gets the location of the appvar named SpriteIf =0 ;Zero is returned if the var does not existThen ClrDraw ;Clears the draw buffer (graph screen) and resets text coordinates Text(º"How many sprites? ;º means draw to the last text coordintate DispGraph ;Displays the draw buffer expr(Input →N ;Allows the user to input a string and expr( turns it to a number Text(6,0,"Width? ; DispGraph ; expr(Input →W ; Text(12,0,"Height? ; DispGraph ; expr(Input →H ; Send(4+N*W*H,A→Z ;Creates the appvar :) int(Z,W ;Stores the Width to the first byte of the var int(Z+1,H ;Stores the Height to the second byte of the var iPart(Z+2,N ;Stores the Number of sprites (stores it as a 2-byte word)EndUnarchive AGet(A→Z ;IS>(Z→W ;reads the byte at Z, then increme,nts ZIS>(Z→H{Z→NZ+2→ZClrDraw0→X →Y →B ;X will be X pixel Coord, Y=Ypixel coord, B=sprite numberπ87EC→θ ;This is the location of the clipboard (256 bytes)Line(0,0,1+H,1+W*8,3 ;Draws the boundaries for the spriteRepeat A=55 ;55 is the [mode] keyZ+B*W*H→V ;Used multiple times, so why not store it to a var?Pt-On(0,V,0,0,W,H ;Draws the spriteRepeat A=55 +getKey(10 +getKey(11 pxl-Test(Y,X→C 9→D Repeat A D+1 If >9 ;Checks if the previous result is >9. This is the timer for blinking Pxl-Change(Y,X 0 ;Changes the pixel state at Y,X and then returns 0 in Ans →D getKey→A End Pxl-Off(Y,X C If getKey(56 ;56=Delete 0 If getKey(9 ;9=Enter 1 If getKey(54 ;54=2nd !C If Ans Pxl-On(Y,X If A=15 Line(0,0,H,W*8,0 ;Draws a white rectangle to erase the sprite data Y+H+getKey(1 -getKey(4 /H θ'→Y ;θ' is the remainder from the division. This lets the cursor loop :) X+getKey(3 -getKey(2 +W*8 /W*8 θ'→XEndPt-On(4,Z+B*W*H,0,0,W,H ;Swaps the sprite data from on screen to the sprite set (saves the changes)B+N+getKey(10-getKey(11/N θ'→BEndStop