Skip to content

Commit

Permalink
添加一阶段教程的模式文件
Browse files Browse the repository at this point in the history
添加给按钮用的进模式的快捷方式函数
  • Loading branch information
MrZ626 committed Aug 14, 2022
1 parent 72e3ac1 commit 9a9fca2
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 27 deletions.
14 changes: 14 additions & 0 deletions assets/game/mode/mino/tutorial_1/basic.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return {
initialize=function()
GAME.newPlayer(1,'mino')
GAME.setMain(1)
end,
settings={mino={
readyDelay=0,
dropDelay=1e99,
lockDelay=1e99,
das=1e99,
holdSlot=0,
nextSlot=0,
}},
}
12 changes: 12 additions & 0 deletions assets/game/mode/mino/tutorial_1/sequence.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
initialize=function()
GAME.newPlayer(1,'mino')
GAME.setMain(1)
end,
settings={mino={
readyDelay=1000,
dropDelay=1e99,
lockDelay=1e99,
holdSlot=0,
}},
}
12 changes: 12 additions & 0 deletions assets/game/mode/mino/tutorial_1/stack.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
initialize=function()
GAME.newPlayer(1,'mino')
GAME.setMain(1)
end,
settings={mino={
readyDelay=1000,
dropDelay=1e99,
lockDelay=1e99,
holdSlot=0,
}},
}
5 changes: 5 additions & 0 deletions assets/gamefunc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ function getBgm()
return _bgmPlaying,_bgmMode
end

local modeObjMeta={__call=function(self,...) SCN.go('game_simp',nil,self.name) end}
function playMode(name)
return setmetatable({name=name},modeObjMeta)
end

function saveSettings()
FILE.save({
system=SETTINGS._system,
Expand Down
7 changes: 2 additions & 5 deletions assets/language/lang_en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ return {

musicroom_fullband='Full Band',

tutorial_1_move="Movement & Rotation",
tutorial_1_clear="Clearing",
tutorial_1_next="Next",
tutorial_1_hold="Hold",
tutorial_1_basic="Basic Rule",
tutorial_1_sequence="Next & Hold",
tutorial_1_stack="Stacking",
tutorial_1_techrash="Techrash",
}
7 changes: 2 additions & 5 deletions assets/language/lang_zh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ return {

musicroom_fullband='全轨道',

tutorial_1_move="移动和旋转",
tutorial_1_clear="消除",
tutorial_1_next="预览",
tutorial_1_hold="暂存",
tutorial_1_basic="基本规则",
tutorial_1_sequence="预览&暂存",
tutorial_1_stack="堆叠",
tutorial_1_techrash="消四",
}
6 changes: 3 additions & 3 deletions assets/scene/main_1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function scene.draw()
end

scene.widgetList={
WIDGET.new{type='button_fill',pos={.5,.5},x=-400,y=-20,w=360,h=140, color='R',text='Sprint', fontSize=40,cornerR=0,code=function() SCN.go('game_simp',nil,'mino/sprint') end},
WIDGET.new{type='button_fill',pos={.5,.5},x=0, y=-20,w=360,h=140, color='R',text='Marathon',fontSize=40,cornerR=0,code=function() SCN.go('game_simp',nil,'mino/marathon') end},
WIDGET.new{type='button_fill',pos={.5,.5},x=400, y=-20,w=360,h=140, color='R',text='Ultra', fontSize=40,cornerR=0,code=function() SCN.go('game_simp',nil,'mino/ultra') end},
WIDGET.new{type='button_fill',pos={.5,.5},x=-400,y=-20,w=360,h=140, color='R',text='Sprint', fontSize=40,cornerR=0,code=playMode'mino/sprint'},
WIDGET.new{type='button_fill',pos={.5,.5},x=0, y=-20,w=360,h=140, color='R',text='Marathon',fontSize=40,cornerR=0,code=playMode'mino/marathon'},
WIDGET.new{type='button_fill',pos={.5,.5},x=400, y=-20,w=360,h=140, color='R',text='Ultra', fontSize=40,cornerR=0,code=playMode'mino/ultra'},
WIDGET.new{type='button_fill',pos={.5,.5},x=-200,y=160,w=360,h=140, color='B',text='Tutorial',fontSize=40,cornerR=0,code=WIDGET.c_goScn'tutorial_1'},
WIDGET.new{type='button_fill',pos={.5,.5},x=200, y=160,w=360,h=140, color='Y',text='Sandbox', fontSize=40,cornerR=0,code=WIDGET.c_goScn'sandbox_1'},

Expand Down
10 changes: 5 additions & 5 deletions assets/scene/main_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='return' then
SCN.go('game_simp',nil,'mino_sprint')
SCN.go('game_simp',nil,'mino/sprint')
elseif key=='c' then
SCN.go('_console')
end
Expand All @@ -16,10 +16,10 @@ end
scene.widgetList={
WIDGET.new{type='button',pos={.5,.75}, x=-450,w=120,fontSize=80, text=CHAR.icon.language, code=WIDGET.c_goScn'setting_lang'},
WIDGET.new{type='button',pos={.5,.75}, x=-600,w=120,fontSize=90, text=CHAR.icon.music, code=WIDGET.c_goScn'musicroom'},
WIDGET.new{type='button',pos={.20,.2}, w=420,h=200, fontSize=50, text='MARATHON', code=function() SCN.go('game_simp',nil,'mino/marathon') end},
WIDGET.new{type='button',pos={.50,.2}, w=420,h=200, fontSize=70, text='SPRINT', code=function() SCN.go('game_simp',nil,'mino/sprint') end},
WIDGET.new{type='button',pos={.80,.2}, w=420,h=200, fontSize=50, text='ULTRA', code=function() SCN.go('game_simp',nil,'mino/ultra') end},
WIDGET.new{type='button',pos={.20,.45}, w=420,h=200, fontSize=70, text='BATTLE', code=function() SCN.go('game_simp',nil,'battle') end},
WIDGET.new{type='button',pos={.20,.2}, w=420,h=200, fontSize=50, text='MARATHON', code=playMode'mino/marathon'},
WIDGET.new{type='button',pos={.50,.2}, w=420,h=200, fontSize=70, text='SPRINT', code=playMode'mino/sprint'},
WIDGET.new{type='button',pos={.80,.2}, w=420,h=200, fontSize=50, text='ULTRA', code=playMode'mino/ultra'},
WIDGET.new{type='button',pos={.20,.45}, w=420,h=200, fontSize=70, text='BATTLE', code=playMode'battle'},
WIDGET.new{type='button_fill',pos={.50,.45}, w=420,h=200, fontSize=70, text='', code=NULL},
WIDGET.new{type='button_fill',pos={.80,.45}, w=420,h=200, fontSize=60, text='', code=NULL},
WIDGET.new{type='button',pos={.5,.75}, w=626,h=200, fontSize=100,text=LANG'main_test_setting',code=WIDGET.c_goScn'setting_test'},
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/setting_gem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ scene.widgetList={
WIDGET.new{type='button', pos={0,1},x=160,y=-80,w=160,h=80, text=CHAR.icon.keyboard,fontSize=60,code=function() SCN.go('keyset_list',nil,'gem') end},
WIDGET.new{type='button', pos={0,1},x=340,y=-80,w=160,h=80, text=LANG'keyset_touch',fontSize=45,code=WIDGET.c_goScn'keyset_touch'},
WIDGET.new{type='switch', pos={0,1},x=480,y=-80,h=50, text='',disp=TABLE.func_getVal(SETTINGS.system,'touchControl'),code=TABLE.func_revVal(SETTINGS.system,'touchControl')},
WIDGET.new{type='button', pos={1,1},x=-300,y=-80,w=160,h=80, text=LANG'keyset_test',fontSize=45,code=function() SCN.go('game_simp',nil,'gem/test') end},
WIDGET.new{type='button', pos={1,1},x=-300,y=-80,w=160,h=80, text=LANG'keyset_test',fontSize=45,code=playMode'gem/test'},

WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound='back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn},
}
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/setting_mino.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ scene.widgetList={
WIDGET.new{type='button', pos={0,1},x=160,y=-80,w=160,h=80, text=CHAR.icon.keyboard,fontSize=60,code=function() SCN.go('keyset_list',nil,'mino') end},
WIDGET.new{type='button', pos={0,1},x=340,y=-80,w=160,h=80, text=LANG'keyset_touch',fontSize=45,code=WIDGET.c_goScn'keyset_touch'},
WIDGET.new{type='switch', pos={0,1},x=480,y=-80,h=50, text='',disp=TABLE.func_getVal(SETTINGS.system,'touchControl'),code=TABLE.func_revVal(SETTINGS.system,'touchControl')},
WIDGET.new{type='button', pos={1,1},x=-300,y=-80,w=160,h=80, text=LANG'keyset_test',fontSize=45,code=function() SCN.go('game_simp',nil,'mino/test') end},
WIDGET.new{type='button', pos={1,1},x=-300,y=-80,w=160,h=80, text=LANG'keyset_test',fontSize=45,code=playMode'mino/test'},

WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound='back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn},
}
Expand Down
2 changes: 1 addition & 1 deletion assets/scene/setting_puyo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ scene.widgetList={
WIDGET.new{type='button', pos={0,1},x=160,y=-80,w=160,h=80, text=CHAR.icon.keyboard,fontSize=60,code=function() SCN.go('keyset_list',nil,'puyo') end},
WIDGET.new{type='button', pos={0,1},x=340,y=-80,w=160,h=80, text=LANG'keyset_touch',fontSize=45,code=WIDGET.c_goScn'keyset_touch'},
WIDGET.new{type='switch', pos={0,1},x=480,y=-80,h=50, text='',disp=TABLE.func_getVal(SETTINGS.system,'touchControl'),code=TABLE.func_revVal(SETTINGS.system,'touchControl')},
WIDGET.new{type='button', pos={1,1},x=-300,y=-80,w=160,h=80, text=LANG'keyset_test',fontSize=45,code=function() SCN.go('game_simp',nil,'puyo/test') end},
WIDGET.new{type='button', pos={1,1},x=-300,y=-80,w=160,h=80, text=LANG'keyset_test',fontSize=45,code=playMode'puyo/test'},

WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound='back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn},
}
Expand Down
15 changes: 9 additions & 6 deletions assets/scene/tutorial_1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ local scene={}

scene.widgetList={
WIDGET.new{type='button', pos={0,.5},x=210,y=-360,w=200,h=80,cornerR=0,sound='back', fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn},
WIDGET.new{type='button_fill',pos={.5,.5},x=-300,y=-160,w=540,h=150,color='B',fontSize=45,text=LANG'tutorial_1_move', cornerR=0, code=function() MES.new('warn',"你会的。") end},
WIDGET.new{type='button_fill',pos={.5,.5},x=300, y=-160,w=540,h=150,color='B',fontSize=45,text=LANG'tutorial_1_clear', cornerR=0, code=function() MES.new('warn',"你会的。") end},
WIDGET.new{type='button_fill',pos={.5,.5},x=-300,y=40, w=540,h=150,color='B',fontSize=45,text=LANG'tutorial_1_next', cornerR=0, code=function() MES.new('warn',"你会的。") end},
WIDGET.new{type='button_fill',pos={.5,.5},x=300, y=40, w=540,h=150,color='B',fontSize=45,text=LANG'tutorial_1_hold', cornerR=0, code=function() MES.new('warn',"你会的。") end},
WIDGET.new{type='button_fill',pos={.5,.5},x=-300,y=240, w=540,h=150,color='B',fontSize=45,text=LANG'tutorial_1_stack', cornerR=0, code=function() MES.new('warn',"你会的。") end},
WIDGET.new{type='button_fill',pos={.5,.5},x=300, y=240, w=540,h=150,color='B',fontSize=45,text=LANG'tutorial_1_techrash',cornerR=0, code=function() MES.new('warn',"你会的。") end},
WIDGET.new{type='button_fill',pos={.5,.5},y=-160,w=720,h=150,color='B',fontSize=50,text=LANG'tutorial_1_basic', cornerR=0,code=playMode'mino/tutorial_1/basic'},
WIDGET.new{type='button_fill',pos={.5,.5},y=40, w=720,h=150,color='B',fontSize=50,text=LANG'tutorial_1_sequence', cornerR=0,code=playMode'mino/tutorial_1/sequence'},
WIDGET.new{type='button_fill',pos={.5,.5},y=240, w=720,h=150,color='B',fontSize=50,text=LANG'tutorial_1_stack', cornerR=0,code=playMode'mino/tutorial_1/stack'},
-- WIDGET.new{type='button_fill',pos={.5,.5},x=-300,y=-160,w=540,h=150},
-- WIDGET.new{type='button_fill',pos={.5,.5},x=300, y=-160,w=540,h=150},
-- WIDGET.new{type='button_fill',pos={.5,.5},x=-300,y=40, w=540,h=150},
-- WIDGET.new{type='button_fill',pos={.5,.5},x=300, y=40, w=540,h=150},
-- WIDGET.new{type='button_fill',pos={.5,.5},x=-300,y=240, w=540,h=150},
-- WIDGET.new{type='button_fill',pos={.5,.5},x=300, y=240, w=540,h=150},
}
return scene

0 comments on commit 9a9fca2

Please sign in to comment.