- Fruit Ninja for the CSE
- 15 Mar 2015 03:25:31 pm
- Last edited by M. I. Wright on 25 Apr 2015 09:40:58 am; edited 6 times in total
Remember that the row that starts with the Math key corresponds with the top of the screen, and pressing any button above that (as demonstrated in the video) will just draw a line at the top of the screen.
The only annoying thing is those dots that appear every time a line finishes drawing, but that should be easy enough to fix.
Edit: dots are fixed! The pastebin has been updated, but I can't upload an updated file just yet for reasons explained below.
Feel free to use this for your own purposes as long as you give me credit. If you don't want the fruit ninja background, either replace line 7 with your own appvar pic or delete lines 7,8 and 9.
Download here (If you just want the program without the background pic, that's here), code here.
The original post is below.
--
Download here
If you can't download that for whatever reason, the code as text is here; tell me if you see any optimizations! (besides not using ClrHome; I'm currently figuring out how to erase the lines. ʟFRNP will be used for that)
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)
By the way, does that video look familiar? If so, it's because it's an attempt to clone the control scheme of Deep Thought's Fruit Ninja... so no guarantees, but we might be seeing Fruit Ninja on the CSE soon if I can figure out how to make it fast enough.