0,]']Б>Sоm‰џЭuЇ№p8Зd%qy)6o;]ЩAІіsяїєєє”АТVl†3 5 then circ(x+i,y+b,10, buttColor) else circ(x+i,y+b,10, 12) end end --Draw cherry if t%30 > 5 then cherryColor=3 else cherryColor=2 end for i = cigHealth, cigHealth+5,0.5 do b = math.sin((i+t/2)*0.1)*2.5 circ(7+i+x,y+b,10,cherryColor) end end function drawBackground() for i = 0, 10, 1 do b = math.sin(t/50+(i*0.01)) * 100 line(0,0,b+i*25,128,5) end for i = 0, 10, 1 do b = -math.sin(t/50+(i*0.01)) * 100 line(240,0,b-i*-25,128,5) end end function game1() if btn(1) then cigHealth = cigHealth - (1+(0.05*cigScore)) end -- burn cigarette with down if cigHealth < 0 then cigHealth = 0 end -- cap burning at 0 if btnp(4) then -- If submit cig (A button) is pressed if submitCig() then newCig() cigScore = cigScore + 1 end -- Regenerate cig if it's smoked enough if cigScore%4 == 0 then coachMessage = coachMessages[cigScore/4] end end if cigScore == 100 then alive = false end -- Draw game drawBackground() drawCig(80,85) rect(40,20,160,7*5,15) print(string.format(coachMessage),45,25,12) print(string.format("%d cigarettes enjoyed", cigScore), 45,45,4) t=t+1 end function newCig() cigHealth = 100 buttColor = math.random(1,16) while buttColor == 12 do buttColor = math.random(1,15) end end function submitCig() -- returns true if you can have a new one if cigHealth > 30 then coachMessage = "You barely smoked it!" sfx(7,"C-6", 60, 3) return false end if cigHealth < 0.1 then coachMessage = "You smoked the filter you \ndamn alcoholic!" takeDamage(1) sfx(7,"C-6", 60, 3) else sfx(5,"C-6", 60, 3) end return true end function takeDamage(a) lungHealth = lungHealth - a if lungHealth < 1 then alive = false end end function deathScreen() map(0,0,10,11,80,10,0) print(string.format("Smoked %d cigs\nin %d seconds", cigScore, math.floor(t/60)), 85,70,14) print(string.format(" You died!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nContratulations!"),70,8,4) if lungHealth == 0 then print(string.format("But you could have smoked more cigs\n if the filters didn't kill you!"),15,115,2) else print("What did you expect from smoking 100 cigs?",10,115,2) end end music(1) function TIC() rect(0,0,240,136,0) if btn(6) then reset() end if alive then game1() else deathScreen() end end