Documentation ¶
Index ¶
- Constants
- Variables
- func Load(lg zap.Logger)
- func PauseBGM() error
- func PlayBGM(bgm BGM) error
- func PlaySE(se SE) error
- func ResumeBGM(bgm BGM) error
- func SetBGMVolume(volume float64)
- type BGM
- type BaseShape
- func (s *BaseShape) CenterCoord() *coord
- func (s *BaseShape) Draw(screen *ebiten.Image)
- func (s *BaseShape) Dst(i int) (x0, y0, x1, y1 int)
- func (s *BaseShape) Image() *ebiten.Image
- func (s *BaseShape) IsExpired() bool
- func (s *BaseShape) Len() int
- func (s *BaseShape) RgbaImage() *image.RGBA
- func (s *BaseShape) Scored() bool
- func (s *BaseShape) SetScore(b bool)
- func (s *BaseShape) Src(i int) (x0, y0, x1, y1 int)
- type Circle
- type Drawable
- type Loop
- type Pattern
- type PatternCollection
- type PlayerCharacter
- func (pc *PlayerCharacter) CheckCollision(sc *ShapeCollection)
- func (pc *PlayerCharacter) CheckScore(sc *ShapeCollection)
- func (pc *PlayerCharacter) Draw(screen *ebiten.Image)
- func (pc *PlayerCharacter) Dst(i int) (x0, y0, x1, y1 int)
- func (pc *PlayerCharacter) Image() *ebiten.Image
- func (pc *PlayerCharacter) Len() int
- func (pc *PlayerCharacter) RgbaImage() *image.RGBA
- func (pc *PlayerCharacter) Score() int
- func (pc *PlayerCharacter) Src(i int) (x0, y0, x1, y1 int)
- func (pc *PlayerCharacter) Update() error
- type SE
- type ShapeCollection
- type Spawn
- type SpawnGroup
- type Square
- type Stationary
- type Triangle
Constants ¶
View Source
const ( DefaultSpeed = 4 // delay between pattern spawning (milliseconds) PatternDelayMillis = 1000 // 'difficulty' constants for patterns? LowDifficulty = "LOW" MediumDifficulty = "MEDIUM" HighDifficulty = "HIGH" // Track constants UpperTrack = 1 LowerTrack = 2 // shape constants TriangleType = 1 CircleType = 2 SquareType = 3 // triangle movement state constants TriangleBeforeSwap = 1 TriangleDuringSwap = 2 TriangleAfterSwap = 3 // space (in pixels, I guess?) between the two tracks UpperTrackYAxis = 150 LowerTrackYAxis = 250 // x constants for sides and player PlayerX = 60 LeftSide = 50 RightSide = 375 // this should be screen width probably, not a constant 400 TrackLength = 400 // default angle values IN DEGREES!!!! (go math requires radians but degrees make more sense...) DefaultCircleAngleOfDescent float64 = 35 DefaultTriangleAngleOfDescent float64 = 45 JumpHeight = LowerTrackYAxis - UpperTrackYAxis JumpUpSpeed = 5 JumpDownSpeed = 3 StartingUpperSpeedLimit = 4 MinimumSpeed = 4 ScreenWidth = 400 ScreenHeight = 400 // difficulty unlock points MediumDifficultyUnlockSeconds = 60 HighDifficultyUnlockSeconds = 120 ColorSwapUnlockSeconds = 240 // difficulty lock points LowDifficultyLockSeconds = 150 MediumDifficultyLockSeconds = 180 )
Variables ¶
View Source
var ( Debug = false // slice of all shape types ShapeTypes = [...]int{TriangleType, CircleType, SquareType} // slice of all difficulties DifficultyTypes = [...]string{LowDifficulty, MediumDifficulty, HighDifficulty} // track mappings so you can use the track ID to get the track's position on the y axis TrackMappings = map[int]int{ UpperTrack: UpperTrackYAxis, LowerTrack: LowerTrackYAxis, } // subsequent track shows us what track comes after the one we're currently on. SubsequentTracks = map[int]int{ UpperTrack: LowerTrack, LowerTrack: UpperTrack, } PersonStandingImage *ebiten.Image PersonJumpingImage *ebiten.Image PlatformImage *ebiten.Image SquareImage *ebiten.Image TriangleImage *ebiten.Image CircleImage *ebiten.Image UpperTrackLine *ebiten.Image LowerTrackLine *ebiten.Image TitleImage *ebiten.Image EndImage *ebiten.Image UpperTrackOpts *ebiten.DrawImageOptions LowerTrackOpts *ebiten.DrawImageOptions ShapeImageMap map[int][]*ebiten.Image HitboxImageMap map[int]*ebiten.Image // color mapping constants DefaultSquareColorMap ebiten.ColorM DefaultCircleColorMap ebiten.ColorM DefaultTriangleColorMap ebiten.ColorM // shape to default color map ColorMappings map[int]ebiten.ColorM Font *truetype.Font // pattern collection GamePatternCollection *PatternCollection )
View Source
var (
AudioContext *audio.Context
)
Functions ¶
func SetBGMVolume ¶
func SetBGMVolume(volume float64)
Types ¶
type BaseShape ¶
type BaseShape struct { Track int Center *coord BaseSpeed int // contains filtered or unexported fields }
func NewBaseShape ¶
func (*BaseShape) CenterCoord ¶
func (s *BaseShape) CenterCoord() *coord
type Circle ¶
type Circle struct { *BaseShape // this is expected to be degrees. TravelAngle float64 DestinationTrack int }
func NewCircleNonStandardAngle ¶
if you want a different angle of descent, use this initializer
type Pattern ¶
type Pattern struct {
SpawnGroups []*SpawnGroup
}
func NewPattern ¶
func NewPattern(spawnGroups []*SpawnGroup) *Pattern
type PatternCollection ¶
func PatternCollectionFromJSON ¶
func PatternCollectionFromJSON(data []byte) *PatternCollection
type PlayerCharacter ¶
type PlayerCharacter struct { Center *coord Collided bool // contains filtered or unexported fields }
func NewPlayerCharacter ¶
func NewPlayerCharacter(name string, image *ebiten.Image, jimage *ebiten.Image, keyboardWrapper *keyboard.KeyboardWrapper) *PlayerCharacter
func (*PlayerCharacter) CheckCollision ¶
func (pc *PlayerCharacter) CheckCollision(sc *ShapeCollection)
func (*PlayerCharacter) CheckScore ¶
func (pc *PlayerCharacter) CheckScore(sc *ShapeCollection)
func (*PlayerCharacter) Draw ¶
func (pc *PlayerCharacter) Draw(screen *ebiten.Image)
func (*PlayerCharacter) Dst ¶
func (pc *PlayerCharacter) Dst(i int) (x0, y0, x1, y1 int)
func (*PlayerCharacter) Image ¶
func (pc *PlayerCharacter) Image() *ebiten.Image
func (*PlayerCharacter) Len ¶
func (pc *PlayerCharacter) Len() int
func (*PlayerCharacter) RgbaImage ¶
func (pc *PlayerCharacter) RgbaImage() *image.RGBA
func (*PlayerCharacter) Score ¶
func (pc *PlayerCharacter) Score() int
func (*PlayerCharacter) Src ¶
func (pc *PlayerCharacter) Src(i int) (x0, y0, x1, y1 int)
func (*PlayerCharacter) Update ¶
func (pc *PlayerCharacter) Update() error
type ShapeCollection ¶
type ShapeCollection struct { Stop bool // contains filtered or unexported fields }
func NewShapeCollection ¶
func NewShapeCollection() *ShapeCollection
func (*ShapeCollection) Add ¶
func (s *ShapeCollection) Add(g Drawable)
func (*ShapeCollection) Draw ¶
func (s *ShapeCollection) Draw(screen *ebiten.Image)
func (*ShapeCollection) Update ¶
func (s *ShapeCollection) Update()
type Spawn ¶
func NewSpawnDefaultSpeed ¶
type SpawnGroup ¶
type SpawnGroup struct { Spawns []*Spawn // how long since the start of the pattern to spawn this group of shapes SpawnTimeMillis int }
func NewSpawnGroup ¶
func NewSpawnGroup(spawns []*Spawn, spawnTimeMillis int) *SpawnGroup
type Stationary ¶
func (*Stationary) Draw ¶
func (s *Stationary) Draw(screen *ebiten.Image)
func (*Stationary) Dst ¶
func (s *Stationary) Dst(i int) (x0, y0, x1, y1 int)
func (*Stationary) Len ¶
func (s *Stationary) Len() int
func (*Stationary) Src ¶
func (s *Stationary) Src(i int) (x0, y0, x1, y1 int)
type Triangle ¶
type Triangle struct { *BaseShape // this is expected to be degrees. TravelAngle float64 DestinationTrack int // contains filtered or unexported fields }
func NewTriangle ¶
Click to show internal directories.
Click to hide internal directories.