This repository was archived by the owner on Jan 9, 2025. It is now read-only.
File tree 1 file changed +4
-4
lines changed
app/src/main/kotlin/com/mukeshsolanki/snake/presentation/component
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,28 +25,28 @@ fun Controller(onDirectionChange: (Int) -> Unit) {
25
25
) {
26
26
AppIconButton (icon = Icons .Default .KeyboardArrowUp ) {
27
27
if (currentDirection.value != SnakeDirection .Down ) {
28
- onDirectionChange(SnakeDirection .Up )
28
+ onDirectionChange.invoke (SnakeDirection .Up )
29
29
currentDirection.value = SnakeDirection .Up
30
30
}
31
31
}
32
32
Row {
33
33
AppIconButton (icon = Icons .Default .KeyboardArrowLeft ) {
34
34
if (currentDirection.value != SnakeDirection .Right ) {
35
- onDirectionChange(SnakeDirection .Left )
35
+ onDirectionChange.invoke (SnakeDirection .Left )
36
36
currentDirection.value = SnakeDirection .Left
37
37
}
38
38
}
39
39
Spacer (modifier = buttonSize)
40
40
AppIconButton (icon = Icons .Default .KeyboardArrowRight ) {
41
41
if (currentDirection.value != SnakeDirection .Left ) {
42
- onDirectionChange(SnakeDirection .Right )
42
+ onDirectionChange.invoke (SnakeDirection .Right )
43
43
currentDirection.value = SnakeDirection .Right
44
44
}
45
45
}
46
46
}
47
47
AppIconButton (icon = Icons .Default .KeyboardArrowDown ) {
48
48
if (currentDirection.value != SnakeDirection .Up ) {
49
- onDirectionChange(SnakeDirection .Down )
49
+ onDirectionChange.invoke (SnakeDirection .Down )
50
50
currentDirection.value = SnakeDirection .Down
51
51
}
52
52
}
You can’t perform that action at this time.
0 commit comments