0,]']>S}Wu@48d%qy)6o;]AʥYUUVl333UUPUUP[PPP[P5SUUDD@DD@K@{@KN@н ۽۽۽۽ DD@K@@@@+@@ 330C40DD0Gt0DD0$B0@@н ݻݷ{ݻа а е[ PWuе[ + NDDIDDANNе [۽UUU۽۽ """ """ +"{" {307s0330330833"" н }н { 00; ff`ff`ffffffffffffffffffffffwwpwwpwwwwwwwwwwwwwwwwwwwwww"" "" """""""""""""""""""""" UUPUUPUUUUUUUUUUUUUUUUUUUUUU UUUU ffpffpwwffffffffffffffffffff"" "" %%""""RRRR""""%%%%""""NBB/$$ @@ $B@    @@ @DDDD@@@   `dF@``` DD  ""   "  """ "PQRSTUVW ! # p ` ` ` P P @ 0   0012345678899:;<<==>>???????>>V 5  012P2034567788p9@999::: :;P;;`;0;;;;;; A00P000PP P^eP1111QQ 0PPP 0PPPpp6c`1 11 11Q1Q pp pp qq qq pp p]ep1 1 1 1 1 1  1PPPPppppp]e1 1 1 1MD1 @1  1QQQqqqqq]eQtPppPpp P p p P p p P p p P p p P P P P P Pt b  PIeppqqqHr(0.@H  .DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD/DDDDDDDDDDDDDDDDDDDDDD/BDDDDDDDDDDDDDDDDDDDDD/BDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDȌ Ȉ8DD Ȁ 8DD Ȁ ̀8DD Ȁ Ȁ8DD Ȁ Ȁ8DD8DD8DD 8DD8DD8DDȈȀȀ ̀8DD  8DD ̀8DD Ȁ 8DD ̀8DDDCDDDCDDD33DDDD43333333333333333DDDDDDDDD/BDDDDDDDDDDDDDDDDDDDDD/"DDDDDDDDDDDDDDDDDDDDRBDDDDDDDDDDDDDDDDDDD."/"DDDDDDDDDDDDDDDDDD"""."""DDDDDDDDDDDDDDDDDD.""""""""""%/BDDDDDDDDDDDDDDDD"""""%""""""""DDDDDDDDDDDDD.""""""""""""""/BDDDDDDDD"UU""R"""""""""!"""UUUUUUU."UU."""""""""%"""!"/RUUUUUU,"U"""r"$""""""""""RUUUUU."U"""""""""%"""""""RUUUUU.U"""""""""""""""R"UUUUU...U3""""""""""%""""""UUUUUU3#"""""""""""%3"UUUU U333333333333N^3"UUUUU31333333333DD^3"UUUUUU"""""U313331313I^3"UUUUUUUUU""U313111113111DD^3+UUUUUUUUUU%U31331113111A5"UUUUUUUUUUUU31111111111N5"UUUUUUUUUUUU33311333N5"UUUUUUUUUUUU3333333333333DD53"UUUUUUUUUUUU333333333333Z3"UUUUUUUUUUUU33333333333̬5"RUUUUUUUUUUU333133̪5"RUUUUUUUUUUU331333ʬ5"UUUUUUUUUUU33313ʬ5"""UUUUUUUUUU21333ʬ5""""UUUUUUUUU"3333ʬ:"_%""UUUUUUUUUU."2333333333<"UU""""UUUUUUUUU.","'"""R"""%_UU"""""UUUUUUUUU.""""""""""_UU%"""""RUUUUUUUUU.!""""""%_UUU%"""""UUUUUUUUUU_UUUUU""""r"UUUUUUUUUUUUUUUUUUUUUUUUU%"R"""RUUUUUUUUUUUUUUUUUUUUUUUU%""""UUUUUUUU&-- title: Crowd Sauce -- author: paulr(paul59/mr_happy) -- --Crowd Sauce -- --Made for the Low Rez game jam, August 2021 --Copyright Paul Robinson 2021. -- -- --In the near future, climate change and over-population have increased pressure on food supply, calling for drastic measures. In a cunning bid to solve both problems simultaneously, governments around the world are discretely funneling travelers from airport queues into a different kind of departure lounge! --As a processing facility operative, your task is simply to control the circular saw and ensure that the required ingredients for the world's favourite range of sauces is efficiently harvested. -- -- --Gameplay: -- --Move the circular saw left, right and between rows to hone in on the required 'ingredient'. --Complete as many recipes as you can before your shift ends (green timer bar). A short siren sounds when each recipe is complete - use the 'view recipe' key to see what's required next. -- -- --Tips: -- --The saw takes time to recharge (blue charge bar), especially after prolonged use but gets an instant recharge when a new recipe is issued. --Points are awarded for each completed recipe but don't worry about collateral damage - full use will be made of resources from anyone accidentally slaughtered! --Kill two birds with one stone, even if they're not both on the ingredients list. -- --Controls: --Keyboard 'Z' (Button 'A') to start game/operate saw --Up/Down/Left/Right to move saw --Keyboard 'X' (Button 'B') to view recipe --Keyboard'S' (Button 'Y') to silence the in-game music local rnd=math.random local abso=math.abs local DEBUG=false local OX,OY=88,36 local TRATE=0.005 local BLADESPEED=0.5 local TITLE,INIT,PLAY,GAMEOVER=111,222,333,444 local GRAV=0.6 local RED=2 local WHITE=12 local particles={} local state=TITLE local pop={} local t=0 local timer, charge local bladex,bladey local collected local recipeflag local bladeflag local musicflag=true local score local scoredisptime local recipes ={ {name='Low Rez', no=5, desc={'One Eye','or','Glasses'}, flag=0}, {name='Tomat-oh', no=4, desc={'Red','Hair'}, flag=1}, {name='G-Syrup', no=6, desc={'With Gold','Buttons','or','Chains'}, flag=2}, {name='Mansauce', no=6, desc={'A Beard'}, flag=3}, {name='Smacker', no=5, desc={'Red Lips'}, flag=4}, {name='BluBlood', no=8, desc={'Blue','Clothes'}, flag=5}, {name='Nut Job', no=3, desc={'A Bald','Head'}, flag=6}, {name='Blondie', no=3, desc={'Blond','Hair'}, flag=7} } local rec={} --current recipe function init() cls(1) --stop title music --start game music music() music(1) --create pops in 3 rows local i=1 for y=16,56,16 do for count=1,3 do pop[i]={} pop[i].y=y respawn(i) i=i+1 end -- end count end --end y bladex=28 bladey=32 recipeflag=false state=PLAY sfx(-1) rec=recipes[rnd(#recipes)] --set charge charge=56 --none collected so far collected=0 score=0 scoreflag=0 scoredisptime=0 --start shift timer timer=56 end function title() if musicflag then music(0) musicflag=false end cls(0) -- blank screen clip(OX,OY,64,64) spr(128,OX+0,OY+0,-1,1,0,0,8,8) if btnp(4) then state=INIT music() end end function gameover() rect(OX+2,OY+16,60,40,15) print('Shift Over',OX+5,OY+20,4) print('Sleep Well!',OX+3,OY+36,2) rect(0+OX,50+OY,64,6,15) print('Score:'..score,OX+4,OY+50,4) if btnp(4) then --stop game music, set for title music music() musicflag=true state=TITLE end end function respawn(n) --choose new head etc --start off screen to left or right, keep same y (ie maintain z order) pop[n].head=rnd(256,270) pop[n].body=rnd(272,286) pop[n].other=rnd(288,302) pop[n].off=2 if rnd()>0.5 then pop[n].x=64 pop[n].dx=-1 else pop[n].x=-8 pop[n].dx=1 end pop[n].hp=100 pop[n].spatter=false pop[n].t=rnd(8,16)--update time (frames) end function draw() --draw map(0,0,8,8,OX,OY) --show blade position first spr(287,OX+bladex,OY+bladey,0) spr(287,OX+bladex,OY+bladey-8) local bladef=false for i=1,#pop do --y coord is bottom left spr(pop[i].body,OX+pop[i].x,OY+pop[i].y-8,0) spr(pop[i].other,OX+pop[i].x,OY+pop[i].y-8,0) spr(pop[i].head,OX+pop[i].x,OY+pop[i].y-16+pop[i].off,0) if pop[i].hp <50 then spr(305,OX+pop[i].x, OY+pop[i].y-8,0) elseif pop[i].hp <100 then spr(304,OX+pop[i].x, OY+pop[i].y-8,0) end if DEBUG then end end -- draw blade if active if bladeflag then spr(271,OX+bladex, OY+bladey-8,0) end --draw time and charge bars line(OX+8,OY+58,OX+8+timer,OY+58,6) line(OX+8,OY+62,OX+8+charge,OY+62,9) --show score if required if t0 then particles.draw() end --show recipe if required if recipeflag then spr(137,OX+4,OY+4,-1,1,0,0,7,7) print(rec.name,getx(rec.name),OY+16,5)--OX+6,OY+16,5) local rem='Any '.. (rec.no-collected)..' with' print(rem,getx(rem),OY+24,5) --print each line of description local ty=OY+31 for i=1,#rec.desc do local tx=getx(rec.desc[i]) print(rec.desc[i],tx,ty,5) ty=ty+7 end end end function getx(str) width=print(str,0,-6) --print offscreen --return print position for centred text return((OX+32)-width/2) end function updatepop() for i=1,#pop do --movement if t%pop[i].t==1 then pop[i].x=pop[i].x+pop[i].dx if pop[i].x<-8 or pop[i].x>63 then respawn(i) end if pop[i].off==2 then -- head bounce pop[i].off=3 else pop[i].off=2 end end --check for damage if bladeflag then --6 is a bit tighter if abso(bladex-pop[i].x)<6 and bladey==pop[i].y then pop[i].hp=pop[i].hp-1 particles.add(bladex+4, bladey-4,4,RED) --died? if pop[i].hp<=0 then --sound and splatter sfx(1,'C-7') particles.add(bladex+4, bladey-4,30,RED) particles.add(bladex+4, bladey-4,30,WHITE) --score 50 for any kill, in addition to completing recipes --briefly show this score score=score+50 scoredisptime=t+125 --collect any flags from head/body/button collectflags(i) respawn(i) end end end end end function collectflags(i) local f=fget(pop[i].head, rec.flag) if f then collected=collected+1 end f=fget(pop[i].body, rec.flag) if f then collected=collected+1 end f=fget(pop[i].other, rec.flag) if f then collected=collected+1 end --check for recipe complete if collected==rec.no then --inc and display score/set timer score=score+rec.no*100 --scoreflag=true scoredisptime=t+250 -- display for 250 frames ~ 4sec --play sound sfx(2,'C-6',40,0) sfx(2,'D-6',40,1) sfx(2,'E-6',40,2) sfx(2,'F-6',40,3) --new recipe rec=recipes[rnd(#recipes)] --reset charge charge=56 --reset number collected collected=0 end end function input() if btn(2) and bladex>-4 then bladex=bladex-BLADESPEED end if btn(3) and bladex<60 then bladex=bladex+BLADESPEED end if btnp(1) and bladey<47 then bladey=bladey+16 end if btnp(0) and bladey>16 then bladey=bladey-16 end --saw'Z' if btn(4) and charge>0.5 then bladeflag=true sfx(0,'C-2',10) charge=charge-0.5 else bladeflag=false end --recipe hold down 'X' if btn(5) then recipeflag=true else recipeflag=false end --'S' (button Y) to silence game music if btnp(7) then music() end end -- add n particles around x,y function particles.add(x,y,n,c) local s=#particles for i=s+1,s+n do particles[i]={} particles[i].x = x+rnd(-2,2) particles[i].y = y-2-rnd(4) if rnd()<0.5 then particles[i].xacc=-rnd() else particles[i].xacc=rnd() end particles[i].yacc=-2*(rnd()+1) particles[i].color=c particles[i].die=time()+rnd(1000,1500) end end function particles.update() local t=time() local i=1 repeat particles[i].yacc=particles[i].yacc+GRAV particles[i].x=particles[i].x+particles[i].xacc particles[i].y=particles[i].y+particles[i].yacc if particles[i].x<0 or particles[i].x>63 or particles[i].x<0 or t>=particles[i].die then -- delete this one, replace with last local temp=particles[#particles] particles[i]=temp particles[#particles]=nil end i=i+1 until i>#particles end function particles.draw() for i=1,#particles do pix(OX+particles[i].x,OY+particles[i].y,particles[i].color) end end function TIC() if state==TITLE then title() elseif state==INIT then init() elseif state==GAMEOVER then gameover() else --frame counter t=t+1 --shift timer timer=timer-TRATE if timer<=0 then state=GAMEOVER end input() draw() updatepop() if #particles>0 then particles.update() end if charge<1 then charge=charge+0.02 elseif charge<56 then charge=charge+0.1 end end end