naming convention for most stuff but not all
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user