Sprites
started by: brook251brook251
on: 1214095710|%e %b %Y, %H:%M %Z|agohover
number of posts: 8
rss icon RSS: new posts
summary:
Sprites in TIBasic
Sprites
brook251brook251 1214095710|%e %b %Y, %H:%M %Z|agohover

Is there any way at all to create sprites on an 89 that you could manipulate, like to create a game. The best I could do was a circle and a dot.

unfold Sprites by brook251brook251, 1214095710|%e %b %Y, %H:%M %Z|agohover
Re: Sprites
burrburr 1214096225|%e %b %Y, %H:%M %Z|agohover

Have you tried reading through the sprites page? That sounds like it would be of some help.

Also, let me say Welcome to TI-Basic Developer! Please feel free to become a member, and to frequent the forum. We would love to answer any programming questions that you have, or whatever else that you want to talk about.

unfold Re: Sprites by burrburr, 1214096225|%e %b %Y, %H:%M %Z|agohover
Re: Sprites
brook251brook251 1214097218|%e %b %Y, %H:%M %Z|agohover

Ahh, didn't see that. Thanks.

unfold Re: Sprites by brook251brook251, 1214097218|%e %b %Y, %H:%M %Z|agohover
Re: Sprites
brook251brook251 1214098084|%e %b %Y, %H:%M %Z|agohover

I just read the page and it only contains techneques to display sprites. I just want to know how to create them. Sorry if my request is considered stupid or unexperieced as I am new to TI programing.

last edited on 1214098138|%e %b %Y, %H:%M %Z|agohover by brook251 + show more
unfold Re: Sprites by brook251brook251, 1214098084|%e %b %Y, %H:%M %Z|agohover
Re: Sprites
burrburr 1214100841|%e %b %Y, %H:%M %Z|agohover

Are you just talking about using the graphics commands to draw an image on the screen?

unfold Re: Sprites by burrburr, 1214100841|%e %b %Y, %H:%M %Z|agohover
Re: Sprites
brook251brook251 1214102520|%e %b %Y, %H:%M %Z|agohover

Yes. But be able to move it also.

unfold Re: Sprites by brook251brook251, 1214102520|%e %b %Y, %H:%M %Z|agohover
Re: Sprites
SocksSocks 1214178902|%e %b %Y, %H:%M %Z|agohover

Well, draw it once, then store it to an image, then erase/redraw in an organized fashion to create animation.

If you create a single image file that comes with the program containing every image used, then storing each one to an image using coordinates.


MtGW-Logo-2.gif

/Socks

unfold Re: Sprites by SocksSocks, 1214178902|%e %b %Y, %H:%M %Z|agohover
Re: Sprites
XphoenixXphoenix 1214245043|%e %b %Y, %H:%M %Z|agohover

To draw a picture…
1. Press [DIAMOND] + [F3] to get to the graph screen (you may want to turn your functions and axes off)
2. Press [2ND] + [F2] for a list of tools you can use to draw. Pencil inverts the pixel. Eraser erases a small area. Line draws a line. Etc.

To save your picture…
1. Open that same menu ([2ND] + [F2]) and choose the last one, Save Picture
2. Choose the boundaries of your picture and press [ENTER]
3. Enter the file name + folder

To display your picture in a program…
This is all covered on the sprites page burr posted.

To draw stuff in a program…
There are many commands to draw lines, circles, and other stuff on the graph screen, which will be covered on the Graphics page once we finish it. Here are some:

  • Line
  • LineHorz
  • LineVert
  • PtOff
  • PtOn
  • PxlOff
  • PxlOn

For the syntax, check out the full TI-89 manual on TI's website.

To move a sprite…
Here's a basic structure you can use:
1. Draw the sprite at current coordinates (store them in variables)
2. Use the getKey() command to figure out which key a user has pressed
3. Clear the sprite off the screen
4. Change the coordinates of the sprite based on keypress
5. Go back to 1

unfold Re: Sprites by XphoenixXphoenix, 1214245043|%e %b %Y, %H:%M %Z|agohover
new post
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License