local auto_money = 0 local auto_money_lvl = 0 local auto_money_buy = 50
local bonus_money_lvl = 0 local bonus_money_buy = 35
local json_pip = require("json")
local bacg = display.newRect(0,0,1080,1920) local button = display.newRect(160,190,175,175) button:setFillColor(0,0.4,0.3)
local button_auto = display.newRect(70,400,111,111) button_auto:setFillColor(0,0.4,0.3)
local button_bonus = display.newRect(250,400,111,111) button_bonus:setFillColor(0,0.4,0.3)
------------------------txt local text = display.newText("Click", 161, 190, "consolas", 30) text:setFillColor(1,1,1)
local text1 = display.newText("Money:", 64, -19, "consolas", 30) text1:setFillColor(0,0.1,0.8)
local text2 = display.newText(money, 200, -16, "consolas", 30) text2:setFillColor(0,0.1,0.8)
local text3 = display.newText("Auto", 70, 370, "consolas", 30) text3:setFillColor(1,1,1)
local text4 = display.newText("click", 70, 400, "consolas", 30) text4:setFillColor(1,1,1)
local text5 = display.newText(auto_money_buy, 70, 437, "consolas", 30) text5:setFillColor(1,1,1)
local text6 = display.newText("Bonus", 250, 370, "consolas", 30) text6:setFillColor(1,1,1)
local text7 = display.newText("click", 250, 400, "consolas", 30) text7:setFillColor(1,1,1)
local text8 = display.newText(bonus_money_buy, 250, 437, "consolas", 30) text8:setFillColor(1,1,1) ------------------------txt end
local button_shadow = display.newRect(160,280,175,10) button_shadow:setFillColor(0,0.3,0.4) local button_shadow_auto = display.newRect(70,460,111,10) button_shadow_auto:setFillColor(0,0.3,0.4) local button_shadow_bonus = display.newRect(250,460,111,10) button_shadow_bonus:setFillColor(0,0.3,0.4)
local copyright = display.newText("KernelCoreSW 2018-2019", 163, 490, "consolas", 23) copyright:setFillColor(0,0.1,0.8)
local function flapBird (event) if(event.phase == "began") then ---lvl if(bonus_money_lvl == 0) then money = money + 1 end if(bonus_money_lvl == 1) then money = money + 2 end if(bonus_money_lvl == 2) then money = money + 3 end if(bonus_money_lvl == 3) then money = money + 4 end if(bonus_money_lvl == 4) then money = money + 5 end if(bonus_money_lvl == 5) then money = money + 6 end
if(bonus_money_lvl == 6) then money = money + 7 end if(bonus_money_lvl == 7) then money = money + 8 end if(bonus_money_lvl == 8) then money = money + 9 end if(bonus_money_lvl == 9) then money = money + 10 end if(bonus_money_lvl == 10) then money = money + 11 end text2.text = money end end local function flapBird_auto (event) if(event.phase == "began") then if(money >= auto_money_buy) then money = money - auto_money_buy auto_money_buy = auto_money_buy * 3 auto_money_lvl = auto_money_lvl + 1 end text2.text = money text5.text = auto_money_buy end end
local function flapBird_bonus (event) if(event.phase == "began") then if(money >= bonus_money_buy) then money = money - bonus_money_buy bonus_money_buy = bonus_money_buy * 3 bonus_money_lvl = bonus_money_lvl + 1 end text2.text = money text8.text = bonus_money_buy end end local function onUpdate (args)
if(auto_money > 40) then auto_money = 0 end ---------levels if(auto_money_lvl == 1) then if(auto_money == 40) then money = money + 1 text2.text = money end end if(auto_money_lvl == 2) then if(auto_money == 40) then money = money + 5 text2.text = money end end if(auto_money_lvl == 3) then if(auto_money == 40) then money = money + 10 text2.text = money end end if(auto_money_lvl == 4) then if(auto_money == 40) then money = money + 16 text2.text = money end end if(auto_money_lvl == 5) then if(auto_money == 40) then money = money + 21 text2.text = money end end if(auto_money_lvl == 6) then if(auto_money == 40) then money = money + 29 text2.text = money end end if(auto_money_lvl == 7) then if(auto_money == 40) then money = money + 36 text2.text = money end end if(auto_money_lvl == 8) then if(auto_money == 40) then money = money + 41 text2.text = money end end if(auto_money_lvl == 9) then if(auto_money == 40) then money = money + 56 text2.text = money end end if(auto_money_lvl == 10) then if(auto_money == 40) then money = money + 61 text2.text = money end end if(auto_money_lvl == 11) then if(auto_money == 40) then money = money + 76 text2.text = money end end
---------levels end auto_money = auto_money + 1
end local function load_settings(fileName) local path = system.pathForFile(fileName, system.ResourceDirectory) local contents = "" local myTable = {} local file = io.open(path, "r") if(file) then contents = file:read("*a") myTable = json.decode(contents) io.close(file) return myTable end return nil end local settings = loadSettings("settings.json") if(settings) then money = settings.money auto_money = settings.auto_money auto_money_buy = settings.auto_money_buy auto_money_lvl = settings.auto_money_lvl bonus_money_lvl = settings.bonus_money_lvl bonus_money_buy = settings.bonus_money_buy
end button:addEventListener("touch", flapBird) button_auto:addEventListener("touch", flapBird_auto) button_bonus:addEventListener("touch", flapBird_bonus) Runtime:addEventListener("enterFrame", onUpdate)
ДанилаСтержнев, Что за идиотизм? Хватит со своей ватой в темы лезть.
Добавлено (09 Октября 2019, 20:27) --------------------------------------------- Меня твой сарказм ваще не е**т. Для подобного шлака, есть соответствующая тема на форуме.
Недавно решил перейти с 1.4 на 2. Стоит ли тратить 1500 рубасиков на это? Есть ли у 2 студии какие-не будь преимущества перед GMS1.4? Если да, то какие?