naming convention for most stuff but not all

This commit is contained in:
lustlion
2022-03-04 23:28:30 +01:00
parent c978855711
commit cef2096577
29 changed files with 354 additions and 436 deletions

View File

@@ -4,7 +4,7 @@ DemoRecording = false
DemoAction = nil -- Table of actions
CurrentDemoFrame = nil
function Demo:Draw()
function Demo:draw()
if DemoRecording then
love.graphics.setColor(1,0,0,1)
elseif DemoPlayback then
@@ -13,18 +13,18 @@ function Demo:Draw()
love.graphics.rectangle("line",0,0,game.width ,game.height)
end
function Demo:PlaybackStart()
function Demo:startPlayback()
DemoPlayback = true
CurrentDemoFrame = 0
dofile("demos/play_demo.lua")
end
function Demo:PlaybackEnd()
function Demo:endPlayback()
DemoPlayback = false
DemoAction = nil
end
function Demo:RecordAction(action)
function Demo:recordAction(action)
if DemoRecording
and action ~= nil
then
@@ -32,7 +32,7 @@ function Demo:RecordAction(action)
end
end
function Demo:RecordStart()
function Demo:startRecord()
-- Make demo stuff
os.execute( "mkdir \"./demos\"" )
DemoFile = io.open("demos/play_demo.lua", "w+")
@@ -44,14 +44,14 @@ function Demo:RecordStart()
CurrentDemoFrame = 1
end
function Demo:RecordEnd()
function Demo:endRecord()
DemoFile:write("}\n}")
DemoFile:close()
DemoFile = nil
DemoRecording = false
end
function Demo:Step()
function Demo:step()
if DemoRecording then
if CurrentDemoFrame == 1 then
DemoFile:write("\t{")
@@ -59,7 +59,7 @@ function Demo:Step()
DemoFile:write("},\n\t{")
end
elseif DemoPlayback then
if DemoAction[CurrentDemoFrame + 1] == nil then Demo:PlaybackEnd() end
if DemoAction[CurrentDemoFrame + 1] == nil then Demo:endPlayback() end
end
CurrentDemoFrame = CurrentDemoFrame + 1
end