Is there a way to draw on the homescreen? So like, if I were to make a menu on the homescreen, and I wanted it to look more like a graphscreen menu, is there a way I could do that?

Also, another question I have, can anybody help me out with how to make a good way to have like a moving crosshair?

Edit: How do I make it so I can save where a person left off?
Swoll_Monkey wrote:
Is there a way to draw on the homescreen? So like, if I were to make a menu on the homescreen, and I wanted it to look more like a graphscreen menu, is there a way I could do that?
You can just make it on the graphscreen instead, using the Text(Y,X,-1,"String trick that lets you use large (homescreen) text on the graphscreen. There's no way to draw on the graphscreen.

Swoll_Monkey wrote:
Also, another question I have, can anybody help me out with how to make a good way to have like a moving crosshair?
The best would be something simple like this:


Code:
47->A:31->B
Repeat K=45
Pxl-Change(B,A-1
Pxl-Change(B,A-2
Pxl-Change(B,A+1
Pxl-Change(B,A+2
Pxl-Change(B+1,A
Pxl-Change(B+2,A
Pxl-Change(B-1,A
Pxl-Change(B-2,A
Repeat K
getKey->K:End
Pxl-Change(B,A-1
Pxl-Change(B,A-2
Pxl-Change(B,A+1
Pxl-Change(B,A+2
Pxl-Change(B+1,A
Pxl-Change(B+2,A
Pxl-Change(B-1,A
Pxl-Change(B-2,A
B+(K=34)(B=/=60)-(K=25)(B=/=2->B
A+(K=36)(A=/=92)-(K=24)(A=/=2->A
End


Swoll_Monkey wrote:
Edit: How do I make it so I can save where a person left off?
Use a custom-named list to store the important variables about the user's progress.
KermMartian wrote:
Swoll_Monkey wrote:
Edit: How do I make it so I can save where a person left off?
Use a custom-named list to store the important variables about the user's progress.


So, how would I store a menu option like that? In my program, you pick an assassin in the beginning, how would I save which assassin you used? Then, how would I save the type of gun that you use throughout the game if it's a menu option?
You could do something like this, if for example you had two variables, Q and R, that you wanted to save:

[initialization:]
3->dim(LSAVE

[save game:]
1->LSAVE(1
Q->LSAVE(2
R->LSAVE(3

[load game:]
If not(LSAVE(1
Then
Disp "NO SAVED GAME!
Else
LSAVE(2->Q
LSAVE(3->R
End
KermMartian wrote:
You could do something like this, if for example you had two variables, Q and R, that you wanted to save:

[initialization:]
3->dim(LSAVE

[save game:]
1->LSAVE(1
Q->LSAVE(2
R->LSAVE(3

[load game:]
If not(LSAVE(1
Then
Disp "NO SAVED GAME!
Else
LSAVE(2->Q
LSAVE(3->R
End


I'm sorry, I just don't understand that. Laughing
Then re-read (or read) some tutorials on using lists in BASIC, and look back at it again.
Is there a way to make a scrolling function in Basic? I've seen programs with it, but they were in assembly.
Swoll_Monkey wrote:
Is there a way to make a scrolling function in Basic? I've seen programs with it, but they were in assembly.
Do you mean making the text on the homescreen scroll, or making the graphscreen scroll? The homescreen scrolling in BASIC is possible, while the graphscreen is not (at least not if you mind one pixel of scrolling taking 40 seconds).
KermMartian wrote:
Swoll_Monkey wrote:
Is there a way to make a scrolling function in Basic? I've seen programs with it, but they were in assembly.
Do you mean making the text on the homescreen scroll, or making the graphscreen scroll? The homescreen scrolling in BASIC is possible, while the graphscreen is not (at least not if you mind one pixel of scrolling taking 40 seconds).


Well, the homescreen then. How do you do that?
Short answer: Strings.

Have the whole map stored as a sting and selectively Output( parts of it by using the Sub( command.
That's it, they're in assembly. Assembly has more roam over the calculator than a BASIC program.

As for Kerms code, this is it explained:
Quote:
[initialization:]
3->dim(LSAVE

"dim(" stands for dimension. So 3->dim(LSAVE will be created with three elements all at zero - {0 0 0}

Quote:
[save game:]
1->LSAVE(1
Q->LSAVE(2
R->LSAVE(3

1 is saved to the first element, so the program knows that the save game exists. For space purposes, I used this element for a normal variable and instead of checking if LSAVE(1)=1 I check to see if it LSAVE(1)≠0. Q can be the character (1-X, where X is how many options you can choose from) and R is the gun (1-X)

Quote:

[load game:]
If not(LSAVE(1
Then
Disp "NO SAVED GAME!
Else
LSAVE(2->Q
LSAVE(3->R
End


Basically, this checks LSAVE(1 exists. I can't recall if this will give a name error because it'd not creating LSAVE. I would do this:
Quote:
3->dim(LSAVE
If not(LSAVE(1
Then
...

This creates LSAVE with thee variables. If you already have LSAVE, then nothing will be overwritten. If it the list is longer than three, all the variables past the third element will be deleted.

You'll notice that data is extracted from the last two elements with Kerms' way and the first element is only used to tell the program that there is proceeding data. You can easily eliminate the first variable and shorten the list to two elements by checking to see if that first element is in fact, not zero like I said above.

Is this any clearer? Anyone spot any flaws in my rustiness?
Okay thanks for the answers, even if I don't fully understand them ( Rolling Eyes )

Can anybody post a small example of the code that would make your homescreen scroll down to see more?
More what?

More text, more map, more potatoes?

You have to specify.
jbr wrote:
More what?

More text, more map, more potatoes?

You have to specify.


It depends. I don't really need to use this yet, but I'm guessing I'll have to use it for either more text or more menu options in teh game at some point. I wanna make it the best that I can, which sadly, isn't that great. Wink
Ok, extra text is no problem. Even a simple "Disp" will scroll the screen if it runs out of room at the bottom.

Extra menu options have to be accessed through an option on the menu, as in"

____MENU____
1:Potato
2:Cheese
3:Monkey
4:MORE CHOICES

and then have 4 jump to another menu command that makes the menu with the next set of options.
jbr wrote:

____MENU____
1:Potato
2:Cheese
3:Monkey
4:MORE CHOICES

and then have 4 jump to another menu command that makes the menu with the next set of options.


I know how to do that. But, if i don't use the installed menu function, and make my own (which I'm not entirely sure how to do yet) then how could I make it scroll down and stuff? Sorry I didn't make my question clear enough.
Eee... I can try...


Code:

"0000000000000000"->Str0
"1111111111111111"->Str1
"2222222222222222"->Str2
...
"9999999999999999"->Str9

This will be the top of your program.

Here comes the meat to it:


Code:

For(1,200,X)
Disp Str1
While(Y>101)
For(1,100,Y)
End
End
Disp Str2
While(Y>101)
For(1,100,Y)
End
End
Disp Str3
While(Y>101)
For(1,100,Y)
End
End
Disp Str4
While(Y>101)
For(1,100,Y)
End
End
Disp Str5
While(Y>101)
For(1,100,Y)
End
End
Disp Str6
While(Y>101)
For(1,100,Y)
End
End
Disp Str7
While(Y>101)
For(1,100,Y)
End
End
Disp Str8
While(Y>101)
For(1,100,Y)
End
End
Disp Str8
End

This is a basic example. I always hate using Strings. People use them for things and if a String is archived, your program is boned. I prefer lists because you can create your own custom lists.

It is possible to create a list with values and have a parser change those values to letters for the Home Screen, which won't take up any Strings, but instead a few hundred bytes or so Sad The trade off could mean a smoother experience for the user.

I always hated when I got an Error saying: ERR:ARCHIVED and it turned out to be a string the program was trying to write too.
Swoll_Monkey wrote:

I know how to do that. But, if i don't use the installed menu function, and make my own (which I'm not entirely sure how to do yet) then how could I make it scroll down and stuff? Sorry I didn't make my question clear enough.


Get familiar with getKey. Create a small program that returns the value for they key you press. Eventually you'll see the calculator as a grid and you'll be able to recall any key's code. Using this can have a scrollable menu on the home screen. I believe 24, 25, 26 & 34 are for the arrow keys, not positive - I've forgotten the grid and thus the pattern.

You can do a while loop that just loops waiting for a a down or up keypress (or plus or minus, even both) and if up is pressed, scroll up one page or one option. Same with down.

[ON] has no number. It will always break a Basic Program.
some18kanal0n3 wrote:
...Basically, this checks LSAVE(1 exists. I can't recall if this will give a name error because it'd not creating LSAVE. I would do this:
Quote:
3->dim(LSAVE
If not(LSAVE(1
Then
...

This creates LSAVE with thee variables. If you already have LSAVE, then nothing will be overwritten. If it the list is longer than three, all the variables past the third element will be deleted...
Right, hence the initialization thing. That should be at the beginning of the program and run every time it starts
Thanks, that's what I was looking for, i think Rolling Eyes

Anyway, isn't



Code:
for(1,100,Y
supposed to be
Code:
for(Y,1,100
?
  
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