0 Members and 3 Guests are viewing this topic.
If L=1 Pt-On(...,Pic1)EndIf L=2 Pt-On(...,Pic2)EndIf L=3 Pt-On(...,Pic3)End...
Pt-On(....,L=1?Pic1,(L=2?Pic2,(L=3?Pic3))))
Pt-On(X,Y,{L*2-2+Data(Pic1ʳ,Pic2ʳ,Pic3ʳ)}ʳ)
[0123456789ABCDEF]→Pic1[FEDCBA9876543210]→Pic2[FFFFFFFFFFFFFFFF]→Pic3...other stuff here...Pt-On(X,Y,L*8-8+Pic1)
You can do this by writing the addresses of the three sprites into a buffer, yes. The code would look something like this:Code: [Select]Pt-On(X,Y,{L*2-2+Data(Pic1ʳ,Pic2ʳ,Pic3ʳ)}ʳ)However, best would be to declare the sprite data in sequence so each one's data immediately follows the next, which allows this:Code: [Select][0123456789ABCDEF]→Pic1[FEDCBA9876543210]→Pic2[FFFFFFFFFFFFFFFF]→Pic3...other stuff here...Pt-On(X,Y,L*8-8+Pic1)And a suggestion: in either case, your life would be made easier by using zero-based numbering. That generally translates into simpler/more efficient code. In the first case, you could remove the -2, and in the second case, you could remove the -8.
[0123456789ABCDEF]→Pic1[FEDCBA9876543210[FFFFFFFFFFFFFFFF...other stuff here...Pt-On(X,Y,L*8+Pic1)