Mozna naciskac ws i ik bez potwierdzania enterem

This commit is contained in:
knmarcin 2018-11-18 18:37:41 +01:00
parent 273bed1e15
commit e36ce289d8
2 changed files with 14 additions and 3 deletions

BIN
Pong

Binary file not shown.

17
Pong.go
View File

@ -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
}
}
}