I want to start using ICE, and I thought that this would be something relatively easy to do. My goal is to have a simple pixel art animation that goes through 2-3 frames to make a small looping animation. My problem is I have no Idea how to use ice, how to make sprites or really anything. I have read through this list of ICE commands http://htmlpreview.github.io/?https://github.com/PeterTillema/ICE/blob/master/documentation/commands.html. I still don't really understand how any of this works. If someone could point me in the right direction, or show some code that does this that I could use as a skeleton for what I want to do, that would be awesome. Thanks for your help!
21tmccauley wrote:
I want to start using ICE, and I thought that this would be something relatively easy to do. My goal is to have a simple pixel art animation that goes through 2-3 frames to make a small looping animation. My problem is I have no Idea how to use ice, how to make sprites or really anything. I have read through this list of ICE commands http://htmlpreview.github.io/?https://github.com/PeterTillema/ICE/blob/master/documentation/commands.html. I still don't really understand how any of this works. If someone could point me in the right direction, or show some code that does this that I could use as a skeleton for what I want to do, that would be awesome. Thanks for your help!


All of my ICE programs are open source, so there's some examples I guess Smile. The actual ICE download also includes some examples programs. I find that looking at actual code rather than the documentation helps me learn more. Good luck and feel free to ask me any questions! Good Idea
OldNewTimer wrote:
21tmccauley wrote:
I want to start using ICE, and I thought that this would be something relatively easy to do. My goal is to have a simple pixel art animation that goes through 2-3 frames to make a small looping animation. My problem is I have no Idea how to use ice, how to make sprites or really anything. I have read through this list of ICE commands http://htmlpreview.github.io/?https://github.com/PeterTillema/ICE/blob/master/documentation/commands.html. I still don't really understand how any of this works. If someone could point me in the right direction, or show some code that does this that I could use as a skeleton for what I want to do, that would be awesome. Thanks for your help!


All of my ICE programs are open source, so there's some examples I guess Smile. The actual ICE download also includes some examples programs. I find that looking at actual code rather than the documentation helps me learn more. Good luck and feel free to ask me any questions! Good Idea


Yeah, same here. A good one is my CC21 Diwali program, the selection menu has an animation in it. You might also want to look into double buffering once you get the hang of ICE, it'll help make animations look better without the flickering (something I also need to do, which is why I don't have much to say about it)
The first big hurdle that I am trying to get over is getting my mac ready to code. I am setting up XQuartz 2.7.7 and Wine so I can run convpng. Once I get all of this done, there will be lots of questions about how to get this all set up and the code flowing out. Thanks for the enthusiastic support!
If you know TI-Basic, learning ICE shouldn't be hard at all. It's very similar, except for some things. There aren't "real sprites" in Basic, but there are in ICE. ICE is ez80 ASM, compiled from a “Basic” source. The cmd list really helped me get started with it, and so did making some random programs that experimented with sprites and graphics. You might consider porting one of you Basic programs or games to ICE, and if there aren’t that many graphics or menus, it shouldn’t be that hard. One thing is that there are no menus, but you can make your own custom menus. For coding, I also use a mac, and I use SourceCoder3, TI-Connect CE, or on-calc to program ICE. My preferred method is on-calc, and for sprites, I just load them in a separate program, and then link them. If you understand the [trace] menu syntax help, you should be able to do non-sprites programming pretty easily on-calc. Since you’re making something like a GIF, you should ask beckadamtheinventor for some advice, since he made a library that helped you make them. How I would do it is, make a loop, and then the separate “images” to be displayed in order, and then add “Wait” commands in between, to about 300 each, for 300 milliseconds wait in between so it’s not too fast. First though, you should lay out all the sprites, and store them in unique variable names. I recommend using a sub-program with all the sprite data in it, and call it with “AsmComp(<program name>”.
Possible code layout:

Code:
[i]ANIMATE
det(0 // Don’t forget this. This is the “Begin” for the graphics canvas
DefineSprite(5,5,<blah>->A
DefineSprite(5,5,<blah>->B
DefineSprite(5,5,<blah>->C
DefineSprite(5,5,<blah>->D
DefineSprite(5,5,<blah>-><you get the point>
Repeat getKey!=0
Sprite(<Random coordinates and sprite name goes here>
Sprite(<Random coordinates and sprite name goes here>
Sprite(<Random coordinates and sprite name goes here>
Sprite(<Random coordinates and sprite name goes here>
Sprite(<Random coordinates and sprite name goes here>
End
det(1 // Don’t forget this either. This returns the calc to normal screen proportions (or whatever bpp mode it is), and if it’s forgotten, it’ll look like that magnified screen with a purple-ish status bar after exiting.


Hope this helps, and anyone, correct me if I have said anything that is wrong or outdated.
If you are moving the sprites, don't forget to erase the old ones with a det(36

Set the color to the background first... det(2
No, don't erase sprites before drawing a new one. Just use double-buffering (which is explained in the ICE documentation PDF (which is also put on http://ice.cemetech.net )). That is a much cleaner solution, and also easier. If you have questions, feel free to ask them, I'm always happy to help you! Smile
After a long time of messing around, and nothing working, I gave up on using wine to run convpng. Instead I am using the on calculator sprite maker. Once I make one it puts it in to Str1. How do I take the sprite from there and store it so it doesn't get lost. In the end, there will be six different sprites that it will go through to form the "animation". Also, how would I make a background. Could I make it have to layers so the ground stays still and the sky moves?
[2nd] RCL into a separate prgm, then do DefineSprite(W,H,<paste string here>->SPRITEA, where W is width, H is height, and SPRITEA is the pointer. Use the sprite like so: Sprite(SPRITEA,X,Y
21tmccauley wrote:
After a long time of messing around, and nothing working, I gave up on using wine to run convpng. Instead I am using the on calculator sprite maker. Once I make one it puts it in to Str1. How do I take the sprite from there and store it so it doesn't get lost. In the end, there will be six different sprites that it will go through to form the "animation". Also, how would I make a background. Could I make it have to layers so the ground stays still and the sky moves?


You can recall the string in the source. [2nd]+[->] and then [vars]+[7]+[1]. Since you’re using wine, I *assume* you’re using mac, although you could be using Linux as well. What exactly is your problem with it? I never use wine to run convpng. I put both convpng and convpng.ini in the same folder with the image, I cd from terminal to that folder/directory, and run convpng. I like the on-calc sprite maker, but it’s not efficient enough for me sometimes. You can use the one in SC3, in the CSE Basic mode, starting it with a quotation mark, but that’s only for icons. IIRC, there is an actual sprite maker in SC though. If you have 6 sprites, I recommend putting them in a subprogram, since you have to scroll through all of them to get to your actual code. You have to use separate buffers for a background, and then a front layer.

EDIT: I see you ARE using a mac. It's really not that hard to use convpng on mac, but maybe you haven't found that key...
If you're still struggling, try to catch Mateo on a good day and ask him for help.
my problem with using wine to run convpng comes in two parts. The first is with just wine running through terminal, it would always say that the file could not be found. Then I decided to try using wine bottler to see if that helped. It took the file and made an application, but when I opened it, it was a weird word processing program.

EDIT:
I exported the sprite into Str1.

Code:

DefineSprite(29,36,Str1->Frame1

Is this all I need to do? Will the sprite get over written when I export another sprite or put anything else in Str1?


EDIT 2:
Hopefully this is the last thing I forgot to ask. Where is the token to display a sprite on the calculator?
you need the data, so rcl Str1 into where it says "Str1", pointers should be uppercase, and iirc, can't have numbers.

To display a sprite, after running ICE atleast once, press [TRACE], it'll bring up a menu w/ all the functions. Press LEFT and RIGHT arrow keys until you see "Sprite(PTR,X,Y". Press ENTER, that'll paste a det(57, iirc.

Add your PTR and the coordinates, ex:
det(57,FRAMEA,0,0
How can you edit the program after you compile it? Do I need a copy that I don't compile as it would still be in basic?
Yeah, that would be the sec, with all the dets, etc.
SM84CE wrote:
Yeah, that would be the sec, with all the dets, etc.


Im not sure I understand what you are talking about.
Remember when you typed [i]PRGMNAME at the very beginning of your program? That will be the compiled programs name when you compile it. It should not be the same name as your source file (which is where you're editing the program right now).

SM84CE meant by "Yeah, that would be the sec, with all the dets, etc." he really meant to say "Yes, that would be the src (The source file) which contains all the uncompiled ICE commands such as det(, sum(, etc." Smile
I named the file [i]ANIMATE and after I compiled it, it was no longer in the edit menu. Where can I find it?
The compiled program is NOT editable, you'll need to edit the src and recompile
When I ran my code, no sprite showed up, and all that was there was a white screen

Code:

[I]ANIMATE
det(0
DefineSprite(29,36,<sprite data>,->FRAMEA
Repeat getKey != 0
Sprite(20,20,FRAMEA
End
Det(1


EDIT:
Fixed BBCode
Try this:

Code:
PROGRAM:ANIMSRC
[I]ANIMATE
det(0
DefineSprite(29,36,<sprite data>->FRAMEA
//no "," before the ->
Repeat getKey!=0
//TI-BASIC does not like whitespace!

Sprite(FRAMEA,20,20
//syntax is Sprite(PTR,X,Y
// also "//" can be used in SC ONLY for comments; they won't show up in the src code

End
det(1
  
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