Procházet zdrojové kódy

Cleaning up comments

Sacha Ligthert před 2 roky
rodič
revize
b1cbe95485
3 změnil soubory, kde provedl 0 přidání a 60 odebrání
  1. 0 10
      apple.go
  2. 0 45
      design.md
  3. 0 5
      game.go

+ 0 - 10
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

+ 0 - 45
design.md

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

+ 0 - 5
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