From d7d0c83c9414a1c582b58cf980e115a0374211cf Mon Sep 17 00:00:00 2001 From: bizcochito Date: Fri, 11 Feb 2022 15:55:14 +0100 Subject: [PATCH] Changed the rope calculation (not working like i want anyway) --- data/scripts/entities/player.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/data/scripts/entities/player.lua b/data/scripts/entities/player.lua index e490357..7d01d6e 100644 --- a/data/scripts/entities/player.lua +++ b/data/scripts/entities/player.lua @@ -194,9 +194,12 @@ 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.hookedDistance then + self.canFall = false local hook_angle = GetAngleFromVector(hook[1],hook[2]) - self.pos.x = self.hookAnchor.x + self.hookedDistance * math.cos(-math.rad(180)+hook_angle) - self.pos.y = self.hookAnchor.y + self.hookedDistance * math.sin(-math.rad(180)+hook_angle) + --pos_x = self.hookAnchor.x + self.hookedDistance * math.cos(-math.rad(180)+hook_angle) + ((gravity ^ 2)/2) * math.sin(hook_angle) + --pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(-math.rad(180)+hook_angle) + ((gravity ^ 2)/2) * math.cos(hook_angle) + self.vel.x = self.vel.x + gravity * (-math.sin(hook_angle)) + self.vel.y = self.vel.y + gravity * math.cos(hook_angle) end end