0 Members and 9 Guests are viewing this topic.
:For(A,1,8):Text(‾1,8A-8,0,sub(Str1,15A-14,15:StorePic 2:Text(‾1,8A-8,0,sub(Str2,15A-14,15:RecallPic 2:End:2→B:3→A:DelVar J:While 1:A→C:B→D:Text(‾1,8A-8,6B-6,"Ω:DelVar K:getKey→K:If K:Then:B+(K=26)-(K=24→B:If B≠D:Then:If ""=sub(Str1,15A-14+B-1,1:D→B:End:End:If ""≠sub(Str1,15(A+1)-14+B-1,1:Then:A+1→A:If J:A-1→A:Else:J+L1(1)(K=21→J:End:If J:Then:A-1→A:J-1→J:End:If A≠C or B≠D:Then:Text(‾1,8A-8,6B-6,"Ω:Text(‾1,8C-8,6D-6," :End:End
@simplethinker, isn't inString( slow, though? I remember testing it and it wasn't too fast from what I remember, compared to what i am doing atm
I figured it out, and I also figured out how to detect the way it is, I'll post my code in a bit.Code: [Select]:For(A,1,8):Text(‾1,8A-8,0,sub(Str1,15A-14,15:StorePic 2:Text(‾1,8A-8,0,sub(Str2,15A-14,15:RecallPic 2:End:2→B:3→A:DelVar J:While 1:A→C:B→D:Text(‾1,8A-8,6B-6,"Ω:DelVar K:getKey→K:If K:Then:B+(K=26)-(K=24→B:If B≠D:Then:If ""=sub(Str1,15A-14+B-1,1:D→B:End:End:If ""≠sub(Str1,15(A+1)-14+B-1,1:Then:A+1→A:If J:A-1→A:Else:J+L1(1)(K=21→J:End:If J:Then:A-1→A:J-1→J:End:If A≠C or B≠D:Then:Text(‾1,8A-8,6B-6,"Ω:Text(‾1,8C-8,6D-6," :End:Endit runs pretty quickly on the 83+. this version also includes spikes and stuff.
While Q>0 // Q=HealthG-(G>0->G // This is my 'if you jumped' variableH+not(G->H // This is my gravity variable. If E=1 // If there's an enemy in the roomThenprgmZ4EndIf not(G) and not(fPart(H/2)) and not(inString(Str0,sub(Str2,T+14,1 // more gravity stuffThenText(-1,8D-16,6C-12," T+14->T // Location in stringD+1->D // Player (Y) variableIf D>9 // If you go below the mapThenM+1->M2->D14+C->TprgmZ1EndText(->1,8D-16,6C-12,"ÊEndgetKey->KIf K=25 // if you jumpThenIf (inString(Str0,sub(Str2,T+14,1 // makes sure you're on a tile and not in the airThen4+2(1=L(1->G // Sets your jump to '4' or '6'EndEndIf G>0 and not(fPart(G/2)) and not(inString(Str0,sub(Str2,T-14,1 // if your 'jump' is still activated and nothing is above youThenText(-1,8D-16,6C-12," D-1->DT-14->TIf D<2 // if you went above the mapThen9->DM-1->M14D-14+C->TprgmZ1EndText(-1,8D-16,6C-12,"ÊEndIf (D=I and C=J) or sub(Str2,T,1)!=" " // if you hit an enemy or walked onto somethingThenprgmZ3EndIf (K=24 or K=26) and not(inString(Str0,sub(Str2,T-(K=24)+(K=26),1 // if left or right was pressed AND nothing is in the wayThenText(-1,8D-16,6C-12," C-(K=24)+(K=26->CT-(K=24)+(K=26->TIf C<2 or C>13 // If you went outside the mapThenL+(C>13)-(C<2->L13(C<2)+2(C>13->C14D-14+CüTprgmZ1EndText(-1,8D-16,6C-12,"ÊIf (D=I and C=J) or sub(Str2,T,1)!=" "ThenprgmZ3EndEndIf max(K={24,25,26 // Just here to fix a bug that I had found, you don't need to worry about itThenIf "x"=sub(Str2,T-(K=26)+(K=24)+14(K=25),1ThenText(ú1,8(D+(K=25))-16,6(C+(K=24)-(K=26))-12,"!StorePic 1Text(ú1,8(D+(K=25))-16,6(C+(K=24)-(K=26))-12,"xRecallPic 1EndEndEnd
:For(A,2,9) ;:Text(‾1,8A-2(8),0,sub(Str1,15A-(14+15),15 ;this is my:StorePic 2 ;dual text:Text(‾1,8A-2(8),0,sub(Str2,15A-(14+15),15 ;sprite engine:RecallPic 2 ;:End:L1(4→B:L1(5→A ;store initial starting point:DelVar J ;delete jump variable:Text(‾1,8,90,L1(2 ;display health:While A≠1 and A≠10 and B≠1 and B≠15 and L1(2 ;check to make sure that you have health and are not on edge of map:A→C ;store Y:B→D ;store x:Text(‾1,8A-8,6B-6,"Ω ;display character:If L1(3 ;if you are on a spike:Then:2→L1(3:Text(‾1,8A-8,6B-6,"* ;replace spike sprite:End:DelVar K ;I have no idea why I put it here...I'll get rid of it:getKey→K ;store key press:If K:Then ;if keypress:B+(K=26)-(K=24→B ;movement:If B≠D ;tests to see if you moved:Then:If ""=sub(Str1,15A-14+B-1,1 ;tests to make sure you are moving onto a blank spot:D→B ;if not, revert x:End:End:If ""≠sub(Str1,15(A+1)-14+B-1,1 ;if you are not above a tile:Then:A+1→A ;gravity happens:If J:A-1→A ;unless you are jumping:Else:J+L1(1)(K=21→J:End:If J:Then ;if you are jumping:If ""≠sub(Str1,15(A-1)-14+B-1,1 ;test to make sure there is a blank above you:Then:A-1→A ;if not, you stay still:End:J-1→J ;minus one to jump time:End:If A≠C or B≠D ;if you have moved:Then:Text(‾1,8A-8,6B-6,"Ω ;move character:Text(‾1,8C-8,6D-6," ;clear last spot you were on:If 2=L1(3 ;if you were on a spike:Then:Text(‾1,8C-8,6D-6,"* ;reset spike sprite:0→L1(3 ;clear spike flag:End:End:If Instring("Δ*~",sub(Str1,15A-14+B-1,1 ;If you are on something that does something to you:then:If "Δ"=sub(Str1,15A-14+B-1,1 ;if on a health pack:Then:L1(2)+3→L1(2 ;add health!:If 9<L1(2 ;but keep it below 10:9→L1(2:sub(Str1,15A-14+B,length(Str1)-15A-14+B→Str3 ;get rid of health from map:sub(Str1,1,15A-14+B-2→Str1 ;still get rid of it:Str1+" "+Str3→Str1 ;piece together map:Text(‾1,8,90,L1(2:Pause "HEALTH +3 ;tell the player what happened:End:If "~"=sub(Str1,15A-14+B-1,1 ;this is actually a small 0, but there is no equvalent on computers:Then:Pause "JUMP BOOST ;tell them that they are one step closer to flying:sub(Str1,15A-14+B,length(Str1)-15A-14+B→Str3 ;delete boost:sub(Str1,1,15A-14+B-2→Str1 ;delete I say!:Str1+" "+Str3→Str1 ;now replace:L1(1)+1→L1(1 ;actually give them the upgrade:End:If "*"=sub(Str1,15A-14+B-1,1 ;if you are on a spike:Then:L1(2)-1→L1(2 ;lower health:Text(‾1,8,90,L1(2 ;update health in corner:1→L1(3 ;set spike flag:End:End:If "..."=sub(Str1,15(C-1)-14+D-1,1 ;if on monkey bars:Then:If A>C ;and gravity is making you fall:Then:A-1→A ;don't!:Text(‾1,8(A+1)-8,6B-6," ;clear the sprite that is falling:End:End:End:A→L1(4 ;store new y:B→L1(5 ;store new x