Documentation ¶
Index ¶
- Constants
- func DefaultJudgments() []mode.Judgment
- func Fingers(keyCount int, scratchMode ScratchMode) []int
- type Asset
- type Bar
- type Chart
- type Config
- type KeyKind
- type Mods
- type Note
- type ScenePlay
- func (s ScenePlay) ChartHeader() mode.ChartHeader
- func (s ScenePlay) DebugString() string
- func (s ScenePlay) Draw(screen draws.Image)
- func (s ScenePlay) Finish() any
- func (s ScenePlay) IsPaused() bool
- func (s ScenePlay) Now() int32
- func (s *ScenePlay) Pause()
- func (s *ScenePlay) Resume()
- func (s *ScenePlay) SetMusicOffset(offset int32)
- func (s ScenePlay) SetMusicVolume(vol float64)
- func (s *ScenePlay) SetSpeedScale()
- func (s ScenePlay) Speed() float64
- func (s *ScenePlay) Update() any
- func (s ScenePlay) WindowTitle() string
- type Scorer
- type ScratchMode
Constants ¶
View Source
const ( Normal = iota Head Tail Body )
View Source
const ( Kool = iota Cool Good Miss )
Variables ¶
This section is empty.
Functions ¶
func DefaultJudgments ¶ added in v0.6.0
func Fingers ¶ added in v0.6.0
func Fingers(keyCount int, scratchMode ScratchMode) []int
Types ¶
type Asset ¶ added in v0.6.0
type Asset struct { // asset that are not affected by key count ScoreSprites [13]draws.Sprite // numbers with sign (. , %) ComboSprites [10]draws.Sprite JudgmentAnimations [4]draws.Animation DefaultHitSoundStreamer audios.StreamSeekCloser DefaultHitSoundFormat audios.Format // asset for a field FieldSprite draws.Sprite HintSprite draws.Sprite // bottom: hit position BarSprite draws.Sprite // bottom: hit position // asset for each key KeyKindNoteTypeAnimations [][4]draws.Animation // bottom: hit position KeySprites [][2]draws.Sprite // top: hit position KeyLightingSprites []draws.Sprite KeyLightingColors []color.Color HitLightingAnimations []draws.Animation HoldLightingAnimations []draws.Animation }
All names of fields in Asset ends with their types.
type Chart ¶
type Chart struct { mode.ChartHeader KeyCount int // same with ChartHeader.SubMode Dynamics []*mode.Dynamic Notes []*Note Bars []*Bar }
func (Chart) Difficulties ¶
type Config ¶ added in v0.6.0
type Config struct { // settings exported from parent configuration ScreenSize *draws.Vector2 MusicVolume *float64 SoundVolume *float64 MusicOffset *int32 // logic-affecting settings Mods Mods KeySettings map[int][]string SpeedScale float64 HitPosition float64 TailExtraDuration float64 // others KeyKindWidths [4]float64 FieldWidthScales map[int]float64 NoteHeigth float64 // Applies to all types of notes. FieldPosition float64 ComboPosition float64 JudgmentPosition float64 ScratchColor color.NRGBA FieldOpacity float64 KeyKindLightingColors [4]color.NRGBA HitLightingOpacity float64 HoldLightingOpacity float64 ScoreSpriteScale float64 ComboSpriteScale float64 ComboDigitGap float64 JudgmentSpriteScale float64 HintHeight float64 LightingSpriteScale float64 }
func (Config) FieldWidth ¶ added in v0.6.0
func (cfg Config) FieldWidth(keyCount int, sm ScratchMode) float64
func (Config) KeyWidths ¶ added in v0.6.0
func (cfg Config) KeyWidths(keyCount int, sm ScratchMode) []float64
func (Config) KeyXs ¶ added in v0.6.0
func (cfg Config) KeyXs(keyCount int, sm ScratchMode) []float64
KeyXs returns centered x positions.
func (Config) NoteExposureDuration ¶ added in v0.6.0
NoteExposureDuration returns time in milliseconds that cursor takes to move 1 logical pixel.
type KeyKind ¶ added in v0.6.0
type KeyKind int
func KeyKinds ¶ added in v0.6.0
func KeyKinds(keyCount int, scratchMode ScratchMode) []KeyKind
I'm personally proud of this code.
type Note ¶
type ScenePlay ¶
type ScenePlay struct { *Config *Asset Mods *Chart mode.Timer *input.Keyboard input.KeyboardReader // for replay audios.SoundMap Scorer Dynamic *mode.Dynamic // Todo: Dynamic -> dynamic // contains filtered or unexported fields }
func NewScenePlay ¶
func NewScenePlay(cfg *Config, assets map[int]*Asset, fsys fs.FS, name string, replay *osr.Format) (s *ScenePlay, err error)
Todo: initialize s.Asset with s.KeyCount, then set s.Chart.
func (ScenePlay) ChartHeader ¶ added in v0.6.0
func (s ScenePlay) ChartHeader() mode.ChartHeader
func (ScenePlay) DebugString ¶ added in v0.6.0
func (ScenePlay) Draw ¶
The name 'sprite' is used for local variable of Sprite instead of 's' to avoid confusion with the local variable of Scene.
func (*ScenePlay) SetMusicOffset ¶ added in v0.6.0
func (ScenePlay) SetMusicVolume ¶ added in v0.6.0
func (*ScenePlay) SetSpeedScale ¶ added in v0.6.0
func (s *ScenePlay) SetSpeedScale()
Need to re-calculate positions when Speed has changed.
func (ScenePlay) WindowTitle ¶ added in v0.6.0
type Scorer ¶ added in v0.6.0
type Scorer struct { Combo int Score float64 JudgmentCounts []int // contains filtered or unexported fields }
Todo: FlowPoint
type ScratchMode ¶ added in v0.6.0
type ScratchMode int
const ( NoScratch ScratchMode = iota LeftScratch RightScratch )
Click to show internal directories.
Click to hide internal directories.