naming convention for most stuff but not all
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Animation = {}
|
||||
|
||||
function Animation:New(anim_data)
|
||||
function Animation:new(anim_data)
|
||||
local o = {}
|
||||
|
||||
o.path = anim_data.path
|
||||
@@ -14,17 +14,17 @@ function Animation:New(anim_data)
|
||||
return o
|
||||
end
|
||||
|
||||
function Animation:ChangeTo(anim_data)
|
||||
function Animation:change(anim_data)
|
||||
if anim_data.path == self.path
|
||||
then
|
||||
return self
|
||||
else
|
||||
return Animation:New(anim_data)
|
||||
return Animation:new(anim_data)
|
||||
end
|
||||
end
|
||||
|
||||
-- to manually handle what frame
|
||||
function Animation:DrawFrame(frame, x, y, rotate, sx, sy)
|
||||
function Animation:drawFrame(frame, x, y, rotate, sx, sy)
|
||||
if frame > #self.frames then
|
||||
frame = #self.frames
|
||||
end
|
||||
@@ -43,7 +43,7 @@ function Animation:DrawFrame(frame, x, y, rotate, sx, sy)
|
||||
end
|
||||
|
||||
-- to linearly animate
|
||||
function Animation:Animate()
|
||||
function Animation:animate()
|
||||
if self.frames[self.frame] ~= 0 then
|
||||
-- try to animate
|
||||
self.subframe = self.subframe + current_dt
|
||||
@@ -61,7 +61,7 @@ function Animation:Animate()
|
||||
end
|
||||
|
||||
-- to draw the current frame
|
||||
function Animation:Draw(x, y, rotate, sx, sy)
|
||||
function Animation:draw(x, y, rotate, sx, sy)
|
||||
local x = x or 0
|
||||
local y = y or 0
|
||||
local sx = sx or 1
|
||||
|
||||
Reference in New Issue
Block a user