- Optimize, please
- 02 Aug 2006 05:15:01 pm
- Last edited by calc84maniac on 24 Aug 2006 03:31:46 pm; edited 1 time in total
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:
Variable Info:
A-Your score
B-Omega's height
C-Erase checker
Str1-Floor Data
Str2-Mountain Data
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