0 Members and 1 Guest are viewing this topic.
For those wondering how it works:You may have noticed that the TI-OS's getKey command maps keys by row, then column. Using the ᴇ, iPart() and fPart() commands, the program extracts those row/column values, multiplies them to make them usable on the screen, and uses the multiplied column value/multiplied row value as X/Y coords to draw the line. The example in the video uses xLIBC to draw the lines , but I have one that just moves an O around on the homescreen using pure TI-BASIC; that can be found here. (code here)
This is looking pretty sweet so far!So it's in hybrid basic?Good luck finishing it off!
y-y1=((y2-y1)/(x2-x1))*(x-x1)
((y2-y1)/(x2-x1))*(x-x1)-(y-y1)<17
If not(x2-x1 //if the line isn't verticalThenIf ((y2-y1)/(x2-x1))*(x-x1)-(y-y1)<17points+1->pointsElseIf [version of formula for vertical line]points+1->pointsEnd
(y-y1)*(x2-x1) - (y2-y1)*(x-x1) -> AIf A = 0points+1->pointsElseIf Sign(A) =/= Sign((y+15-y1)*(x2-x1) - (y2-y1)*(x+15-x1)points+1->pointsEnd
:If not(sqrt((y2-y1)^2+(x2-x1)^2:x2+1->x2:If 16>=abs((y2-y1)x-(x2-x1)y+x2*y1-y2*x1/sqrt((y2-y1)^2+(x2-x1)^2)) //16 because that'll be the sprite width in pixels:"do stuff