From fbfbf3c32b6dc07736dbf10600b7421e8d8c2eb8 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Mon, 19 Dec 2022 21:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E7=B1=BB=E6=96=B0=E5=A2=9Edr?= =?UTF-8?q?opPosition=E6=96=B9=E6=B3=95=E5=9C=A8=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E8=A7=A6=E5=8F=91=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E6=8E=89=E8=90=BD=E5=8A=A8=E7=94=BB=20=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=8E=A9=E5=AE=B6=E7=9A=84lose=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=8D=E4=BC=9A=E8=A7=A6=E5=8F=91=E6=8E=89=E8=90=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/player.lua | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/parts/player/player.lua b/parts/player/player.lua index c98bb8f3..2b0e27b6 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -600,6 +600,28 @@ do-- function Player:movePosition(x,y,size) TASK.new(task_movePosition,self,x,y,size or self.size) end end +do-- function Player:dropPosition(x,y,size) + local function task_dropPosition(self) + local vy=0 + local x,y,size=self.x,self.y,self.size + while true do + yield() + y=y+vy + vy=vy+.0626 + self:setPosition(x,y,size) + if y>2600 then + return true + end + end + end + local function check_player(obj,Ptar) + return obj.args[1]==Ptar + end + function Player:dropPosition() + TASK.removeTask_iterate(check_player,self) + TASK.new(task_dropPosition,self) + end +end local frameColorList={[0]=COLOR.Z,COLOR.lG,COLOR.lB,COLOR.lV,COLOR.lO} function Player:setFrameColor(c) @@ -2882,6 +2904,9 @@ function Player:lose(force) end if #PLY_ALIVE>0 then + self:dropPosition() + freshPlayerPosition('update') + local cur=PLY_ALIVE[1].group for i=2,#PLY_ALIVE do local g=PLY_ALIVE[i].group @@ -2902,9 +2927,6 @@ function Player:lose(force) end ::BREAK_notFinished:: end - local _,height=love.window.getMode() - self:movePosition(self.x,height+100) - freshPlayerPosition('update') end --------------------------<\Event>--------------------------