Yeah, so I was just randomly thinking of ways to practice certain functions, because, as most of you know, I'm brand new to this, and I pretty much SUCK at it.

Well, long story short, here's my program. Yes, I know, it's pointless, yes, I know, it's retarded. Just bear with me, because this is me practicing. What I want to you from you guys, is as to what I should do to make this game actually worthwhile, and if there is any way to optimize, or make it faster, because it's slow as hell!

Without further ado:



Code:

AxesOff
ClrDraw
Lbl 0
ClrDraw
Text(0,28,"PASS3D @UT                (@ is theta)
Text(7,2,"========================
Text(20,2,"2ND --- START GAME
Text(30,2,"ALPHA - HISCORE
Text(40,2,"CLEAR - QUIT
Text(50,2,"-----------------------------------------------
Text(55,2,"MADE BY: VICTOR SMITH
While 1
Getkey->K
While K=0
Getkey->K
End
If K=21
Goto 1
If K=31
Goto 2
If K=45
Goto @
End

Lbl 1
ClrDraw
UnArchive H                  (H is my highscore thingy)
For(A,1,25
Text(0,0,"H
End
(The rest is the same as the above 3, it's just goes to say HOLDING BREATH)
End
RandInt(0,1000)->X
Text(10,0,X
If X>H
X->H
Archive H
Pause
Goto 0
End

Lbl 2
ClrDraw
Unarchive H
Text(0,0,"HIGHSCORE IS:
Text(10,0,H
Pause
Archive H
Goto 0
End

Lbl @
ClrDraw
ClrHome
Stop


Yeah, so that's it.

Code:

AxesOff
While 1
ClrDraw
Text(0,28,"PASS3D @UT                (@ is theta)
Text(7,2,"========================
Text(20,2,"2nd --- START GAME
Text(30,2,"ALPHA - HISCORE
Text(40,2,"CLEAR - QUIT
Text(50,2,"-----------------------------------------------
Text(55,2,"MADE BY: VICTOR SMITH
Repeat Max(K={21,31,45
Getkey->K
End
If K=21
1->A
If K=31
2->A
If K=45
3->A

If A=1
Then
ClrDraw
rand(3
Text(0,0,"H
(The rest is the same as the above 3, it's just goes to say HOLDING BREATH)
End
RandInt(0,1000->X
Text(10,0,X
If X>H(1
{X->H
Pause
End
If A=2
Then
ClrDraw
Text(0,0,"HIGHSCORE IS: ",LH
Pause
End
If A=3
Then
ClrDraw
ClrHome
End
End

I changed your Highscore to a list otherwise it will get overwritten easily and I made it without goto's.

Code:
noahbaby94 wrote:
[code]
If X>H(1
{X->H
Pause
End
If A=2
Then
ClrDraw
Text(0,0,"HIGHSCORE IS: ",LH
Pause
End
[code][/code]

I don't get that part. What does the If X>H(1 and {X->H and the "HIGHSCORE IS:", LH part mean?

Code:
While 1
Getkey->K
While K=0
Getkey->K
End
If K=21
Goto 1
If K=31
Goto 2
If K=45
Goto @
End



Code:

Repeat K>0
Getkey->k
End
If K=45
Goto @
If K=31
Goto 2

Lbl 1
Swoll_Monkey wrote:
noahbaby94 wrote:
[code]
If X>H(1
{X->H
Pause
End
If A=2
Then
ClrDraw
Text(0,0,"HIGHSCORE IS: ",LH
Pause
End
[code][/code]

I don't get that part. What does the If X>H(1 and {X->H and the "HIGHSCORE IS:", LH part mean?


H is a list, which is {X(highscore)}
However, to compare a list with only one number and some other variable requires you to call the element number in the list. Thus, H(1) is the first element in the list (the highscore)

comprende?
Yeah I understand, but I couldn't figure out anyway to make that game have a point, so I scraped the idea.
Swoll_Monkey wrote:
Yeah I understand, but I couldn't figure out anyway to make that game have a point, so I scraped the idea.
I believe the point is to understand the basics of high score storage, no? Razz

Code:

AxesOff
ClrDraw
// You need to set window coordinates (Xmin, Xmax, Ymin, Ymax). Otherwise you're taking a gamble that someone has the right coordinates. Of course Text( commands are independent of window settings, however it's helpful to have the graph size set to 94x62 so you can have lines as a part of your display.
Lbl 0
ClrDraw
Text(0,28,"PASS3D @UT                (@ is theta)
Text(7,2,"========================
// If you have 0 as Ymin and 62 as Ymax (one pixel per Y unit), you can make this look a hell of a lot better by doing Horizontal 55, the next line should be two more pixels down to space for the line.
Text(20,2,"2nd --- START GAME
Text(30,2,"ALPHA - HISCORE
Text(40,2,"CLEAR - QUIT
Text(50,2,"-----------------------------------------------
Text(55,2,"MADE BY: VICTOR SMITH
While 1
Getkey->K
While K=0
Getkey->K
// WTF @ previous 4 lines, I don't get the purpose of these
End
If K=21
Goto 1
If K=31
Goto 2
If K=45
Goto @
End
// You should have something in place to account for keystrokes that don't trigger anything.

Lbl 1
ClrDraw
UnArchive H                  (H is my highscore thingy)
// Using variables for high scores is a horrible idea
For(A,1,25
Text(0,0,"H
End
(The rest is the same as the above 3, it's just goes to say HOLDING BREATH)
End
RandInt(0,1000)->X
Text(10,0,X
If X>H
X->H
Archive H
Pause
Goto 0
End

Lbl 2
ClrDraw
Unarchive H
Text(0,0,"HIGHSCORE IS:
Text(10,0,H
Pause
Archive H
Goto 0
End

Lbl @
ClrDraw
ClrHome
Stop
  
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