File tree 2 files changed +29
-3
lines changed
2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,20 @@ export enum FilledPipe {
26
26
'╋' = '╋' ,
27
27
}
28
28
29
+ export enum EmptyToFilledPipe {
30
+ '═' = '━' ,
31
+ '║' = '┃' ,
32
+ '╔' = '┏' ,
33
+ '╗' = '┓' ,
34
+ '╚' = '┗' ,
35
+ '╝' = '┛' ,
36
+ '╠' = '┣' ,
37
+ '╣' = '┫' ,
38
+ '╦' = '┳' ,
39
+ '╩' = '┻' ,
40
+ '╬' = '╋' ,
41
+ }
42
+
29
43
export enum DirectionPipe {
30
44
'△' = '△' ,
31
45
'▷' = '▷' ,
Original file line number Diff line number Diff line change 1
- import { Scene , Tag } from '../constants'
1
+ import { EmptyToFilledPipe , Scene , Tag } from '../constants'
2
2
import { checkSolution , rotatePipe } from '../helpers'
3
3
import { getLevel , hasLevel } from '../levels'
4
4
@@ -16,10 +16,22 @@ scene(Scene.game, (levelNumber: number) => {
16
16
} )
17
17
18
18
onClick ( Tag . pipe , ( pipe ) => {
19
- rotatePipe ( pipe )
19
+ if ( ! checkSolution ( level ) ) {
20
+ rotatePipe ( pipe )
21
+ }
20
22
21
23
if ( checkSolution ( level ) ) {
22
- go ( Scene . game , levelNumber + 1 )
24
+ level . get ( Tag . pipe ) . forEach ( ( pipe ) => {
25
+ pipe . use (
26
+ sprite (
27
+ EmptyToFilledPipe [ pipe . solution as keyof typeof EmptyToFilledPipe ] ,
28
+ ) ,
29
+ )
30
+ } )
31
+
32
+ wait ( 1 , ( ) => {
33
+ go ( Scene . game , levelNumber + 1 )
34
+ } )
23
35
}
24
36
} )
25
37
} )
You can’t perform that action at this time.
0 commit comments