This is my "Omega" sidescrolling game. You are an omega who has to jump over the holes in the ground. And there are scrolling mountains in the background. Note that i will type [omega] where the omega symbol is.


Code:

:While 1
:ClrHome
:"OMEGA*OMEGA*OMEG->Str1
:Output(8,1,Ans
:"^v^^-^v-^-^v^-^- ->Str2
:Output(5,1,Ans
:For(A,1,6
:Output(7,A,"[omega]
:rand(15
:Output(7,A,"_
:End
:Delvar A7->B
:Output(7,7,"[omega]
:Repeat B=7 and "_"=sub(Str1,6,1
:Output(8,1,Str1
:A+1->A
:sub(Str1,2,15)+sub(sub(Str1,5,1)+"_",not(randint(0,3))+1,1->Str1
:If fpart(.5A
:sub(Str2,2,15)+sub("^-v",randint(1,3),1->Str2
:B->C
:getkey
:If Ans=105
:Then
:Lbl P
:Menu "_____PAUSED_____","BACK",B,"GAME_MADE_BY",P,"OUTSIDE",P,"THE_BOX",P,"PROGRAMMING",P
:Lbl B
:End
:If Ans=45
:Goto Q
:B+(B<7)-3(B>2 and E(Ans=21 or Ans=25->B
:If B/=C
:Output(C,7,"_
:Output(5,1,Str2
:Output(B,7,"[omega]
:If B=7
:1->E
:If B<=4
:0->E
:Output(1,1,A
:End
:rand(5
:Output(7,7,"_
:Output(8,7,"[omega]
:rand(5
:Output(8,7,"_
:Pause
:End
:Lbl Q
:Clrhome
:Delvar Str1Delvar Str2Output(1,1,"


Variable Info:
A-Your score
B-Omega's height
C-Erase checker
Str1-Floor Data
Str2-Mountain Data
I wish I knew more about homescreen sidescrolling using strings. Sad Many things jump out right away. This

Code:
:If Ans=105
:Then
:Lbl P
:Menu "_____PAUSED_____","BACK",B,"GAME_MADE_BY",P,"OUTSIDE",P,"THE_BOX",P,"PROGRAMMING",P
:Lbl B
:End

Is a horrible way to display your credits. You could do

Code:
:If Ans=105
:Then
:Disp "_____PAUSED_____","Game made by","Outside","The box
:Pause "Programming
:End

Also, exiting the loop using a goto is bad. You can add (Ans=105->K, change the while loop to Repeat K, and add or K to the second Repeat loop. If you put the goto inside to prevent the rest of the code to be executed if clear is pressed, you can do If not(K Then the rest of the code up to the end of the loop. The output at the end to get rid of the done could be accomplished by simply putting this " instead. The rand(15 in the first For( loop is for a delay right? It's what I use them for. See if you really need it and your other delays and remove it if you don't. That's all I have to say.
Eeexcellent. Ve haf taught you vell... Wink

For this code:
Code:
:Delvar Str1Delvar Str2Output(1,1,"


you can simplify it to:

Code:
:Delvar Str1Delvar Str2"
something1990 wrote:
The output at the end to get rid of the done could be accomplished by simply putting this " instead.

I did mention that one.

Code:

:While 1
:ClrHome
:"OMEGA*OMEGA*OMEG->Str1
:Output(8,1,Ans
:"^v^^-^v-^-^v^-^- ->Str2
:Output(5,1,Ans
:For(A,1,6
:Output(7,A,"[omega]
:rand(15
:Output(7,A,"_
:End
:Delvar A7->B
:Output(7,7,"[omega]
:Repeat B=7 and "_"=sub(Str1,7,1
:A+1->A
:sub(Str1,2,15)+sub(sub(Str1,5,1)+"_",not(randint(0,int(.5A)))+1,1->Str1
:If fpart(.5A
:sub(Str2,2,15)+sub("^-v",randint(1,3),1->Str2
:B->C
:getkey
:If Ans=105
:Then
:Disp "_____PAUSED
:Disp "GAME_MADE_BY
:Disp "OUTSIDE
:Disp "THE_BOX
:Pause "PROGRAMMING
:ClrHome:0
:End
:If Ans=45
:Goto Q
:B-3(2<BEmax(Ans={21,25
:Ans+(Ans<7->B
:If B/=C
:Output(C,7,"_
:Output(5,1,Str2
:Output(B,7,"[omega]
:Output(8,1,Str1
:If B=7
:1->E
:If B<=4
:0->E
:Output(1,1,A
:End
:rand(5
:Output(7,7,"_
:Output(8,7,"[omega]
:rand(5
:Output(8,7,"_
:Pause
:End
:Lbl Q
:Clrhome
:Delvar Str1Delvar Str2"THANKS 4 PLAYING
I see now why (Ans=45->K won't work. It would interfere with the next calculation. It could be helped by saying If Ans=45 1->K.
"Omega v2.0" has now been released on ticalc.org! Thanks for the help, guys! Smile
(You can find it by clicking on the ticalc.org link in my sig.)
Great! Hope it's successful. Do you hvae any plans for more versions, or is this it?
I might slow it down (a.k.a. not always running forward) and add enemies and a boss or something.
That's neat. Do you mean like adding acceleration and deceleration to the character sprite? If so, that would be awesome.
Yeah, I guess that would be better than what I was thinking because I can't press jump at the same time as an arrow key and I'm trying to avoid using asm programs.
calc84maniac wrote:
Yeah, I guess that would be better than what I was thinking because I can't press jump at the same time as an arrow key and I'm trying to avoid using asm programs.
Yup, that would be the best way to do it.
Of course, the program would probably be at least tripled in size. Sad
I've always been a huge fan of randomized environments. Perhaps you could include some of those?
Aeromax wrote:
I've always been a huge fan of randomized environments. Perhaps you could include some of those?
Holy necropost, Batman! I'd assume in the past two years that he's dropped this project.
Oh crap, sorry. I'm not too good at reading timestamps...
Aeromax wrote:
Oh crap, sorry. I'm not too good at reading timestamps...
Well, you can be excused just this once.
  
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