Compare commits

..

No commits in common. "feed65cf6d568ea261a590a8305adf47cc9de92e" and "97de68e34b4c4b796cc1607591cf1e063cdec14c" have entirely different histories.

5 changed files with 13 additions and 31 deletions

View File

@ -21,14 +21,8 @@ function Particle:new(x,y,particle_data)
o.sprite_flip = particle_data.sprite_flip or o.sprite_flip o.sprite_flip = particle_data.sprite_flip or o.sprite_flip
o.time = particle_data.time or nil o.time = particle_data.time or nil
if o.time ~= nil then if o.time ~= nil then o.time = o.time * game.framerate end
if particle_data.time_unit ~= nil
and particle_data.time_unit == "frames" then
o.time = o.time
else
o.time = o.time * game.framerate
end
end
o.timer = 0 o.timer = 0
o.vel = { o.vel = {

View File

@ -251,8 +251,7 @@ function Player:doPhysics()
animation_speed = 0, animation_speed = 0,
sprite_tint = hex2rgb("#fed100"), sprite_tint = hex2rgb("#fed100"),
sprite_alpha = 0.5, sprite_alpha = 0.5,
time = 4, time = 0.05,
time_unit = "frames",
sprite_flip = { sprite_flip = {
x = self.sprite_flip.x, x = self.sprite_flip.x,
y = self.sprite_flip.y y = self.sprite_flip.y
@ -327,10 +326,10 @@ function Player:handleAnimation()
elseif self.vel.y < 0 then elseif self.vel.y < 0 then
self.body = self.body:change(animation.nancy.jump) self.body = self.body:change(animation.nancy.jump)
self.mask = self.mask:change(self.mask_type.jump) self.mask = self.mask:change(self.mask_type.jump)
elseif self.vel.x + self.move_x ~= 0 and not self.is_hooked then elseif self.vel.x + self.move_x ~= 0 then
self.body = self.body:change(animation.nancy.run) self.body = self.body:change(animation.nancy.run)
self.mask = self.mask:change(self.mask_type.run) self.mask = self.mask:change(self.mask_type.run)
elseif not self.is_hooked then else
self.body = self.body:change(animation.nancy.idle) self.body = self.body:change(animation.nancy.idle)
self.mask = self.mask:change(self.mask_type.idle) self.mask = self.mask:change(self.mask_type.idle)
end end

View File

@ -49,8 +49,8 @@ end
function moveSpawns(x,y) function moveSpawns(x,y)
for _, spawn in pairs(LoadedObjects.Spawns) do for _, spawn in pairs(LoadedObjects.Spawns) do
if spawn.selected then if spawn.selected then
spawn.args[1] = math.floor((x/game.scale)+Camera.pos.x) spawn.args[1] = math.floor(x/game.scale)+Camera.pos.x
spawn.args[2] = math.floor((y/game.scale)+Camera.pos.y) spawn.args[2] = math.floor(y/game.scale)+Camera.pos.y
end end
end end
end end
@ -72,9 +72,6 @@ function promptSpawnNew()
for i=2, #result+1 do for i=2, #result+1 do
print("arg #"..i-1) print("arg #"..i-1)
args[i-1] = result[i] args[i-1] = result[i]
if i < 4 then
args[i-1] = math.floor(args[i-1])
end
end end
else else
args = {0,0} args = {0,0}

View File

@ -5,19 +5,13 @@ function addElement(self)
self.id = #UIElement self.id = #UIElement
end end
function drawTextBox(text,x,y,style) function drawTextBox(text,x,y,color,background_color)
local style = style or {} local color = color or {1,1,1,1}
local background_color = background_color or {0,0,0,1}
local c1, c2, c3, a = love.graphics.getColor() local c1, c2, c3, a = love.graphics.getColor()
local width = locale_font:getWidth(text) local width = locale_font:getWidth(text)
local height = locale_font:getHeight(text) local height = locale_font:getHeight(text)
local margin = 5
local color = style.color or {1,1,1,1}
local background_color = style.background_color or {0,0,0,1}
local margin = style.margin or 5
local rotation = style.rotation or 0
local sx = style.sx or 1
local sy = style.sy or style.sx
local lines = 1 local lines = 1
for i in text:gmatch("\n") do for i in text:gmatch("\n") do
lines = lines + 1 lines = lines + 1

View File

@ -62,10 +62,8 @@ function Prompt:draw()
self.name .. ": " .. self.input, self.name .. ": " .. self.input,
self.pos.x, self.pos.x,
self.pos.y, self.pos.y,
{ self.color,
color = self.color, self.background_color
background_color = self.background_color
}
) )
end end