Does anyone know how to make and use sprites with TI-Basic programming? I can't find a good tutorial on this subject and I want to know how.
Would you like to move them? Make them? Draw them. What do you want to know. as for moving them I can help a lot, making and drawing them, not so much.

Some basic code.


Code:

Repeat Ans
getKey->K
End
M-(K=24)+(K=26)->M
J-(K=35)+(K=25)->J
Text(J,M,"@


This will move the "@" around the screen. Which will eventually fill the screen with @'s. Or use pi whatever, To erase it change the code to this.


Code:

Repeat Ans
getKey->K
End
Text(M,J,"___ //Those are spaces. 3 of them.
M-(K=24)+(K=26)->M
J-(K=35)+(K=25)->J
Text(J,M,"@


Punch those into your calculator and see how they work. Let me know if you have any questions!
You can make ASCII sprites, textsprites, Pxl-/Pt-sprites, or even use the xLIB or Celtic functions that Doors CS provides:

http://dcs.cemetech.net/index.php?title=Third-Party_BASIC_Libraries
The site you sent is a little confusing. I want to know how to make sprites, and use them in my programs.
Well my code moves them around the screen, as for the Libraries I never understood them either, I usually just use text sprites. Such as pi, and the greek letters.
I would rather make my own sprites so that I could say that they were original.
Then your only real option is to start learning how to make use of some ASM utilities, like Kerm said, xLIB and DCS both offer rather powerful sprite routines. Where you can make a sprite sheet, and call particular ones from those to the screen. Other utilities out there ( that I don't have handy links to, someone back me up here? ) can let you make sprites from hex codes in your program, unless the one I am remembering is now outdated and antiquated.
I am trying to make a ball animation and I just made the sprite. It bounces on the screen just fine but it is leaving a trail. How can I fix it?

Here's the code:


Code:
:0->X
:0->Y
:8->A
:8->B
:ClrHome
:Lbl 1
:identity(5,"3C66F3FBBFDF7E3C",X,Y,1,8,3,0,1)
:X+A->X
:Y+B->Y
:If Y=56 or Y=0
:-B->B
:If K=45 or K=22
:Stop
:Goto 1
Spenceboy98 wrote:
I am trying to make a ball animation and I just made the sprite. It bounces on the screen just fine but it is leaving a trail. How can I fix it?

Erase the sprite before drawing the next sprite.

The ball might flicker when it moves, depending on how fast it's redrawn. Techniques to overcome this, such as double-buffering, are outside the scope of this post.
I think that the xLib sprite routine is a bit faster, but the bad thing about that one is that you need to save the sprites in a pic.

EDIT:
christop wrote:


The ball might flicker when it moves, depending on how fast it's redrawn.
It won't if you use the backup buffer.
That is fine if you have PicArc, and you have 255 pictures. Which I don't have.
Sorunome, I hope by "Backup buffer", you mean "Don't refresh the screen", because there isn't really a concept of a "backup buffer" in TI-Basic (Even with extra libraries).

Spenceboy, how do you fix it? You set your sprite to be drawn via the XOR method, and then draw it that way again when you want to move it. If you need any example code, I can try writing some (later, though)
_player1537 wrote:
Sorunome, I hope by "Backup buffer", you mean "Don't refresh the screen", because there isn't really a concept of a "backup buffer" in TI-Basic (Even with extra libraries).
Yeah, that's exactly what I mean, sorry.
Also, I didn't mention this earlier, but you can use SourceCoder to turn .gif or .png sprites into hex to use in your program.
KermMartian wrote:
Also, I didn't mention this earlier, but you can use SourceCoder to turn .gif or .png sprites into hex to use in your program.
Cool, I didn't know that! that could be VERY useful! Smile
Does anyone know how to make a horizontal sprite? I've looked everywhere and can't seem to find the right tutorial.
What's a horizontal sprite?
adamac17 wrote:
Does anyone know how to make a horizontal sprite? I've looked everywhere and can't seem to find the right tutorial.


http://tibasicdev.wikidot.com/textsprites#toc0
Looks like I'm gonna be stuck doing Text games all my life. I can't understand some of this, like putting it into code, etc.
What exactly is preventing you from understanding that? I would recommend that you get some graphical TI Basic games from ticalc.org and look over the source for learning purposes, that might aid you in your understanding.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement