Mozna naciskac ws i ik bez potwierdzania enterem
This commit is contained in:
parent
273bed1e15
commit
e36ce289d8
17
Pong.go
17
Pong.go
@ -119,10 +119,21 @@ func loop2() {
|
||||
switch {
|
||||
case bytes.Equal(c, []byte{3}):
|
||||
return
|
||||
case bytes.Equal(c, []byte{27, 91, 68}):
|
||||
fmt.Println("Left pressed")
|
||||
|
||||
case bytes.Equal(c, []byte{119}):
|
||||
fmt.Println("W pressed")
|
||||
|
||||
case bytes.Equal(c, []byte{115}):
|
||||
fmt.Println("S pressed")
|
||||
|
||||
case bytes.Equal(c, []byte{105}):
|
||||
fmt.Println("I pressed")
|
||||
|
||||
case bytes.Equal(c, []byte{107}):
|
||||
fmt.Println("K pressed")
|
||||
|
||||
default:
|
||||
PrintBoard()
|
||||
GameOver = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user