File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,19 @@ class App extends Component {
33
33
point : 0 ,
34
34
positionColor : 0
35
35
} ,
36
- ( ) => this . turnOn ( )
36
+ ( ) => this . turnOnSequence ( )
37
37
) ;
38
38
} ;
39
39
40
+ turnOnSequence = ( ) => {
41
+ let { listColors , positionColor } = this . state ;
42
+ console . log ( 'sequence' )
43
+ for ( var i = 0 ; i <= 5 ; i ++ ) {
44
+ console . log ( listColors [ i ] )
45
+ setTime ( ( ) => this . turnOn ( listColors [ i ] ) ) ;
46
+ }
47
+ }
48
+
40
49
turnOn = numColor => {
41
50
let { positionColor, listColors } = this . state ;
42
51
let turnColor = listColors [ positionColor ] ;
@@ -68,7 +77,7 @@ class App extends Component {
68
77
point : point + 1 ,
69
78
positionColor : positionColor + 1
70
79
} ,
71
- this . turnOn ( listColors [ positionColor + 1 ] )
80
+ ( ) => this . turnOn ( )
72
81
) ;
73
82
} else {
74
83
alert ( "It's wrong!!" ) ;
You can’t perform that action at this time.
0 commit comments