This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
interwined


Newbie


Joined: 26 Sep 2003
Posts: 39

Posted: 12 Nov 2003 03:22:25 pm    Post subject:

Could someone guide me through the basics of using sprites in a BASIC game? I'm sure this requires an assembly program to do, but I'd like to use it with my future BASIC game. All help is appreciated.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 12 Nov 2003 05:27:46 pm    Post subject:

I know two ways to use sprites in a basic game.

  1. Using Omnicalc's sprite( function
  2. Using Pxl-On( s in a separate basic program
They are both roughly equal in space (the first will take up a 767-byte pic, the second approximately 100 to 400 bytes per 8 by 8 sprite). However, the first requires Omnicalc on every calculator running it, though faster.

First way: read Omnicalc manual

Second way: something like


Code:
prgmSPRITES
:If Ans=1:Then
:Pxl-On(R,C+1 (or whatever, sprite pixels go here
...
:End
:If Ans=2:Then
(2nd sprite pixels
:End


so, to do it from your program, do

Code:
:1:prgmSPRITES

for first sprite, the one becomes a number for the # of sprite.

If my explanation seems unclear, ask.


Last edited by Guest on 13 Nov 2003 05:28:32 pm; edited 1 time in total
Back to top
interwined


Newbie


Joined: 26 Sep 2003
Posts: 39

Posted: 12 Nov 2003 07:05:47 pm    Post subject:

I've been trying it the second way, but I think I'm going to look into this Omnicalc.
Back to top
WhiteDwarf


Newbie


Joined: 10 Nov 2003
Posts: 19

Posted: 13 Nov 2003 01:54:28 am    Post subject:

Sprites? lol
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 13 Nov 2003 07:18:09 am    Post subject:

Yes, sprites.

You have 2 options, hard-code (fast, lots of work and code) them or load them from a variable (slow, less work and smaller).

Hard-coded sprite:
47->A //sprite x position
31->B //sprite y position
Pxl-On(A+1,B+1
Pxl-On(A+2,B+2
Pxl-On(A+3,B+3
Pxl-On(A+4,B+4
Pxl-On(A+5,B+5

From a list:
{1,1,2,2,3,3,4,4,5,5}->L1
47->A //sprite x position
31->B //sprite y position
For(X,1,10,2)
Pxl-On(A+L1(X),B+L1(X+1))
End

Of course you can also use matrices, strings, A-Ø, or any other variable to load sprites from. And you can of course also use lines, circles, pt-on,pt-off, text's, outputs etc. instead of just pt-on. Keep in mind not to make your sprites too big if you need speed, basic is very slow when dealing with graphics (or anything else).


Last edited by Guest on 13 Nov 2003 07:20:51 am; edited 1 time in total
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 13 Nov 2003 12:42:06 pm    Post subject:

adm.wiggin made me a asm prgm for sprites
each sprite was 16 chars of hex in str1
a=y coord
b=x coord
c=method: (1=and,2=or,3=xor)
works great. only around 100-200 bytes
Back to top
interwined


Newbie


Joined: 26 Sep 2003
Posts: 39

Posted: 13 Nov 2003 02:41:52 pm    Post subject:

I've tried both the hard-coding and from strings, but the strings seems way to slow and the hard-coding seems fine but a little work. Darth, could you send me this asm program you're talking about?
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 13 Nov 2003 04:56:22 pm    Post subject:

i could... but he probably has the working version (not sure if the version i currently have works Neutral ) just post your e-mail and im sure he would be happy to send it to you :)

btw, i made it, just though i'd clear that up in case you havent made the mental connection Wink


Last edited by Guest on 13 Nov 2003 04:56:55 pm; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 13 Nov 2003 04:57:14 pm    Post subject:

Or better yet, publish it on some TI-site. I'd like that program too and I think most people would.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 13 Nov 2003 05:09:10 pm    Post subject:

YA! Darth, can you e-mail me the current version you have? PLEASE?

* BIG bambi eyes here *
Back to top
interwined


Newbie


Joined: 26 Sep 2003
Posts: 39

Posted: 13 Nov 2003 05:11:13 pm    Post subject:

Michblue2003@yahoo.com is my email Darth, if you could please send it. And adm thanks for making it.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 13 Nov 2003 05:13:17 pm    Post subject:

im actually asking for the version he has, because i want to put it on ticalc.org as my program #2! Smile
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 13 Nov 2003 05:16:15 pm    Post subject:

Great idea! When?
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 13 Nov 2003 10:07:23 pm    Post subject:

um, as soon as he e-mails it to me Wink
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 13 Nov 2003 11:13:17 pm    Post subject:

*sorts through memory*
found it!
adm, whats YOUR email?
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 14 Nov 2003 03:52:41 pm    Post subject:

More info on Omnicalc sprites: they can use the whole 64x96 screen and Stop resets RAM in a program that uses sprite(.
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement