0 Members and 1 Guest are viewing this topic.
.SPRITEDiagnosticOff10->X->Y[FFFFFFFFFFFFFFFF->Pic0Lbl DRPt-On(X,Y,Pic0)ReturnRepeat getKey(15)If getKey(2)X-1->Xsub(DR)EndIf getKey(3)X+1->Xsub(DR)EndEnd
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
If getkey(1)blahEndIf getkey(2)blahEndIf getkey(3)blahEndIf getkey(4)blahEndsub(DR)DispGraphClrDraw
.SPRITEDiagnosticOff10->X->Y[FFFFFFFFFFFFFFFF->Pic0[0000000000000000->Pic1Repeat getKey(15)If getKey(2)X-1->Xsub(DR)EndIf getKey(3)X+1->Xsub(DR)EndEndLbl DRPt-On(X-(getKey(3))+(getKey(2)),Y,Pic1) .I have not included Y movement yet for simplicity's sake.Pt-On(X,Y,Pic0)DispGraph .no return needed
@magic bananain your example code you dispGraph and then Clrdraw, shouldn't it be the other way around?
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.
I always try to avoid ClrDraw, maybe a bad habit in Axe but a good one on BASIC. I don't know with what logic the sprites are drawn so I am not sure if the Pic1 sprite will do what I want it to do, erase the previous position of Pic0...I have no calc at hand so i am jsut doing this from memory and the commentary you made...it should work now...@magic bananain your example code you dispGraph and then Clrdraw, shouldn't it be the other way around?
.SPRITEDiagnosticOff10->X->Y[FFFFFFFFFFFFFFFF->Pic0Repeat getKey(15)X+getkey(3)-getkey(2)->XY+getkey(1)-getkey(4)->Ysub(DRDispGraphClrDrawEndClrHomeLbl DRPt-On(X,Y,Pic0
.SPRITE . headerDiagnosticOff . turn off indicator/done10->X->Y . initialize sprite position[3C7EFFFFFFFF7E3C->Pic0 . squares are for squares. therefore, a black circle is stored to pic0.Repeat getKey(15) . repeat until clear is pressedX+getkey(3)-getkey(2)->X . movementY+getkey(1)-getkey(4)->Y . codePt-Change(X,Y,Pic0 . draw sprite to bufferDispGraph . display what's on the bufferPt-Change(X,Y,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.
Code: [Select].SPRITE . headerDiagnosticOff . turn off indicator/done10->X->Y . initialize sprite position[3C7EFFFFFFFF7E3C->Pic0 . squares are for squares. therefore, a black circle is stored to pic0.Repeat getKey(15) . repeat until clear is pressedX+getkey(3)-getkey(2)->X . movementY+getkey(1)-getkey(4)->Y . codePt-Change(X,Y,Pic0 . draw sprite to bufferDispGraph . display what's on the bufferPt-Change(X,Y,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.you can use a subroutine for pt-change() if those 10 bytes you save are really important to you.