Fixed particles, reduced light radius of visible light

This commit is contained in:
lustlion
2022-02-21 18:48:24 +01:00
parent a944192f67
commit f0bc02c418
5 changed files with 16 additions and 14 deletions

View File

@@ -199,6 +199,16 @@ function Player:DoPhysics()
if self.isHooked then
local hook = Vector(self.pos.x, self.pos.y, self.hookAnchor.x, self.hookAnchor.y)
if GetVectorValue(hook) > self.hookDistance then
local hook_angle = GetAngleFromVector(hook[1],hook[2])-math.rad(180)
if Keybind:CheckDown(Keybind.move.right) then
hook_angle = hook_angle - math.rad(0.05)
self.move_x = 0
end
if Keybind:CheckDown(Keybind.move.left) then
hook_angle = hook_angle + math.rad(0.05)
self.move_x = 0
end
local particle_data = {
animation = self.body,
sprite_tint = HEX2RGB("#fed100"),
@@ -209,15 +219,7 @@ function Player:DoPhysics()
}
}
Particle:New(self.pos.x,self.pos.y,particle_data)
local hook_angle = GetAngleFromVector(hook[1],hook[2])-math.rad(180)
if Keybind:CheckDown(Keybind.move.right) then
hook_angle = hook_angle - math.rad(0.05)
self.move_x = 0
end
if Keybind:CheckDown(Keybind.move.left) then
hook_angle = hook_angle + math.rad(0.05)
self.move_x = 0
end
local pos_x = self.hookAnchor.x + self.hookDistance * math.cos(hook_angle)
local pos_y = self.hookAnchor.y + self.hookDistance * math.sin(hook_angle)
self.vel.x = self.vel.x + pos_x - self.pos.x