-- -- Corona Ads -- local coronaAds = require( "plugin.coronaAds" ) -- Substitute your own placement IDs when generated local bannerPlacement = "top-banner-320x50" local interstitialPlacement = "interstitial-1" -- Corona Ads listener function local function adListener( event ) -- Successful initialization of Corona Ads if ( event.phase == "init" ) then -- Show an ad coronaAds.show( bannerPlacement, false ) --coronaAds.show( interstitialPlacement, true ) end end -- Initialize Corona Ads (substitute your own API key when generated) coronaAds.init( "5223c2c3-cf81-4c43-ae41-2d4ed16552bc", adListener ) local widget = require("widget") local pizzeria = display.newImage("background.png") pizzeria.x=160 pizzeria.y=230 pizzeria:scale(1,1) local pizzas=0 local chefs=0 local cookers=0 local robot=0 local autostove=0 local musicswitch = 1 local backgroundMusic = audio.loadStream("b.mp3") local backgroundMusicChannel = audio.play( backgroundMusic, { channel=1, loops=-1, fadein=5000 } ) local textmaker = 0 local robotcost=display.newText("cost-70",150,300,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) robotcost:setFillColor(10,5,0) local chefcost=display.newText("cost-10",150,350,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) chefcost:setFillColor(0,0,0) local cookercost=display.newText("cost-25",300,350,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) cookercost:setFillColor(10,5,0) local autostovecost=display.newText("cost-250",220,440,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) autostovecost:setFillColor(10,5,0) local pizzatext = display.newText("pizzas:", 100, 200, display.contentWidth\*0.6, display.contentHeight \* 0.7, native.systemFont, 16) pizzatext:setFillColor( 0, 0, 0) local pizzacount = display.newText(pizzas,165,200,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) pizzacount:setFillColor(10,5,0) local chefstext = display.newText("chefs:",320,200,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) chefstext:setFillColor(0,10,10) local chefscount = display.newText(chefs,363,200,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) chefscount:setFillColor(10,5,0) local cooktext = display.newText("coookers:",320,230,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) cooktext:setFillColor(10,5,0) local cookcount = display.newText(cookers,390,230,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) cookcount:setFillColor(0,0,0) local robottext = display.newText("robot:",320,260,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) robottext:setFillColor(0,10,10) local robotcount = display.newText(robot,363,260,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) robotcount:setFillColor(10,5,0) local autostovetext = display.newText("autostove:",320,290,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) autostovetext:setFillColor(0,0,0) local autostovecount = display.newText(autostove,395,290,display.contentWidth\*0.7,display.contentHeight\*0.7,native.systemFont,16) autostovecount:setFillColor(10,5,0) local objective = display.newText("Reach 1000000000 pizzas",400,100) local function makeChefPizza() pizzas=pizzas+chefs+cookers\*2+robot\*3+4\*autostove pizzacount.text=pizzas end local function pizzamaker( event ) if (pizzas\>=10000000000) then winscreen=display.newImage("youwin.jpeg") winscreen:translate(150,200) winscreen:scale(1.5,3) end if ( "ended" == event.phase ) then pizzas=pizzas+1 pizzacount.text=pizzas end end local function addchef( event ) if("ended" == event.phase) then if(pizzas\>=10) then chefs=chefs+1 chefscount.text=chefs pizzas=pizzas-10 pizzacount.text=pizzas end end end local function addcooker( event ) if("ended"== event.phase) then if(pizzas\>=25) then cookers=cookers+1 cookcount.text=cookers pizzas=pizzas-25 pizzacount.text=pizzas end end end local function addrobot( event ) if("ended"==event.phase) then if(pizzas\>=70) then robot=robot+1 robotcount.text=robot pizzas=pizzas-70 pizzacount.text=pizzas end end end local function addautostove( event ) if("ended"==event.phase) then if(pizzas\>=250) then autostove=autostove+1 autostovecount.text=autostove pizzas=pizzas-250 pizzacount.text=pizzas end end end local pizzamaker = widget.newButton { left = 200, top = 400, defaultFile="button.jpeg", overFile = "button.jpeg", label = "Make Pizza", height = 50, width= 100, onEvent =pizzamaker } local addchef = widget.newButton { left = 60, top = 200, defaultFile="pizzachef.png", overFile="pizzachef.png", height = 70, width = 70, onEvent = addchef } local addcooker = widget.newButton { left = 150, top = 200, defaultFile="pizzacooker.jpeg", overFile="pizzacooker.jpeg", height=70, width=70, onEvent=addcooker } local addrobot = widget.newButton { left = 100, top = 100, defaultFile="robot.png", overFile="robot.png", height=70, width=70, onEvent=addrobot } local addautostove = widget.newButton { left = 100, top = 300, defaultFile="autostove.jpg", overFile="autostove.jpg", height=70, width=100, onEvent=addautostove } timer.performWithDelay(1000, makeChefPizza, -1)