Re: TIB: Help with Sprites


[Prev][Next][Index][Thread]

Re: TIB: Help with Sprites




No problem.  I can tell you the basics of how to do it, but I would suggest 
that you get in touch with someone who has an 89 to work out the exact 
commands for that calculator.  Basically, you use commands that draw pixels 
(such as Pxl-On() for the 83) or lines, but with all the dimensions related 
to a variable.  Here's an example (83 commands):

For(X,1,5)
Pxl-On(A+5,B+X)
End
For(X,1,3,2)
Pxl-On(A+5-X,B+2)
Pxl-On(A+5-X,B+4)
Pxl-On(A+4-X,B+3)
End
If C=1
Pxl-On(A+4,B+3)

You put a routine such as that in a subprogram, then set the variables (in 
this case A and B) and run it from the main.  This particular program draws a 
bishop in the square with its bottom corner at (A,B).  I also used the 
variable C as a toggle for white and black pieces.  If the piece is black, C 
is set to 1 and the piece is drawn black with a filled center.  If it is 
white, C is 0 and the piece is drawn white.  One thing to make sure to watch 
for is what sort of values the draw command is looking for.  On the 83, there 
are two different types: the Line() and Pt-On() commands use Y-coordinates, 
and the Pxl-On() command uses pixel numbers.  On the 83, they aren't the same 
(although conversion is simple).  I'm not sure what the case is on the 89, 
but make sure you watch for that.

Eric Tollefson
Cmdr ERT01@aol.com