From b1cbe9548549a7005f56389aa709de664f2c361a Mon Sep 17 00:00:00 2001 From: Sacha Ligthert Date: Thu, 23 Nov 2023 22:47:12 +0100 Subject: [PATCH] Cleaning up comments --- apple.go | 10 ---------- design.md | 45 --------------------------------------------- game.go | 5 ----- 3 files changed, 60 deletions(-) delete mode 100644 design.md diff --git a/apple.go b/apple.go index 691655a..fdb8617 100644 --- a/apple.go +++ b/apple.go @@ -6,16 +6,6 @@ import ( "github.com/gdamore/tcell/v2" ) -// getFoodItem returns an emoji from a string used to represent food -// Takes no arguments, but returns an emoji/rune from a predefined string -// func getFoodItem() rune { -// var foods string = "πŸ΅πŸ±πŸ·πŸπŸ‡πŸΏπŸ¦‡πŸ“πŸ£πŸΈπŸ¦ŽπŸŽπŸ" -// foodsRune := []rune(foods) -// randomIndex := rand.Intn(len(foodsRune)) -// return foodsRune[randomIndex] -// } - -// func placeApple(snakex int, snakey int) Apple { func placeApple(snake *Snake) Apple { var x, y int var found bool diff --git a/design.md b/design.md deleted file mode 100644 index 1708318..0000000 --- a/design.md +++ /dev/null @@ -1,45 +0,0 @@ -# Snake -( Doing it my way. ) - -# The game -This follows the usual setting: -* Field -* Snake that cannot hurt itself -* Snake that gets wounded by the edges -* Score - -The game should look something like this: -``` -╔══════════════════════════════════════════════════════════════════════════════╗ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β”‚ β•‘ -β•‘ β”‚ β•‘ -β•‘ └───────o β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ 🍏 β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•‘ β•‘ -β•šβ•β•β•β•[ Score: 12309 ]══════════════════════════════════════════════════════════╝ -``` - -The minimum and maximum resolution of this game is `80` columes and `24` rows, Anything console larger will have no issues with this setup, anything smaller should pause the game with a message to resize. - -Scoring is done by having a counter _n_, every time an object is eaten, this counter is added to the score and raised by one. So after four apples the score would be (1+2+3+4) 10. - -The objects to eat are a series of emojis Snakes would eat IRL in nature. This is anything from fruits, nuts, frogs, etc. - -Snake cannot eat itself, nor eat the border. \ No newline at end of file diff --git a/game.go b/game.go index d8fe3a3..1e215ce 100644 --- a/game.go +++ b/game.go @@ -120,11 +120,6 @@ func keyboardProcessor(screen tcell.Screen, keypresses chan int, gamestate chan // Fetch the type, and check if any other actions are required. switch ev := ev.(type) { - //case *tcell.EventResize: - // x, y := screen.Size() - // drawBox(screen, 0, 0, x-1, y-1, style) - // updateScore(screen, style, snakex) - // screen.Sync() case *tcell.EventKey: if ev.Key() == tcell.KeyEscape || ev.Key() == tcell.KeyCtrlC { return