Compare commits
3 Commits
97de68e34b
...
feed65cf6d
Author | SHA1 | Date | |
---|---|---|---|
|
feed65cf6d | ||
|
1883bcd78b | ||
|
3c1746d914 |
@ -21,8 +21,14 @@ 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 o.time = o.time * game.framerate end
|
if o.time ~= nil then
|
||||||
|
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 = {
|
||||||
|
@ -251,7 +251,8 @@ 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 = 0.05,
|
time = 4,
|
||||||
|
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
|
||||||
@ -326,10 +327,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 then
|
elseif self.vel.x + self.move_x ~= 0 and not self.is_hooked 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)
|
||||||
else
|
elseif not self.is_hooked then
|
||||||
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
|
||||||
|
@ -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,6 +72,9 @@ 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}
|
||||||
|
14
code/ui.lua
14
code/ui.lua
@ -5,13 +5,19 @@ function addElement(self)
|
|||||||
self.id = #UIElement
|
self.id = #UIElement
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawTextBox(text,x,y,color,background_color)
|
function drawTextBox(text,x,y,style)
|
||||||
local color = color or {1,1,1,1}
|
local style = style or {}
|
||||||
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
|
||||||
|
@ -62,8 +62,10 @@ 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,
|
{
|
||||||
self.background_color
|
color = self.color,
|
||||||
|
background_color = self.background_color
|
||||||
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user