New games every week!
JSE - Squishy Balls Blog
23rd June 2021

A rather daft little game involving a bunch of balls.

-=-=-

// Squishy Balls v1.1 // by Jayenkai // Created 2021/6/22 Symbol 0,"1__0!23,0_023,4.0/2334/0?3,4_0,2332424@003,4_4403,2424_43,4_4,53,4_4,53,4_44550334_44500334_4550,334@550?34/550/4?5,0_045,"; Symbol 1,"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_0v.0,v.0_0_00v;.v0v;.v0_0_v;!v;!v0_0/v;@v;!v0_0!v;@v;!v0_0!v;?vv;v;,vv;v0_0!v;?vv;v;,vv;v0_0!v;?vv;v;,vv;v0_0!v;?vv;v;,vv;v0_0!v;@v;!v0_0!v;@v;!v0_0/v;!v;!v0_0_v;.v0v;.v0_0_00v.0,v."; Symbol 2,"1__0!v.0_0v@0/v_v0?v_v,0,v_v?00v_v?0v_v_v_v_v_v_v_v0v_v?00v_v?0,v_v,0?v_v0/v@0_0v."; Symbol 3,"1__0_0_0_0_0_0_0_0_0_0_0_0_0.v_v@;_;?vv;_;?v0v;_;.v00v;_;;v0.vv;@v0/v@"; Symbol 4,"0__0_0_0_0!v!0v0!v"; AntiAlias Off Tune="<C4r8>A+16G4r16A+4<C4r8>A+16G2r16|C4r8D8D+4D4C4r8D8D+2|C8C8C8C8C8C8C8C8D+8D+8D+8D+8>A+8A+8A+8A+8|C8C8C8C4C8C8C8D+8D+8D+8D+4>A+8A+8A+8|C16r8C16r8C16r8C16r8C16r16C16r16D+16r8D+16r8D+16r8>A+16r8A+16r16A+16r16|C16D+16C16<C8C8C16>C16D+16C16<C8C8C16>C16D+16C16<C8C8C16>C16D+16C16<C8r16C16C16|r1|[d]|r8G+4G+4G+4G+4G+4G+4G+4G+16G+16|C8G+16C16D8G+8C8G+16C16D8G+8C8G+16C16D8G+8C8D8D8G+8|r1|" Dim Ball(32,10) // 32 balls, 10 params #Const $Me=0 #Const $Alive=0 #Const $XPos=1 #Const $YPos=2 #Const $XSpd=3 #Const $YSpd=4 #Const $Dir=5 #Const $Col=7 Graphics 640,480,2 GameHandler("Squishy Balls","2 Balls|5 Balls|10 Balls") .StartGame Balls=2 if GameType==2 then Balls=5 if GameType==3 then Balls=10 ResetDraw z=ScreenWidth()*0.65 if ScreenHeight()<ScreenWidth() then z=ScreenHeight()*0.65 DrawOval ScreenWidth()/2,ScreenHeight()/2,z,z,64 z=z*0.5 SeedRnd 13+(GameType*100) For b=1 to Balls Ball(b,$Alive)=1 a=Rand(0,360) d=Rand(z,z*2) Ball(b,$XPos)=ScreenWidth()/2+Sin(a)*d Ball(b,$YPos)=ScreenHeight()/2-Cos(a)*d Ball(b,$XSpd)=0 Ball(b,$YSpd)=0 Ball(b,$Dir)=1 if Rand(0,10)<5 then Ball(b,$Dir)=-1 Ball(b,$Col)=Rand(0,7) Next Ball($Me,$Alive)=3 Ball($Me,$XPos)=ScreenWidth()/2 Ball($Me,$YPos)=ScreenHeight()/2 Ball($Me,$XSpd)=0 Ball($Me,$YSpd)=0 Ball($Me,$Dir)=1 Ball($Me,$Col)=8 Timer=120*60 // 120 Seconds * 60 FPS LastTick=120 SeedRnd JMTrackr 160,Tune$ return .Ingame CLS 0,60,0;ResetDraw SetCol 255,255,255,1 SetThick 4 z=ScreenWidth()*0.65 if ScreenHeight()<ScreenWidth() then z=ScreenHeight()*0.65 DrawOval ScreenWidth()/2,ScreenHeight()/2,z,z,64 z=z*0.5 happy=1 if GameOver==0 then Score=0 For b=0 to Balls if Ball(b,$Alive)>0 if b<Balls for b2=b+1 to Balls if Ball(b2,$Alive)>0 dx=Ball(b,$XPos)-Ball(b2,$XPos) dy=Ball(b,$YPos)-Ball(b2,$YPos) d=Pyth(dx,dy) if d<32 ang=ATan2(dx,-dy) spx=Abs(Ball(b,$XSpd))+Abs(Ball(b2,$XSpd)) spy=Abs(Ball(b,$YSpd))+Abs(Ball(b2,$YSpd)) spd=Sqr((spx*spx)+(spy*spy)) Ball(b,$XSpd)=Ball(b,$XSpd)+Sin(ang)*spd Ball(b,$YSpd)=Ball(b,$YSpd)-Cos(ang)*spd Ball(b2,$XSpd)=Ball(b2,$XSpd)+Sin(ang+180)*spd*0.45 Ball(b2,$YSpd)=Ball(b2,$YSpd)-Cos(ang+180)*spd*0.45 v=Limit(spd*0.1,0,1) if v>0.05 then PlaySFX("Sonniss_Squish_"+Rand(1,3),Rnd(0.7,1.3),v) endif endif next endif if GameOver==0 then Ball(b,$XPos)=Ball(b,$XPos)+Ball(b,$XSpd) Ball(b,$YPos)=Ball(b,$YPos)+Ball(b,$YSpd) Ball(b,$XSpd)=Ball(b,$XSpd)*0.985 Ball(b,$YSpd)=Ball(b,$YSpd)*0.985 v=Limit(Abs(Ball(b,$XSpd)*0.1),0,1) if Ball(b,$XPos)<8 then Ball(b,$XPos)=8;Ball(b,$XSpd)=Abs(Ball(b,$XSpd)*0.8);PlaySFX("Sonniss_Flop",Rnd(0.7,1.3),v) if Ball(b,$XPos)>ScreenWidth()-8 then Ball(b,$XPos)=ScreenWidth()-8;Ball(b,$XSpd)=0-Abs(Ball(b,$XSpd)*0.8);PlaySFX("Sonniss_Flop",Rnd(0.7,1.3),v) v=Limit(Abs(Ball(b,$YSpd)*0.1),0,1) if Ball(b,$YPos)<8 then Ball(b,$YPos)=8;Ball(b,$YSpd)=Abs(Ball(b,$YSpd)*0.8);PlaySFX("Sonniss_Flop",Rnd(0.7,1.3),v) if Ball(b,$YPos)>ScreenHeight()-8 then Ball(b,$YPos)=ScreenHeight()-8;Ball(b,$YSpd)=0-Abs(Ball(b,$YSpd)*0.8);PlaySFX("Sonniss_Flop",Rnd(0.7,1.3),v) endif if Ball(b,$XSpd)<0 then Ball(b,$Dir)=-1 if Ball(b,$XSpd)>0 then Ball(b,$Dir)=1 if b==$Me Ball(b,$XSpd)=Ball(b,$XSpd)+(Gamepad(ButtonRight)-Gamepad(ButtonLeft))*0.45 Ball(b,$YSpd)=Ball(b,$YSpd)+(Gamepad(ButtonDown)-Gamepad(ButtonUp))*0.45 endif SetSize 1.1,1.1;SetAlpha 0.2 dxb=((ScreenWidth()/2)-Ball(b,$XPos)) dyb=((ScreenHeight()/2)-Ball(b,$YPos)) d=Pyth(dxb,dyb) dx=dxb*0.025 dy=dyb*0.025 DrawImg Ball(b,$XPos)-dx,Ball(b,$YPos)-dy,2,0 SetSize 1,1;SetAlpha 1 DrawImg Ball(b,$XPos),Ball(b,$YPos),0,Ball(b,$Col) SetSize Ball(b,$Dir),1 DrawImg Ball(b,$XPos)+Ball(b,$Dir)*10,Ball(b,$YPos)-6,1 SetSize Ball(b,$Dir)*0.5,0.5 s=3 if d>z then s=4;happy=0 if s==3 and GameOver==0 then Score=Score+1 DrawImg Ball(b,$XPos)+Ball(b,$Dir)*6,Ball(b,$YPos)+5,s endif Next If Happy==1 and GameOver==0 Score=Secs EndGame "\o/yeay\o/" PlaySFX("Beeper_Fruit_Win") Endif ResetDraw SetFontSize z*0.5 if GameOver==0 then Timer=Timer-1 secs=Ceil(Timer/60) SetCol 60,150,225,0.3 If secs<10 then SetCol 225,160,70,0.3 if secs<0 then secs=0:EndGame "Time's Up" Text ScreenWidth()/2,ScreenHeight()/2,secs,1 if Secs<LastTick then LastTick=Secs SetFontSize 16;SetCol 180,255,180,0.6 Text ScreenWidth()/2,16,score,1 if GameOver>0 then JMStop Return


Squish the balls into each other, and try to round them all up inside the circle.
You have a time limit, so be quick, but also.. be careful. Because... Chaos!!!
Views 161, Upvotes 14  
Jse , Game
New games every week!
Site credits : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed 99

Blog - JSE - Squishy Balls - AGameAWeek