整理代码
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
local max,min=math.max,math.min
|
local max,min=math.max,math.min
|
||||||
local int,abs,rnd=math.floor,math.abs,math.random
|
local int,abs,rnd=math.floor,math.abs,math.random
|
||||||
local rem=table.remove
|
local rem=table.remove
|
||||||
|
local resume=coroutine.resume
|
||||||
|
local status=coroutine.status
|
||||||
|
|
||||||
local function updateLine(P)--Attacks, line pushing, cam moving
|
local function updateLine(P)--Attacks, line pushing, cam moving
|
||||||
local bf=P.atkBuffer
|
local bf=P.atkBuffer
|
||||||
@@ -94,8 +96,6 @@ local function updateFXs(P,dt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local updateTasks do--updateTasks(P)
|
local updateTasks do--updateTasks(P)
|
||||||
local resume=coroutine.resume
|
|
||||||
local status=coroutine.status
|
|
||||||
local assert=assert
|
local assert=assert
|
||||||
function updateTasks(P)
|
function updateTasks(P)
|
||||||
local L=P.tasks
|
local L=P.tasks
|
||||||
@@ -145,8 +145,8 @@ function update.alive(P,dt)
|
|||||||
local C=P.AI_keys
|
local C=P.AI_keys
|
||||||
P.AI_delay=P.AI_delay-1
|
P.AI_delay=P.AI_delay-1
|
||||||
if not C[1]then
|
if not C[1]then
|
||||||
if coroutine.status(P.AI_thread)=="suspended"then
|
if status(P.AI_thread)=="suspended"then
|
||||||
coroutine.resume(P.AI_thread)
|
resume(P.AI_thread)
|
||||||
end
|
end
|
||||||
elseif P.AI_delay<=0 then
|
elseif P.AI_delay<=0 then
|
||||||
P:pressKey(C[1])P:releaseKey(C[1])
|
P:pressKey(C[1])P:releaseKey(C[1])
|
||||||
|
|||||||
@@ -75,12 +75,10 @@ function scene.keyDown(k)
|
|||||||
if val~="0"then
|
if val~="0"then
|
||||||
val,reg,sym="0"
|
val,reg,sym="0"
|
||||||
else
|
else
|
||||||
scene.keyDown("quit")
|
SCN.back()
|
||||||
end
|
end
|
||||||
elseif k=="delete"then
|
elseif k=="delete"then
|
||||||
val="0"
|
val="0"
|
||||||
elseif k=="quit"then
|
|
||||||
SCN.back()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -113,7 +111,7 @@ scene.widgetList={
|
|||||||
WIDGET.newKey{name="/", x=450,y=600,w=90,fText="/",color="lB",font=50,code=pressKey"/"},
|
WIDGET.newKey{name="/", x=450,y=600,w=90,fText="/",color="lB",font=50,code=pressKey"/"},
|
||||||
WIDGET.newKey{name="<", x=550,y=300,w=90,fText="<",color="lR",font=50,code=pressKey"backspace"},
|
WIDGET.newKey{name="<", x=550,y=300,w=90,fText="<",color="lR",font=50,code=pressKey"backspace"},
|
||||||
WIDGET.newKey{name="=", x=550,y=400,w=90,fText="=",color="lY",font=50,code=pressKey"return"},
|
WIDGET.newKey{name="=", x=550,y=400,w=90,fText="=",color="lY",font=50,code=pressKey"return"},
|
||||||
WIDGET.newKey{name="back",x=1140,y=640,w=170,h=80,font=40,code=pressKey"quit"},
|
WIDGET.newKey{name="back",x=1140,y=640,w=170,h=80,font=40,code=backScene},
|
||||||
}
|
}
|
||||||
|
|
||||||
return scene
|
return scene
|
||||||
Reference in New Issue
Block a user