TIB: Re:Sprites in TIBasic


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

TIB: Re:Sprites in TIBasic




	Another way to do pseudo-sprite animations is to use line segments.  I have
only experimented with this, but it appears to work.  First, I make a
subroutine library that looks like this:

prgmAAA
:If A=1 :Then
:Line(V,W,X,W)
:Return
:Else
:Line(V,W,X,W,0)<zero,not O>
:Return

	Then, in the main program, I set V,W,and X initially(and set A to 1 to make
the subroutine draw the line, not erase it),then I use a series of statements
to draw lines in relation to the first line, such as:

:W-1-->W
:X-1-->X
:prgmAAA
and so on...

	Then I set up a series of GetKey() statements in the main program that would
erase the old lines by setting A to 0 and then changing the values of the
V,X,&W variables to match the direction the player moved.  But, when erasing
lines, dont forget that those variables now equal the last lines coordinates
in your sprite, not the first.
	This is really too much work to do for an animation, but thats what you get
in BASIC. I stick with alpha based graphics.  What I wouldnt give for VBs
BitBlt routine:)

(oh, one last note: the reason I didnt use the Y variable is that when I tried
this, if I did a line of code that would subtract 1 from Y, it would always
return negative 1!)

Tatsuo