Documentation ¶
Index ¶
- Constants
- Variables
- func CellFrom(x float32, cellSize float32, maxCells int) int
- func Center(dimensions WindowDimens) (x float32, y float32)
- func CollideWithSides(r1 rl.Rectangle, r2 rl.Rectangle) string
- func DecodeInto[T any](filePath string, source T) (T, error)
- func DrawHUD(textureAtlas TextureAtlas, windowDimens WindowDimens, lives uint32, ...)
- func DrawPlatforms(textureAtlas TextureAtlas, windowDimens WindowDimens, textureSize float32, ...)
- func DrawPlayer(player Player)
- func DrawTextInput(input TextInput)
- func ElasticEaseOut(time float32, begin float32, change float32, duration float32) float32
- func ExitGame(game *GameState) bool
- func HighestScore(highScores [5]PlayerScore, newScore PlayerScore) int
- func InSine(time float32, begin float32, change float32, duration float32) float32
- func MaxDamage(damage DamageCounter) bool
- func MkDir(rootDirectory string) func(string) string
- func NextFrame(animation LinearFrameAnimation) uint32
- func PlayerBoundingBox(player *Player) rl.Rectangle
- func RandRange(min int, max int) int
- func ResetGameState(game *GameState)
- func RunGame(game *GameState, delta float32)
- func UpdateSpawner(spawner *Spawner, mover func(*Item, float32) bool, delta float32)
- type Boundaries
- type Button
- type ButtonGroup
- type ButtonState
- type DamageCounter
- type Encoder
- type GameState
- type HitBox
- type Item
- type LinearFrameAnimation
- type Physics
- type Player
- type PlayerScore
- type ScoreBoard
- type Spawner
- type State
- type TextInput
- type TextureAtlas
- type TextureSheets
- type Timer
- type WindowDimens
Constants ¶
View Source
const ( NORMAL = ButtonState(0) HOVER = ButtonState(1) PRESSED = ButtonState(2) )
View Source
const ( TITLE State = 0 PAUSED State = 1 GAME State = 2 GAME_OVER State = 3 HIGH_SCORE_INPUT State = 4 HIGH_SCORES State = 5 TOTAL_PLATFORMS = 1280 / 64 GAME_OVER_FONT_SIZE float32 = 100. GAME_FONT_SIZE float32 = GAME_OVER_FONT_SIZE / 2. ONE_UP uint32 = 1000 PLAYER_HIT_MAX uint32 = 10 MAX_POINTS uint32 = 999999999 )
View Source
const HIGHEST_SCORE = 9999999999
Variables ¶
View Source
var MkAssetDir func(string) string = MkDir(assetDir)
Functions ¶
func Center ¶
func Center(dimensions WindowDimens) (x float32, y float32)
func DecodeInto ¶
func DrawHUD ¶
func DrawHUD(textureAtlas TextureAtlas, windowDimens WindowDimens, lives uint32, points uint32)
func DrawPlatforms ¶
func DrawPlatforms(textureAtlas TextureAtlas, windowDimens WindowDimens, textureSize float32, hitBoxes [20]HitBox)
func DrawPlayer ¶
func DrawPlayer(player Player)
func DrawTextInput ¶
func DrawTextInput(input TextInput)
func ElasticEaseOut ¶
func HighestScore ¶
func HighestScore(highScores [5]PlayerScore, newScore PlayerScore) int
func MaxDamage ¶
func MaxDamage(damage DamageCounter) bool
func NextFrame ¶
func NextFrame(animation LinearFrameAnimation) uint32
func PlayerBoundingBox ¶
func ResetGameState ¶
func ResetGameState(game *GameState)
Types ¶
type Boundaries ¶
type Boundaries struct {
// contains filtered or unexported fields
}
type ButtonGroup ¶
type ButtonGroup struct {
// contains filtered or unexported fields
}
type ButtonState ¶
type ButtonState uint8
type DamageCounter ¶
type DamageCounter struct {
// contains filtered or unexported fields
}
func DamageCalc ¶
func DamageCalc(damage DamageCounter, damageStep float32) DamageCounter
func NewDamageCounter ¶
func NewDamageCounter(duration float32) DamageCounter
type GameState ¶
type GameState struct {
// contains filtered or unexported fields
}
func NewGameState ¶
type LinearFrameAnimation ¶
type LinearFrameAnimation struct {
// contains filtered or unexported fields
}
func NewAnimation ¶
func NewAnimation(duration float32, loops bool, frames uint32) LinearFrameAnimation
func UpdateAnimation ¶
func UpdateAnimation(animation LinearFrameAnimation, dt float32) LinearFrameAnimation
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func UpdatePlayer ¶
type PlayerScore ¶
type ScoreBoard ¶
type ScoreBoard struct { FirstPosted bool `json:"firstPosted"` Scores [5]PlayerScore `json:"scores"` }
type TextInput ¶
type TextInput struct {
// contains filtered or unexported fields
}
func NewTextInput ¶
func UpdateTextInput ¶
type TextureAtlas ¶
type TextureAtlas struct {
// contains filtered or unexported fields
}
func NewTextureAtlas ¶
func NewTextureAtlas(windowSize [2]float32) TextureAtlas
func (*TextureAtlas) Release ¶
func (ta *TextureAtlas) Release()
type TextureSheets ¶
type TextureSheets struct {
// contains filtered or unexported fields
}
type WindowDimens ¶
type WindowDimens struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.