core

package
v0.0.0-...-2489ded Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockWidth0 = 0.2
	BlockWidth1 = 0.4

	BlockHeight0 = 0.2
	BlockHeight1 = 0.4

	BlockPosY0 = 0.
	BlockPosY1 = 0.4
)
View Source
const (
	RoadWidth  = 1.
	RoadHeight = 1.
	RoadDepth  = 4.

	InvulnTime = 20

	BlockDefaultSpeed = 0.075

	HeartChance        = 0.05 // Let's keep it possible to farm them
	GoldenHeartChance  = 0.25
	BlockHarderChance  = 1. / 2.
	BlockHarder2Chance = 1. / 4.
)
View Source
const (
	DefaultPlayerRadius = 0.0425

	DefaultJumpDuration = 0.5 * logic.TPS
)
View Source
const (
	MaxPlayerSpeed     = 0.02
	MaxHeartContainers = 10
)
View Source
const (
	DefaultSpeed = 2.0
	MaxSpeed     = 4.0
)

Variables

This section is empty.

Functions

func DebugLines

func DebugLines() float32

func PerfectStep

func PerfectStep() bool

func UpdateGlobalSettings

func UpdateGlobalSettings()

func XYZToGraphics

func XYZToGraphics(x, y, z float64) (float64, float64, float64)

Hacky function

Types

type Action

type Action byte
const (
	ActionNone Action = iota
	ActionJump
	ActionDash
)

type Block

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

func (*Block) GetHeight

func (b *Block) GetHeight() float64

func (*Block) GetKind

func (b *Block) GetKind() BlockKind

func (*Block) GetWidth

func (b *Block) GetWidth() float64

func (*Block) GetX

func (b *Block) GetX() float64

func (*Block) GetY

func (b *Block) GetY() float64

func (*Block) GetZ

func (b *Block) GetZ() float64

type BlockKind

type BlockKind float32
const (
	BlockKindRegular     BlockKind = 4
	BlockKindHarder      BlockKind = 5
	BlockKindHarder2     BlockKind = 6
	BlockKindHeart       BlockKind = 7
	BlockKindGoldenHeart BlockKind = 8
)

type BlockSettings

type BlockSettings struct {
	MinBlocksSpawn        int
	MaxBlocksSpawn        int
	SpawnDistanceInterval uint64
	SpawnDepth            float64
	Regular               bool
	Harder                bool
	Harder2               bool
	Heart                 bool
	GoldenHeart           bool
	HigherSpawn           bool
	TallerBlocks          bool
}

type Core

type Core struct {
	Wave     *Wave
	PlayerHP int
	Player   *Player
	Blocks   []*Block
	Settings *Settings
	// contains filtered or unexported fields
}

func NewCore

func NewCore(sfxManager assets.SFXManager) *Core

func (*Core) GetBlockSeeds

func (c *Core) GetBlockSeeds() []float32

func (*Core) GetScore

func (c *Core) GetScore() uint64

func (*Core) GetScoreMultiplier

func (c *Core) GetScoreMultiplier() uint64

func (*Core) GetSpeed

func (c *Core) GetSpeed() float64

func (*Core) GetTicks

func (c *Core) GetTicks() uint64

func (*Core) IsWaveOver

func (c *Core) IsWaveOver() bool

func (*Core) StartNextWave

func (c *Core) StartNextWave()

func (*Core) Update

func (c *Core) Update()

type Player

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

func NewPlayer

func NewPlayer() *Player

func (*Player) GetRadius

func (p *Player) GetRadius() float64

func (*Player) GetX

func (p *Player) GetX() float64

func (*Player) GetY

func (p *Player) GetY() float64

func (*Player) GetZ

func (p *Player) GetZ() float64

func (*Player) SetIntentJump

func (p *Player) SetIntentJump(intent bool)

func (*Player) SetIntentX

func (p *Player) SetIntentX(x float64)

type Settings

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

func (*Settings) ApplyAugments

func (s *Settings) ApplyAugments(currentAugments []*augments.Augment)

type Wave

type Wave struct {
	Number      int
	IntDistance uint64
	Speed       float64
	Distance    float64
	// contains filtered or unexported fields
}

func (*Wave) Endless

func (w *Wave) Endless() bool

func (*Wave) Update

func (w *Wave) Update()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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