Update bug fixes

master
a327ex 2021-05-29 07:37:15 -03:00
parent ae2aa9b9b9
commit 9c39ae7e8c
4 changed files with 6 additions and 4 deletions

View File

@ -545,7 +545,7 @@ function Arena:quit()
trigger:after(2.5, function() trigger:after(2.5, function()
self.build_text = Text2{group = self.ui, x = 40, y = 20, force_update = true, lines = {{text = "[wavy_mid, fg]your build", font = pixul_font, alignment = 'center'}}} self.build_text = Text2{group = self.ui, x = 40, y = 20, force_update = true, lines = {{text = "[wavy_mid, fg]your build", font = pixul_font, alignment = 'center'}}}
for i, unit in ipairs(self.units) do for i, unit in ipairs(self.units) do
CharacterPart{group = self.ui, x = 40, y = 40 + (i-1)*19, character = unit.character, level = unit.level, force_update = true, parent = self} CharacterPart{group = self.ui, x = 40, y = 40 + (i-1)*19, character = unit.character, level = unit.level, force_update = true, cant_click = true, parent = self}
end end
if new_game_plus == 5 then if new_game_plus == 5 then

View File

@ -863,6 +863,8 @@ end
function CharacterPart:update(dt) function CharacterPart:update(dt)
self:update_game_object(dt) self:update_game_object(dt)
if self.cant_click then return end
if not self.parent:is(CharacterPart) then if not self.parent:is(CharacterPart) then
if input.m1.pressed and self.colliding_with_mouse then if input.m1.pressed and self.colliding_with_mouse then
self.grabbed = true self.grabbed = true

View File

@ -306,7 +306,7 @@ end
-- Higher frequency means jerkier movement, lower frequency means smoother movement -- Higher frequency means jerkier movement, lower frequency means smoother movement
-- camera:shake(10, 1, 120) -> shakes the camera with 10 intensity for 1 second and 120 frequency -- camera:shake(10, 1, 120) -> shakes the camera with 10 intensity for 1 second and 120 frequency
function Camera:shake(intensity, duration, frequency) function Camera:shake(intensity, duration, frequency)
if state.no_camera_shake then return end if state.no_screen_shake then return end
table.insert(self.shakes.x, Shake(intensity, 1000*(duration or 0), frequency or 60)) table.insert(self.shakes.x, Shake(intensity, 1000*(duration or 0), frequency or 60))
table.insert(self.shakes.y, Shake(intensity, 1000*(duration or 0), frequency or 60)) table.insert(self.shakes.y, Shake(intensity, 1000*(duration or 0), frequency or 60))
end end
@ -316,7 +316,7 @@ end
-- k and d are stiffness and damping spring values (see spring file for more) -- k and d are stiffness and damping spring values (see spring file for more)
-- camera:shake(10, math.pi/4) -> shakes the camera with 10 intensity diagonally -- camera:shake(10, math.pi/4) -> shakes the camera with 10 intensity diagonally
function Camera:spring_shake(intensity, r, k, d) function Camera:spring_shake(intensity, r, k, d)
if state.no_camera_shake then return end if state.no_screen_shake then return end
self.spring.x:pull(-intensity*math.cos(r or 0), k, d) self.spring.x:pull(-intensity*math.cos(r or 0), k, d)
self.spring.y:pull(-intensity*math.sin(r or 0), k, d) self.spring.y:pull(-intensity*math.sin(r or 0), k, d)
end end

View File

@ -1175,7 +1175,7 @@ function init()
main = Main() main = Main()
if run.level ~= 0 then if run.level and run.level > 0 then
main_song_instance = _G[random:table{'song1', 'song2', 'song3', 'song4', 'song5'}]:play{volume = 0.5} main_song_instance = _G[random:table{'song1', 'song2', 'song3', 'song4', 'song5'}]:play{volume = 0.5}
end end