Should I make the colors inverted when the timer is paused?
Yes.
 33%  [ 1 ]
No.
 66%  [ 2 ]
Total Votes : 3

A basic timer in full color. Pausing is almost finished. Here is the current program. http://www.cemetech.net/programs/index.php?mode=file&path=/84pcse/basic/programs/ColorTimer.zip

I just finished adding pausing to my timer program, which was really easy, but I don't know what I should display to let the user know that the timer actually did pause when they press enter without waiting for a second to see that the time is not increasing. I have included the code, but you could just download ColorTimer from the archives to see the program without pausing if you want. What should I display (in color) when the timer is paused? I would like it to be some kind of image implying pausing a timer on the right hand side of the screen. Thanks!


Code:
:DCS
"33333333333333333333332222233333333322CB1BC2233333322BBB1BBB22333332B1BBBBB1B233332CBBBBBBBBBC23332BBBBBBBBBBB23332B1BBB23333B23332BBBB3BBBBBB23332CBB3BBBBBBC233332BBBBBBB1B23333322BBB1BBB2233333322CBBBC22333333333222223333333333333333333333333333333333333
If 80>det([[20:Then:Disp "Get Doors CSE to run this:","http://dcs.cemetech.net":Return:End
ClrHome
1->G
real(0,1,1
real(0,3,4,103,1
real(0,3,4,103,1
real(0,1,0
DelVar SDelVar MDelVar H
det(12,Black,LtBlue
For(X,9,1,~1
Output(X,3,"                      "
End
Output(4,11,"Timer!"
Output(6,8,"By Gavin Vogt"
For(X,1,500
End
Output(4,11,"      "
Output(6,8,"             "
Output(1,10,"-------"
Output(2,10,"-Timer-"
Output(3,10,"-------"
det(12,Black,Red
Output(9,3,"    By Gavin Vogt     "
det(12,Black,LtBlue
Output(5,8,"Hours:"
Output(6,8,"Minutes:"
Output(7,8,"Seconds:"
startTmr->T
0->A
For(theta,1,92,.001
getKey->K
If Ans=45
92->theta
If K!=45
1->theta
If K=105
Then
E->A
Repeat Ans=105
getKey
End
startTmr->T
End
checkTmr(T)+A->E
iPart(E/3600)->H
iPart((E-3600H)/60)->M
E-3600H-60M->S
If S=0 and G=1
Then
Output(7,17," "
Output(6,17," "
2->G
End
If S=1
Then
1->G
End
Output(5,14,H
Output(6,16,M
Output(7,16,S
End
ClrHome
Can you change the color of the timer itself? Like yellow for paused or red for stop or something?
When I sent the sprite to my Graphing Calculator and tried to display the sprite with Celtic, something went wrong and it was way too wide and thin, but I thought I had the right length for the sprite because it is 4096 pixels, 64x64. What happened? I fixed it, but I want to know what is wrong. I also have another question now.

I am updating my timer program, but I want to make the sprites I display change faster. It goes slowly because my sprites are 4096 characters, and I have to read the line, storing it in Str9, before I can display the sprite with det(9,...). Is there a shortcut in Celtic to do this on my CSE? I have also included the AppVars.


Code:
:DCS
"33333333333333333333332222233333333322CB1BC2233333322BBB1BBB22333332B1BBBBB1B233332CBBBBBBBBBC23332BBBBBBBBBBB23332B1BBB23333B23332BBBB3BBBBBB23332CBB3BBBBBBC233332BBBBBBB1B23333322BBB1BBB2233333322CBBBC22333333333222223333333333333333333333333333333333333
If 80>det([[20:Then:Disp "Get Doors CSE to run this:","http://dcs.cemetech.net":Return:End
ClrHome
1->G
0->A
real(0,1,1
real(0,3,4,103,1
real(0,3,4,103,1
real(0,1,0
DelVar SDelVar MDelVar H
det(12,Black,LtBlue
For(X,9,1,~1
Output(X,3,"                      "
End
Output(4,11,"Timer!"
Output(6,8,"By Gavin Vogt"
For(X,1,500
End
Output(4,11,"      "
Output(6,8,"             "
Output(1,10,"-------"
Output(2,10,"-Timer-"
Output(3,10,"-------"
det(12,Black,Red
Output(9,3,"    By Gavin Vogt     "
det(12,Black,LtBlue
Output(5,8,"Hours:0"
Output(6,8,"Minutes:0"
Output(7,8,"Seconds:0"
"rowSwap(PAUSE->Str0
2
det(0
det(9,64,183,~8
startTmr->T
0->A
For(theta,1,92,.001
getKey->K
If Ans=45
92->theta
If K!=45
1->theta
If K=105
Then
E->A
"rowSwap(PAUSE->Str0
1
det(0
det(9,64,183,~8
Repeat Ans=105 or K=45
getKey->K
End
If K=45
Then
ClrHome
Return
End
"rowSwap(PAUSE->Str0
2
det(0
det(9,64,183,~8
startTmr->T
End
checkTmr(T)+A->E
iPart(E/3600)->H
iPart((E-3600H)/60)->M
E-3600H-60M->S
If S=0 and G=1
Then
Output(7,17," "
Output(6,17," "
2->G
End
If S=1
Then
1->G
End
Output(5,14,H
Output(6,16,M
Output(7,16,S
End
ClrHome


[removed by admin: please don't post huge swathes of mostly useless hex data]
...wow. Use xLIBC for sprite drawing, it'll be a lot faster.

If you want to do it in fullscreen mode (xLIBC expects you to be in half-resolution mode), just scale the sprites to 200% width so they display correctly in fullscreen mode (because xLIBC doubles pixels on the x-axis to make half-res mode work correctly).

edit: also, since this looks like a fullscreen image, you'll have to use real(4 twice.
There are actually two sprites in the appvar, and they are both 64x64 pixels. I am still experimenting with xLIBC for sprites. Are there any good demos of it?
readroof2 wrote:
There are actually two sprites in the appvar, and they are both 64x64 pixels. I am still experimenting with xLIBC for sprites. Are there any good demos of it?
Take a look at, for example, Merthsoft's DinoPuzzle, which uses an AppVar spritesheet and the xLIBC sprite routines.
Should I just download the program and AppVars to look at on my calculator or just with SourceCoder? I have formatted my image so it will work without half resolution.
This is what I got with TokenIDE for the image at http://i.imgur.com/DxBvuyJ.png.

[Removed by admin: Don't include tons of pretty useless data in posts]

I tried to display it with the following:

SourceCoder 3 (A) wrote:
:"PLAY
:real(5,0,0
:real(4,0,0,0,64,64,0,0,94,1,0,0
:Pause


What do I need to change?
I don't know how to use libraries; sorry...

Honestly, when you're using most of your program's space for sprites, you're doing it wrong. No one wants a 5000-byte program that has 500 bytes of functionality.
What size is the image? It seems like 64,64 are wrong, if the image is 16x16 the 64x64 would be 2x2 and so on increasing the amount by one every 8 pixels. So a 16x24 would be 2,3. You are having the transparent color be 94, and to update tye lcd after drawing. Then you have it draw from pic index 0, good. Then you are telling it to draw the 8x8 square labeled 0 on the top left of your screen. You have a picture bigger than 8x8, so you must use multiple different squares. There is a chart showing the layout of some of them in the ManagePic section of the DCS wiki. The chart is under the command real(5,5. Do not call real(5,5 when displaying the sprite.

Sorry for the long post, but I hope it helps, if I said something wrong please correct me.
lirtosiast wrote:
I don't know how to use libraries; sorry...

Honestly, when you're using most of your program's space for sprites, you're doing it wrong. No one wants a 5000-byte program that has 500 bytes of functionality.


Do you mean I should just get rid of the sprites (which are in AppVars, not programs) and use something else to let the person using the timer know when the timer is paused? I don't know what I would display.

Edit: I added a poll because I might invert the colors while the timer is paused. Or I would use xLIBC to draw four rectangles in a different color than the background, like red, to show the timer is paused, and the already green background means the timers is going.
The poll is useless now because I uploaded an update to the queue, but it is not in yet. I did not invert the colors, but I did draw four red rectangles and change the background color for my name to yellow. In addition, I was wondering if I should make a very basic timer with no color, so it would not require Doors CSE and it would be simple like just ClrHome and a loop. That would be a lot less bytes and work fine, and I can copy some of the code from my program for how I got the number of hours, minutes, and seconds.
I think what you have now is fine, as if you don't have DCSE nothing will really work except for few select games and utils.

I guess it could be CE compatible...
  
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 1
» 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