Rewrite rope #11

Merged
pyrex merged 12 commits from rewrite_rope into main 2022-12-21 05:44:16 +00:00
Showing only changes of commit 709be93332 - Show all commits

View File

@ -589,7 +589,7 @@ function level:get_latch(dx,dy,px,py)
dx=dx1,dy=dy1, dx=dx1,dy=dy1,
ax_offset=dx1*0.5, ax_offset=dx1*0.5,
ay_offset=dy1*0.5, ay_offset=dy1*0.5,
mx=mx,my=my rec={mx=mx,my=my,px=mx*8,py=my*8},
} }
end end
end end
@ -778,7 +778,7 @@ function player:update()
if self.rope then if self.rope then
self.rope:update() self.rope:update()
self.rope:drag_dst(self.x+0.5,self.y+0.1) self.rope:drag_dst(self.x+self.px/8+0.5,self.y+self.py/8+0.1)
local tdx,tdy=self.rope:tug_orientxy() local tdx,tdy=self.rope:tug_orientxy()
if (tdx!=0) self.orientx=tdx if (tdx!=0) self.orientx=tdx
@ -922,10 +922,8 @@ function rope:update()
self.latch.rec.my+0.5+self.latch.ay_offset self.latch.rec.my+0.5+self.latch.ay_offset
) )
if #self.latch.rec.todo==0 then if self.latch.rec.dead==true then
if self.latch.rec.dead==true then self:destroy()
self:destroy()
end
end end
end end