-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toggleable infinite height in Infinite mode
- Loading branch information
1 parent
c7b8dd2
commit e917ee2
Showing
9 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
return { | ||
mesDisp=function(P) | ||
setFont(45) | ||
GC.mStr(("%d"):format(P.stat.atk),63,190) | ||
GC.mStr(("%.2f"):format(P.stat.atk/P.stat.row),63,310) | ||
mText(TEXTOBJ.atk,63,243) | ||
mText(TEXTOBJ.eff,63,363) | ||
|
||
local opacity=math.max(.4,MATH.expApproach(1,.36,2*(P.stat.time-P.modeData.lastChange))) | ||
if #P.field>15 then opacity=opacity*.7 end | ||
setFont(26) | ||
GC.setColor(1,1,1,opacity) | ||
GC.mStr(P.modeData.infHeight and text.infHeightOn or text.infHeightOff,300,80) | ||
setFont(20) | ||
GC.mStr(text.infHeightHint,300,120) | ||
end, | ||
task=function(P) | ||
P.modeData.infHeight=false | ||
P.modeData.lastChange=0 | ||
end, | ||
fkey1=function(P) | ||
P.modeData.infHeight=not P.modeData.infHeight | ||
P.modeData.lastChange=P.stat.time | ||
end, | ||
hook_drop=function(P) | ||
local heightTarget=P.field and #P.field+8 or 20 | ||
local env=P.gameEnv | ||
if P.modeData.infHeight then | ||
env.fieldH=math.max(env.fieldH,heightTarget) | ||
return | ||
end | ||
|
||
-- if not infHeight, then only decrease height | ||
if env.fieldH==20 then return end | ||
env.fieldH=math.max(20,math.min(env.fieldH,heightTarget)) | ||
end | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters