Понедельник, 28 Июля 2025, 22:23

Приветствую Вас Гость

[ Новые сообщения · Игроделы · Правила · Поиск ]
Результаты поиска
CoreДата: Воскресенье, 17 Ноября 2019, 12:31 | Сообщение # 401 | Тема: ошибка с сейвами... опять - corona SDK (решено)
заслуженный участник
Сейчас нет на сайте
drcrack,


Игры: justcore.itch.io
Сайт: justcore.space


Сообщение отредактировал Core - Воскресенье, 17 Ноября 2019, 12:33
CoreДата: Суббота, 16 Ноября 2019, 19:36 | Сообщение # 402 | Тема: ошибка с сейвами... опять - corona SDK (решено)
заслуженный участник
Сейчас нет на сайте
Цитата drcrack ()
точно?

да

Цитата drcrack ()
Если базовым каталогом является system.ResourceDirectory и сгенерированный путь указывает на несуществующий файл, возвращается nil, и в консоли Corona Simulator отображается предупреждающее сообщение.

файл на месте

Цитата Gent ()
Core , опечатка

local path_auto_maney_c = system.pathForFile ("auto_money_c.txt", system.ResourceDirectory)
local file0, errorString = io.open ( path_auto_money_c , "w")

респектую)


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Суббота, 16 Ноября 2019, 17:37 | Сообщение # 403 | Тема: ошибка с сейвами... опять - corona SDK (решено)
заслуженный участник
Сейчас нет на сайте
ничего не выходит. документацию читал.
Код
-----------------------------------------------------------
--
-- main.lua -- Clicer
--
-----------------------------------------------------------

-- Мой говно-код сдесь

local money = 0

local auto_money = 0
local auto_money_buy = 110
local auto_money_lvl = 0

local bonus_money_lvl = 0
local bonus_money_buy = 45

    local json = require("json")

local function loadSettings(fileName)

-- Path for the file to read
local path_money_c = system.pathForFile( "money_c.txt", system.ResourceDirectory )

-- Open the file handle
local file, errorString = io.open( path_money_c, "r" )

if not file then
    -- Error occurred; output the cause
    print( "File error: " .. errorString )
else
    -- Read data from file
    money = file:read( "*n" )
    io.close( file )
end

file = nil

    return nil
end
loadSettings();

function saveSetting(fileName)
local saveData = money
    local path_money_c = system.pathForFile( "money_c.txt", system.ResourceDirectory )
local file, errorString = io.open( path_money_c, "w" )
if not file then
    print( "File error: " .. errorString )
else
    file:write( saveData )
    io.close( file )
end

file = nil
    --local path_auto_maney_buy_c = system.pathForFile( "auto_money_buy_c.txt", system.ResourceDirectory )

    --local path_auto_maney_lvl_c = system.pathForFile( "auto_money_lvl_c.txt", system.ResourceDirectory )

    --local path_bonus_maney_lvl_c = system.pathForFile( "bonus_money_lvl_c.txt", system.ResourceDirectory )

    --local path_bonus_maney_buy_c = system.pathForFile( "bonus_money_buy_c.txt", system.ResourceDirectory )

    return nil
end
function saveSetting_auto_money(fileName)

  --local path_auto_maney_c = system.pathForFile( "auto_money_c.txt", system.ResourceDirectory )
    local saveData0 = auto_money
  local path_auto_maney_c = system.pathForFile( "auto_money_c.txt", system.ResourceDirectory )
    local file0, errorString = io.open( path_auto_money_c, "w" )
    if not file0 then
     print( "File error: " .. errorString )
    else
     file0:write( saveData0 )
     io.close( file0 )
    end
  
    file0 = nil

    return nil
end

local bacg = display.newRect(0,0,1080,1920)
bacg:setFillColor(0.799,0.799,0.799)

local bacg_m = display.newRect(0,0,1080,100)
bacg_m:setFillColor(0.599,0.599,0.599)

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)

--audio
   
local lvl_up_audio = audio.loadSound("audio/lvl_up.mp3")

--audio end

------------------------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.599,0.599,0.599)

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
    saveSetting(money_c)
  end
end
local function flapBird_auto (event)
  if(event.phase == "began") then
    if(money >= auto_money_buy) then
     audio.play(lvl_up_audio)
     
     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
    saveSetting(money_c)
    saveSetting_auto_money(auto_money_c)
    --saveSetting(auto_money_buy_c)
  end
end
local function flapBird_bonus (event)
  if(event.phase == "began") then
    if(money >= bonus_money_buy) then
     audio.play(lvl_up_audio)
     
     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
    saveSetting(money_c)
    --saveSetting(bonus_money_lvl_c)
    --saveSetting(bonus_money_buy_c)
  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

button:addEventListener("touch", flapBird)
button_auto:addEventListener("touch", flapBird_auto)
button_bonus:addEventListener("touch", flapBird_bonus)
Runtime:addEventListener("enterFrame", onUpdate)


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Суббота, 16 Ноября 2019, 16:23 | Сообщение # 404 | Тема: ошибка с сейвами... опять - corona SDK (решено)
заслуженный участник
Сейчас нет на сайте
Gent, Как это реализовать?

Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Суббота, 16 Ноября 2019, 14:38 | Сообщение # 405 | Тема: ошибка с сейвами... опять - corona SDK (решено)
заслуженный участник
Сейчас нет на сайте
Как это исправить? Прошу разъяснять подробнее, тк я очень тупой.


Игры: justcore.itch.io
Сайт: justcore.space


Сообщение отредактировал Core - Суббота, 16 Ноября 2019, 19:37
CoreДата: Суббота, 16 Ноября 2019, 10:25 | Сообщение # 406 | Тема: Space conquerors
заслуженный участник
Сейчас нет на сайте
HIGHGRATEFUL, Вы ведь тоже видите это?


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Суббота, 16 Ноября 2019, 10:16 | Сообщение # 407 | Тема: проблемы с сохранением переменной в txt файле coronaSDK
заслуженный участник
Сейчас нет на сайте
Gent, Куда тогда сейвить?
В system.DocumentsDirectory не находит файл


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Суббота, 16 Ноября 2019, 01:07 | Сообщение # 408 | Тема: проблемы с сохранением переменной в txt файле coronaSDK
заслуженный участник
Сейчас нет на сайте
по нажатию на кнопку click, должны набираться очки, но при нажатиях больше одного раза, переменная не выдает больше одного.
Как исправить? Скорее всего ошибка в функции loadSettions.

main.lua

money_c.txt
Код
0


Игры: justcore.itch.io
Сайт: justcore.space


Сообщение отредактировал Core - Суббота, 16 Ноября 2019, 01:08
CoreДата: Понедельник, 21 Октября 2019, 16:20 | Сообщение # 409 | Тема: создание платформера на corona sdk
заслуженный участник
Сейчас нет на сайте
подскажите статейки, видосики по созданию платформера на corona sdk
Cпрашиваю так-как сам ничего на эту тему не нашел


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Понедельник, 21 Октября 2019, 16:07 | Сообщение # 410 | Тема: lua - attempt to call global 'loadSettings' как исправить?
заслуженный участник
Сейчас нет на сайте
DivES, Решил, спасибо

Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Воскресенье, 20 Октября 2019, 14:53 | Сообщение # 411 | Тема: lua - attempt to call global 'loadSettings' как исправить?
заслуженный участник
Сейчас нет на сайте
теперь вот что
Цитата

main.lua 218 attempt to index global 'json' (a nil value) stack traceback


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Воскресенье, 20 Октября 2019, 13:45 | Сообщение # 412 | Тема: lua - attempt to call global 'loadSettings' как исправить?
заслуженный участник
Сейчас нет на сайте
При старте моего щидевера вылезает ошибка:
Цитата
main.lua 224 attempt to call global 'loadSettings' (a nil value) stack traceback

вот мой код:


Игры: justcore.itch.io
Сайт: justcore.space


Сообщение отредактировал Core - Воскресенье, 20 Октября 2019, 13:47
CoreДата: Четверг, 17 Октября 2019, 16:14 | Сообщение # 413 | Тема: Ищу художника на разовую работу с оплатой по договоренности.
заслуженный участник
Сейчас нет на сайте
Assser, Извращенец что ли? loli hentai смотришь?

Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Суббота, 12 Октября 2019, 14:55 | Сообщение # 414 | Тема: Ассоциации
заслуженный участник
Сейчас нет на сайте
Цитата TLT ()
Разум

ИИ


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Пятница, 11 Октября 2019, 20:19 | Сообщение # 415 | Тема: Ассоциации
заслуженный участник
Сейчас нет на сайте
Цитата TLT ()
детство

игры


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Пятница, 11 Октября 2019, 18:40 | Сообщение # 416 | Тема: Ассоциации
заслуженный участник
Сейчас нет на сайте
таз

Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Пятница, 11 Октября 2019, 13:50 | Сообщение # 417 | Тема: При редактировании темы вылезает дичь :/
заслуженный участник
Сейчас нет на сайте
После редактирования в теме на месте текста вылезает index.php


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Пятница, 11 Октября 2019, 13:37 | Сообщение # 418 | Тема: Физика платформы
заслуженный участник
Сейчас нет на сайте
спасибо)

Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Четверг, 10 Октября 2019, 21:51 | Сообщение # 419 | Тема: flatingo — блог разработчика игр
заслуженный участник
Сейчас нет на сайте
Цитата drcrack ()
мы видим говнокод и тыкаем автора носом, чтобы почувствовать свое превосходство — иначе зачем вообще в интернет заходить?

Лол, ты сделал мой день. :D


Игры: justcore.itch.io
Сайт: justcore.space
CoreДата: Среда, 09 Октября 2019, 20:31 | Сообщение # 420 | Тема: flatingo — блог разработчика игр
заслуженный участник
Сейчас нет на сайте

Он еще удивлялся, почему у него игра лагает)


Игры: justcore.itch.io
Сайт: justcore.space
Поиск:

Все права сохранены. GcUp.ru © 2008-2025 Рейтинг