0 Members and 1 Guest are viewing this topic.
.PXLTEST BYEBYEDiagnosticOff[FFFFFFFFFFFFFFFFüPic10->X+1->DZeros(10)->{L1}44->{L1+0}54->{L1+1}.For(X,1,3).rand^88->{X*2+L1}.rand^56>{X*2+1+L1}.Pt-On({X*2+L1},{X*2+1+L1},Pic1.End.StorePic Repeat getKey(15)Pt-On({L1+2},{L1+3},Pic1Line(0,63,95,63).RecallPic Pt-On({L1+0},{L1+1},Pic1)DispGraphClrDrawIf getKey(2){L1+0}--ElseIf getKey(3){L1+0}++EndIf D{L1+1}--D--End!If DIf {L1+0}>{L1+2}If {L1+0}<8+{L1+2}If {L1+1}=8+{L1+3}20->DEndEndEnd{L1+1}++EndIf {L1+1}=5420->DEndEnd
!If DIf {L1+0}>{L1+2}If {L1+0}<8+{L1+2}If {L1+1}=8+{L1+3}20->DEndEndEnd{L1+1}++End
If {L1+0}<8+{L1+2}If {L1+1}=8+{L1+3}
If ({L1+0}<8)+{L1+2}If ({L1+1}=8)+{L1+3}
.PXLTESTDiagnosticOff[FFFFFFFFFFFFFFFF]->Pic10->X->D44->{0+L1}53->{1+L1}66->{2+L1}50->{3+L1}Repeat getKey(15)Pt-On({2+L1},{3+L1},Pic1Line(0,63,95,63)Pt-On({0+L1},{1+L1},Pic1)DispGraphClrDrawIf getKey(2){0+L1}--ElseIf getKey(3){0+L1}++End!If DIf ({2+L1})<({0+L1})If (8+{2+L1})>({0+L1})If (8+{3+L1})=({1+L1})40->DEndEndEndEnd!If D{1+L1}++If {1+L1}=5620->DEndEndIf D{1+L1}--D--EndEnd
sub(SUB, EXP1, EXP2, ... , EXP6
If sub(COL, {0+L1}, {1+L1}, Pic1, {2+L1}, {3+L1}, Pic140→DEnd
Lbl COLIf abs(r1-r4)<8 and (abs(r2-r5)<8).So that we can use the same For loop no matter how the sprites are positioned, we will flip the arguments if Sprite1 is higher up than Sprite2If r5<r2:Exch(r1º, r4º, 6):End.Count up the sprite rowsFor(X1T, 0, 7.Now, we will take the first potentially colliding row of the first sprite and bit shift it so it is in correct space with the second sprite. We will bitwise AND that result with the second sprite. If the two sprites share a pixel at that location, the If statement will become true.If {r5-r2+X1T+r6}*e^(r4-r1) and {X1T+r3}.Pixel Collision Occured1:ReturnEndEnd0:Return
If sub(COL, {0+L1}, {1+L1}, Pic1, {2+L1}, {3+L1}, Pic140→DEndLbl COLIf abs(r1-r4)<8 and (abs(r2-r5)<8)
But you don't mind, if I didn't use your code in my code?