整理代码
This commit is contained in:
@@ -380,6 +380,7 @@ function love.errorhandler(msg)
|
||||
local BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
|
||||
local needDraw=true
|
||||
local count=0
|
||||
local errorMsg=text.errorMsg or"An error has occurred and Techmino needs to restart.\nError info has been created, and you can send it to the author."
|
||||
return function()
|
||||
love.event.pump()
|
||||
for E,a,b in love.event.poll()do
|
||||
@@ -415,7 +416,7 @@ function love.errorhandler(msg)
|
||||
gc.replaceTransform(xOy)
|
||||
gc_draw(errScrShot,100,365,nil,512/errScrShot:getWidth(),288/errScrShot:getHeight())
|
||||
setFont(100)gc_print(":(",100,40,0,1.2)
|
||||
setFont(40)gc_printf(text.errorMsg,100,200,SCR.w0-100)
|
||||
setFont(40)gc_printf(errorMsg,100,200,SCR.w0-100)
|
||||
setFont(20)
|
||||
gc_print(SYSTEM.."-"..VERSION_NAME,100,660)
|
||||
gc_print("scene:"..SCN.cur,400,660)
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
local printf=love.graphics.printf
|
||||
local draw=love.graphics.draw
|
||||
local mDraw={}
|
||||
function mDraw.str(str,x,y)
|
||||
printf(str,x-626,y,1252,"center")
|
||||
end
|
||||
function mDraw.simpX(str,x,y)
|
||||
draw(str,x-str:getWidth()*.5,y)
|
||||
end
|
||||
function mDraw.simpY(str,x,y)
|
||||
draw(str,x,y-str:getHeight()*.5)
|
||||
end
|
||||
function mDraw.X(str,x,y,a,k)
|
||||
draw(str,x,y,a,k,nil,str:getWidth()*.5,0)
|
||||
end
|
||||
function mDraw.Y(str,x,y,a,k)
|
||||
draw(str,x,y,a,k,nil,0,str:getHeight()*.5)
|
||||
end
|
||||
function mDraw.draw(str,x,y,a,k)
|
||||
draw(str,x,y,a,k,nil,str:getWidth()*.5,str:getHeight()*.5)
|
||||
end
|
||||
function mDraw.str(str,x,y)printf(str,x-626,y,1252,"center")end
|
||||
function mDraw.simpX(str,x,y)draw(str,x-str:getWidth()*.5,y)end
|
||||
function mDraw.simpY(str,x,y)draw(str,x,y-str:getHeight()*.5)end
|
||||
function mDraw.X(str,x,y,a,k)draw(str,x,y,a,k,nil,str:getWidth()*.5,0)end
|
||||
function mDraw.Y(str,x,y,a,k)draw(str,x,y,a,k,nil,0,str:getHeight()*.5)end
|
||||
function mDraw.draw(str,x,y,a,k)draw(str,x,y,a,k,nil,str:getWidth()*.5,str:getHeight()*.5)end
|
||||
return mDraw
|
||||
4
main.lua
4
main.lua
@@ -54,6 +54,7 @@ THEME=(
|
||||
false
|
||||
)
|
||||
|
||||
--System setting
|
||||
math.randomseed(os.time()*626)
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
love.keyboard.setTextInput(false)
|
||||
@@ -204,6 +205,7 @@ SKIN.init{
|
||||
"coloredbone_mrz",
|
||||
"wtf",
|
||||
}
|
||||
|
||||
--Initialize sound libs
|
||||
SFX.init((function()
|
||||
local L={}
|
||||
@@ -236,6 +238,7 @@ VOC.init{
|
||||
"test","happy","doubt","sad","egg",
|
||||
"welcome_voc",
|
||||
}
|
||||
|
||||
--Initialize language lib
|
||||
LANG.init(
|
||||
{
|
||||
@@ -295,7 +298,6 @@ for _,v in next,fs.getDirectoryItems("parts/scenes")do
|
||||
LOG.print("Dangerous file : %SAVE%/parts/scenes/"..v)
|
||||
end
|
||||
end
|
||||
|
||||
LANG.set(SETTING.lang)
|
||||
|
||||
--Update data
|
||||
|
||||
16
parts/ai.lua
16
parts/ai.lua
@@ -1,11 +1,3 @@
|
||||
--[[
|
||||
HighestBlock
|
||||
BlockedCells
|
||||
Wells
|
||||
FilledLines
|
||||
4deepShape
|
||||
BlockedWells
|
||||
]]
|
||||
local int,ceil,min,abs,rnd,modf=math.floor,math.ceil,math.min,math.abs,math.random,math.modf
|
||||
local ins,rem=table.insert,table.remove
|
||||
local YIELD=YIELD
|
||||
@@ -92,6 +84,14 @@ if _CC then
|
||||
end
|
||||
end
|
||||
-------------------------------------------------9 Stack setup
|
||||
--[[Future:
|
||||
HighestBlock
|
||||
BlockedCells
|
||||
Wells
|
||||
FilledLines
|
||||
4deepShape
|
||||
BlockedWells
|
||||
]]
|
||||
local dirCount={1,1,3,3,3,0,1}
|
||||
local FCL={
|
||||
[1]={
|
||||
|
||||
Reference in New Issue
Block a user