New games every week!
JSE - Familiar Avoidance Blog
12th May 2021
Well, it works...

-=-=-

I'm cheating this a little bit.
I was holding it back until I got Arrays working, but I still haven't managed them.
Instead, then, I've made use of the Tilemap's "Data" functionality, and used it like I would an array.
Basically, instead of MyArray(x,y), I'm using SetTileData(x,y,value) and value=GetTileData(x,y), which is working reasonably well.

For loops still aren't working either, so there's a couple of Repeat-Until's there in the meantime.
But.. Yeah, it's playable, so .. There's that..!
I've called it v0.5 until I can get those bloomin' features up and running.

// SpikeDislike v0.5 // by Jayenkai // Created 2021/4/13 Symbol 0,"0__20!203044030,30030,404404004044040,30030,304403020!2"; Symbol 1,"0__00A,B0,A9AB,0A9AB.CAAB?CAAB?CB!CD0B.CD0,C,D"; Symbol 2,"2__0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0/y0_0_0_0_0_0_0_;0_0_0_0y0;0;0y0_0_0_0;0_0_0_0_0_0_0_y"; Graphics 1024,720,2; AA Off SetTilemapSize(128,8) DebugMode 1 Highscore=0 Gosub Restart Repeat Button=Gamepad(ButtonA) or Gamepad(ButtonB) or Gamepad(ButtonRight)>0 or MouseDown() if Button==0 then bdis=0 If Ingame==0 then Gosub Menu If Ingame==1 then Gosub Game Flip Forever @Menu if Score>Highscore then Highscore=Score ResetDraw SetCol 255,100,100 SetFontSize 48 Text ScreenWidth*0.5-64,(ScreenHeight*0.4)+128,"Spike",1 Text ScreenWidth*0.5+64,(ScreenHeight*0.4)+160,"Dislike",1 SetCol 255,255,255 Text ScreenWidth*0.5,(ScreenHeight*0.4)+192,"Highscore : "+Highscore,1 SetSize 6,6 DrawImg ScreenWidth*0.5,ScreenHeight*0.4,0,0 if Button==1 and bdis==0 then Gosub Restart Return @Restart Passed=0 Score=0 ScoreShow=0 Combo=0 ComboTick=0 SuperCombo=0 Gap=360 Speed=0.6 Bounce=3.5 BounceRot=0 SpikesMade=0 BNoise=0 Delta=1 SpikeScroll=640 Ingame=1 bdis=1 n=0 repeat SeedRnd SpikesMade SetTileData(n,0,Rand(0,7)) SpikesMade=SpikesMade+1;SetTileData(n,1,SpikesMade) n=n+1 until n>10 return @Game CLS;ResetDraw ScoreShow=ScoreShow-((ScoreShow-Score)/5) if Abs(ScoreShow-Score)<1 then ScoreShow=Score if Button<0.5 then SuperCombo=0 dx=0 if Button>0.5 and bdis==0 then dx=Neg(-16) Starfield dx*0.5,0,2 SpikeScroll=SpikeScroll+dx SetRot 0 was=Abs(Sin(BounceRot) * (32*8)) BounceRot=BounceRot+(Bounce*Delta) is=Abs(Sin(BounceRot) * (32*8)) if is<was then BNoise=0 if is>was and BNoise==0 then PlaySFX("Beeper_Jingle_Up",1):BNoise=1 dead=0 SetFontSize 48 SetCol 180,255,180 Text ScreenWidth/2,32,Right("000000000000"+Floor(ScoreShow),12),1 ComboTick=ComboTick-2.5 if ComboTick<0 and Combo>0 thenPlaySFX("Beeper_2tone_Down"):Combo=0:SuperCombo=0 endif SetAlpha 0.5 if ComboTick>0 then Rect ScreenWidth/2,48,ComboTick*2,16,1 SetAlpha 1 SetCol 0,96,0 Rect 0,((ScreenHeight()-64)+32),ScreenWidth(),8 SetCol 80,40,0 Rect 0,((ScreenHeight()-64)+40),ScreenWidth(),100 SetCol 255,180,96 SetSize 2 DrawImg 100,((ScreenHeight()-64)-is),1,0; px=100;py=((ScreenHeight()-64)-is); if SpikeScroll<0-Gap n=0 Repeat // Draw Spikes h=GetTileData(n+1,0) SetTileData(n,0,h) h=GetTileData(n+1,1) SetTileData(n,1,h) n=n+1 Until n>10 SeedRnd SpikesMade SetTileData(10,0,Rand(0,7)) SpikesMade=SpikesMade+1;SetTileData(10,1,SpikesMade) SpikeScroll=SpikeScroll+Gap endif n=0 Repeat // Draw Spikes x=(Gap*n)+SpikeScroll h=GetTileData(n,0) y=(ScreenHeight()-64)-(h*32) DrawImg(x,y,0,h) h=GetTileData(n,1);SetFontSize 12 Text(x,ScreenHeight()-16,h,1) d=Pyth(x,y,px,py) if d<32 then dead=1 d=Pyth(x-32,y-32,px,py) if d<31 then dead=1 d=Pyth(x+32,y-32,px,py) if d<31 then dead=1 d=Pyth(x-32,y+32,px,py) if d<31 then dead=1 d=Pyth(x+32,y+32,px,py) if d<31 then dead=1 if x<68 and h>Passed then Passed=h Combo=Combo+1 ComboTick=160 SuperCombo=SuperCombo+1 Score=Score+(Combo*SuperCombo) pitch=((Combo)/20)+1 if SuperCombo<2 then PlaySFX("beeper_2tone_up",pitch) if SuperCombo>1 then PlaySFX("beeper_4tone_up",pitch) endif n=n+1 Until n>10 If dead==1 then bdis=1:Ingame=0:PlaySFX("Explode_Low_1"):PlaySFX("Explode_Low_2"):PlaySFX("Beeper_Fall") Return

Views 187, Upvotes 9  
Jse , Game!
New games every week!
Site credits : If you can see it, Jayenkai did it.
(c) Jayenkai 2023 and onwards, RSS feed

Blog - JSE - Familiar Avoidance - AGameAWeek