File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const dest_sync = field_type => [1].includes(field_type);
3131const update_cell = ( y , x ) =>
3232[ PUZ_BOARD_BONE [ y ] [ x ] . querySelector ( "img.object" ) . src , PUZ_BOARD_BONE [ y ] [ x ] . querySelector ( "img.field" ) . src ] =
3333[ `Pictures/Orbs/${ DATA . board . obj [ y ] [ x ] [ 0 ] } .svg` , `Pictures/Fields/${ DATA . board . field [ y ] [ x ] [ 1 ] } .svg` ] ;
34+ const object_copy = x => JSON . parse ( JSON . stringify ( x ) ) ;
3435
3536function update_display ( ) {
3637 for ( let i = 0 ; i < DATA . size . Height ; i ++ ) for ( let j = 0 ; j < DATA . size . Width ; j ++ ) update_cell ( i , j ) ;
@@ -149,7 +150,7 @@ function chain_toggler(cell){
149150 adj_list = chain_yx = [ ] ;
150151 if ( DATA . target . hand <= 0 ) {
151152 alert ( `ゲームオーバー! スコアは${ DATA . target . score } でした!` ) ;
152- import ( DATALINK ) . then ( x => { DATA = x . default ; board_init ( ) } ) ;
153+ import ( DATALINK ) . then ( x => { DATA = object_copy ( x . default ) ; board_init ( ) } ) ;
153154 }
154155 } else if ( CELL_COLOR > 0 ) { //チェイン開始の処理
155156 chain_now = true ;
@@ -165,7 +166,7 @@ function board_init(){
165166 adj_list = chain_yx = [ ] ;
166167 update_display ( ) ;
167168}
168- import ( DATALINK ) . then ( x => { DATA = x . default ; board_init ( ) } ) ;
169+ import ( DATALINK ) . then ( x => { DATA = object_copy ( x . default ) ; board_init ( ) } ) ;
169170//1~:オーブ
170171//0:無空間
171172//~-1:妨害ブロック
You can’t perform that action at this time.
0 commit comments