gophengine

package
v0.0.0-...-eb1ee09 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlagSet *pflag.FlagSet

Functions

func ExtractAssets

func ExtractAssets() error

func InitFlags

func InitFlags() error

func InitGlobal

func InitGlobal() error

func Localize

func Localize(msgid string) string

Localize simply calls G.Localizer.MustLocalize .

func LocalizeTmpl

func LocalizeTmpl(msgid string, tmplData map[string]interface{}) string

Localize simply calls G.Localizer.MustLocalize with TemplateData.

func PlaySoundFromFS

func PlaySoundFromFS(fsys fs.FS, path string, vol float64) error

func Resample

func Resample(old beep.SampleRate, s beep.Streamer) beep.Streamer

Types

type BPMChangeEvent

type BPMChangeEvent struct {
	StepTime int
	SongTime float64
	Bpm      int
}

type Conductor

type Conductor struct {
	Bpm            int
	Crochet        float64
	StepCrochet    float64
	SongPosition   float64
	LastSongPos    float64
	Offset         float64
	SafeFrames     int
	SafeZoneOffset float64
	BPMChangeMap   []BPMChangeEvent
}

func NewConductor

func NewConductor(bpm int) *Conductor

func (*Conductor) ChangeBPM

func (c *Conductor) ChangeBPM(newBpm int)

func (*Conductor) MapBPMChanges

func (c *Conductor) MapBPMChanges(song *Song)

type Flasher

type Flasher struct {
	// contains filtered or unexported fields
}

func NewFlasher

func NewFlasher(dur float32) (*Flasher, error)

func (*Flasher) Draw

func (f *Flasher) Draw(img *ebiten.Image)

func (*Flasher) Flash

func (f *Flasher) Flash()

func (*Flasher) Update

func (f *Flasher) Update(dt float64) error

type Global

type Global struct {
	Rand           *rand.Rand
	Version        string
	FNFVersion     string
	ScreenWidth    int
	ScreenHeight   int
	Width          int
	Height         int
	OptionsConfig  *config.Config
	ProgressConfig *config.Config
	Conductor      *Conductor
	Localizer      *i18n.Localizer
	SampleRate     beep.SampleRate
	Mixer          *beep.Mixer

	/*
		This specifies the quality of the resampling process. Higher quality implies worse performance. Values below 1 or above 64 are invalid and Resample will panic. Here's a table for deciding which quality to pick.

		quality | use case
		--------|---------
		1       | very high performance, on-the-fly resampling, low quality
		3-4     | good performance, on-the-fly resampling, good quality
		6       | higher CPU usage, usually not suitable for on-the-fly resampling, very good quality
		>6      | even higher CPU usage, for offline resampling, very good quality

		Sane quality values are usually below 16. Higher values will consume too much CPU, giving negligible quality improvements.
	*/
	ResampleQuality int
}
var G *Global

type IntroText

type IntroText struct {
	// contains filtered or unexported fields
}

func NewIntroText

func NewIntroText() *IntroText

func (*IntroText) AddText

func (it *IntroText) AddText(text string)

func (*IntroText) CreateText

func (it *IntroText) CreateText(text ...string)

func (*IntroText) DeleteText

func (it *IntroText) DeleteText()

func (*IntroText) Draw

func (it *IntroText) Draw(img *ebiten.Image)

func (*IntroText) Update

func (it *IntroText) Update(dt float64) error

type MusicBeat

type MusicBeat struct {
	LastBeat float64
	LastStep float64

	CurBeat int
	CurStep int

	StepHitFunc func(int)
	BeatHitFunc func(int)
}

MusicBeat is basically MusicBeatState in vanilla FNF.

func NewMusicBeat

func NewMusicBeat() *MusicBeat

func (*MusicBeat) BeatHit

func (mb *MusicBeat) BeatHit()

func (*MusicBeat) StepHit

func (mb *MusicBeat) StepHit()

func (*MusicBeat) Update

func (mb *MusicBeat) Update()

func (*MusicBeat) UpdateBeat

func (mb *MusicBeat) UpdateBeat()

func (*MusicBeat) UpdateCurStep

func (mb *MusicBeat) UpdateCurStep()

type Section

type Section struct {
	SectionNotes   [][]interface{} `json:"sectionNotes"`
	LengthInSteps  int             `json:"lengthInSteps"`
	TypeOfSection  int             `json:"typeOfSection"`
	MustHitSection bool            `json:"mustHitSection"`
	Bpm            int             `json:"bpm"`
	ChangeBPM      bool            `json:"changeBPM"`
	AltAnim        bool            `json:"altAnim"`
}

type Song

type Song struct {
	Song        string    `json:"song"`
	Notes       []Section `json:"notes"`
	Bpm         int       `json:"bpm"`
	NeedsVoices bool      `json:"needsVoices"`
	Speed       float64   `json:"speed"`
	Player1     string    `json:"player1"`
	Player2     string    `json:"player2"`
	ValidScore  bool      `json:"validScore"`
}

func LoadSongFromJSON

func LoadSongFromJSON(rawJson []byte) (*Song, error)

type Sprite

type Sprite struct {
	X, Y           float64
	Img            *ebiten.Image
	Visible        bool
	AnimController *anim.AnimController
}

func NewSprite

func NewSprite(x, y float64) *Sprite

func (*Sprite) Draw

func (s *Sprite) Draw(img *ebiten.Image)

func (*Sprite) DrawImageOptions

func (s *Sprite) DrawImageOptions() *ebiten.DrawImageOptions

Jump to

Keyboard shortcuts

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