game

package
v0.0.0-...-67e2934 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyboardPitch

func KeyboardPitch(win *pixelgl.Window) float64

func NewSession

func NewSession(songID int, mode string, bpm int) ui.Scene

Types

type FinishScene

type FinishScene struct {
	SongID int
	Mode   string
	BPM    int
	Score  int
}

func (*FinishScene) Loop

func (fs *FinishScene) Loop(win *pixelgl.Window) ui.Scene
type MainMenu struct {
}
func (mm *MainMenu) Loop(win *pixelgl.Window) ui.Scene

type ModeMenu

type ModeMenu struct {
	SongID int
}

func (*ModeMenu) Loop

func (mm *ModeMenu) Loop(win *pixelgl.Window) ui.Scene

type Particle

type Particle struct {
	Sprite  int
	Time    float64
	MaxTime float64

	Source      pixel.Vec
	Destination pixel.Vec
	Frequency   float64
	Amplitude   float64
	Phase       float64
}

func (Particle) CurrentLocation

func (p Particle) CurrentLocation() pixel.Vec

type ParticleSystem

type ParticleSystem struct {
	Sprites   []*pixel.Sprite
	Particles []*Particle
	Batch     *pixel.Batch
}

func NewParticleSystem

func NewParticleSystem(filename string, width, height float64) *ParticleSystem

func (*ParticleSystem) Spawn

func (ps *ParticleSystem) Spawn(src, dst pixel.Vec)

func (*ParticleSystem) UpdateAndRender

func (ps *ParticleSystem) UpdateAndRender(win *pixelgl.Window, dt float64)

type Session

type Session struct {
	Song     []notes.SongNote
	SongID   int
	ModeName string
	BPM      int
	Played   []playedNote

	Score          float64
	PlayToStart    float64   // if this is < 1.0 game is not started yet
	Start          time.Time // time of start of the session
	Duration       float64   // session duration, progress of song in seconds
	SongDuration   float64   // Duration of the song in seconds
	SongCursor     int       // number of passsed notes in song
	LastUpdateTime time.Time // time of last update

	PointsParticles *ParticleSystem
	// contains filtered or unexported fields
}

func (Session) Finished

func (s Session) Finished() bool

func (*Session) Loop

func (s *Session) Loop(win *pixelgl.Window) ui.Scene

func (Session) RoundedScore

func (s Session) RoundedScore() int

type SongMenu

type SongMenu struct {
	Offset int
}

func NewSongMenu

func NewSongMenu() *SongMenu

func (*SongMenu) Loop

func (sm *SongMenu) Loop(win *pixelgl.Window) ui.Scene

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL