File tree Expand file tree Collapse file tree 4 files changed +12
-13
lines changed
Expand file tree Collapse file tree 4 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 1- export default ( ) => {
1+ export default ( scenes ) => {
22 // SECTOR_1:定数群
33 const ORB_COLORS = 5 ;
44 const [ BASE_SCORE , SCORE_EXPONENT ] = [ 100 , 1.5 ] ;
@@ -30,7 +30,7 @@ export default () => {
3030
3131 const endscene = ( err = null ) => {
3232 DIV_PUZ_DISPLAY . style . display = "none" ;
33- document . getElementById ( 'move_START' ) . onclick ( ) ;
33+ scenes . start ( ) ;
3434 if ( err ) throw err ;
3535 }
3636 const gameClear = ( ) => {
@@ -193,12 +193,11 @@ export default () => {
193193 update_display ( ) ;
194194 updateTarget ( ) ;
195195 }
196- const startgame = ( ) => {
197- const StageID = document . getElementById ( 'StageLink' ) . value ;
196+ const startgame = ( StageID ) => {
198197 if ( isNaN ( StageID ) ) endscene ( TypeError ( `GUARD! StageID ${ StageID } is NaN` ) ) ;
199198 const DATALINK = "../Data/Stage/" + StageID + ".js" ;
200199 DIV_PUZ_DISPLAY . style . display = "block" ;
201200 import ( DATALINK ) . then ( x => { DATA = object_copy ( x . default ) ; board_init ( ) } ) . catch ( endscene ) ;
202201 }
203- document . getElementById ( 'move_GAME' ) . onclick = startgame ;
202+ return startgame ;
204203}
Original file line number Diff line number Diff line change 11import START from "./start.js" ;
22import PUZZLE from "./puzzle.js" ;
3- START ( ) ;
4- PUZZLE ( ) ;
5- document . querySelector ( "#move_START" ) . click ( ) ;
3+ const scenes = { } ;
4+ scenes . start = START ( scenes ) ;
5+ scenes . puzzle = PUZZLE ( scenes ) ;
6+ Object . freeze ( scenes ) ;
7+ scenes . start ( ) ;
Original file line number Diff line number Diff line change 1- export default ( ) => {
1+ export default ( scenes ) => {
22 const DIV_STAGE_SELECT = document . querySelector ( "#stage_select" ) ;
33 const initer = ( ) => {
44 DIV_STAGE_SELECT . style . display = "block" ;
55 document . querySelector ( "#startbutton" ) . onclick = ( ) => {
66 DIV_STAGE_SELECT . style . display = "none" ;
7- document . querySelector ( "#move_GAME" ) . click ( ) ;
7+ scenes . puzzle ( document . getElementById ( 'StageLink' ) . value ) ;
88 }
99 }
10- document . querySelector ( "#move_START" ) . onclick = initer ;
10+ return initer ;
1111}
Original file line number Diff line number Diff line change 88 < link rel ="icon " href ="favicon.ico ">
99 </ head >
1010 < body >
11- < button type ="button " id ="move_START " class ="scene_mover "> TP_START</ button >
12- < button type ="button " id ="move_GAME " class ="scene_mover "> TP_GAME</ button >
1311 < div id ="stage_select ">
1412 < input type ="text " value ="1 " id ="StageLink ">
1513 < button type ="button " onclick ="" id ="startbutton "> GAME START</ button >
You can’t perform that action at this time.
0 commit comments