Documentation ¶
Index ¶
Constants ¶
View Source
const ( ScreenWidth = 960 ScreenHeight = 720 HalfScreenWidth = ScreenWidth / 2.0 HalfScreenHeight = ScreenHeight / 2.0 DeltaTime = 1.0 / 60.0 )
View Source
const ( FoodScore = 100 FoodLength = 16 RadiusFood = FoodLength / 2.0 RadiusEating = RadiusMouth + RadiusFood )
Food parameters
View Source
const ( SnakeSpeedInitial = 275 SnakeSpeedFinal = 250 SnakeLength = 240 SnakeWidth = 30 MouthAnimStartDistance = 120 RadiusSnake = SnakeWidth / 2.0 RadiusMouth = RadiusSnake * 0.625 )
Snake parameters
View Source
const ( ToleranceDefault = 2 //param.SnakeWidth / 16.0 ToleranceScreenEdge = RadiusSnake )
Snake collision tolerances must be an integer or false collisions will occur.
Variables ¶
View Source
var ( ColorBackground = color.RGBA{0, 48, 73, 255} // ~ Prussian Blue ColorSnake1 = color.RGBA{252, 191, 73, 255} // ~ Maximum Yellow Red ColorSnake2 = color.RGBA{247, 127, 0, 255} // ~ Orange ColorFood = color.RGBA{214, 40, 40, 255} // ~ Maximum Red ColorDebug = color.RGBA{234, 226, 183, 255} // ~ Lemon Meringue ColorScore = color.RGBA{247, 127, 0, 255} // ~ Orange )
Colors to be used in the drawing. Palette: https://coolors.co/palette/003049-d62828-f77f00-fcbf49-eae2b7
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.