Use more annoying names
This commit is contained in:
parent
78d73a7920
commit
f2c3cfd891
12
snake.go
12
snake.go
@ -1,8 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gdamore/tcell/v2"
|
||||
"log"
|
||||
|
||||
"github.com/gdamore/tcell/v2"
|
||||
)
|
||||
|
||||
func drawText(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string) {
|
||||
@ -58,9 +59,8 @@ func drawBox(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// info, err := tcell.LookupTerminfo(os.Getenv("TERM"))
|
||||
defStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset)
|
||||
//boxStyle := tcell.StyleDefault.Foreground(tcell.ColorWhite).Background(tcell.ColorPurple)
|
||||
|
||||
defaultStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset)
|
||||
|
||||
var err error
|
||||
|
||||
@ -77,7 +77,7 @@ func main() {
|
||||
|
||||
screen.Clear()
|
||||
|
||||
drawBox(screen, 0, 0, x-1, y-1, defStyle, "There should be worms here!")
|
||||
drawBox(screen, 0, 0, x-1, y-1, defaultStyle, "There should be worms here!")
|
||||
|
||||
quit := func() {
|
||||
// You have to catch panics in a defer, clean up, and
|
||||
@ -97,7 +97,7 @@ func main() {
|
||||
switch ev := ev.(type) {
|
||||
case *tcell.EventResize:
|
||||
x, y := screen.Size()
|
||||
drawBox(screen, 0, 0, x-1, y-1, defStyle, "There should be worms here!")
|
||||
drawBox(screen, 0, 0, x-1, y-1, defaultStyle, "There should be worms here!")
|
||||
screen.Sync()
|
||||
case *tcell.EventKey:
|
||||
//fmt.Println("Key: ",ev.Rune())
|
||||
|
Loading…
x
Reference in New Issue
Block a user