core

package
v0.0.0-...-2d96230 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColumnsCount = logic.ScreenWidth / logic.UnitSize

	WaveIncreaseFrequencyHeightInterval = 100.
)
View Source
const (
	DefaultMoveSpeed = 5
	BaseJumpForce    = 2
	PlayerMaxHP      = 10
)
View Source
const (
	WaveInitialGrowingRate = 1.0
	WaveMaxGrowingRate     = 2.0 // TODO: (?)
	WaveBaseHeight         = logic.ScreenHeight / 5
	WaveDamageTick         = logic.TPS / 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	ChestPickedUp bool

	BonusList *bonus.List
	Stats     *Stats
	Wave      *Wave
	Platforms *platform.List
	Entities  []entity.Entity
	Player    *Player
	// contains filtered or unexported fields
}

func NewCore

func NewCore() *Core

func (*Core) GetBestHeight

func (c *Core) GetBestHeight() uint64

func (*Core) GetHeight

func (c *Core) GetHeight() uint64

func (*Core) Initialize

func (c *Core) Initialize()

func (*Core) IsGameOver

func (c *Core) IsGameOver() bool

func (*Core) TriggerChestPlatformWave

func (c *Core) TriggerChestPlatformWave()

func (*Core) Update

func (c *Core) Update()

type Player

type Player struct {
	X, Y          float64
	Width, Height float64
	MoveSpeed     float64

	HP               float64
	GroundedPlatform *platform.Platform
	Orientation      float64
	IntentVector     []float64
	VelocityVector   []float64
}

func NewPlayer

func NewPlayer() *Player

func (*Player) AddHP

func (p *Player) AddHP(hp float64)

func (*Player) Update

func (p *Player) Update()

type Stats

type Stats struct {
	AirControl          bool
	SpawnHearts         bool
	PlatformCellCount   int
	EventPlatformsCount int
	JumpForce           float64
	WaveHealMod         uint64
	EnemyMoveSpeed      float64
	MaxEnemyDistance    byte
	CheckpointMod       uint64
}

func NewStats

func NewStats() *Stats

func (*Stats) ApplyBonus

func (s *Stats) ApplyBonus(b bonus.Bonus)

func (*Stats) Clone

func (s *Stats) Clone() *Stats

type Wave

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

func NewWave

func NewWave(rng *rand.Rand) *Wave

func (*Wave) GetLevels

func (w *Wave) GetLevels() []float64

func (*Wave) GetMinMaxLevels

func (w *Wave) GetMinMaxLevels() (float64, float64)

func (*Wave) Healing

func (w *Wave) Healing() bool

func (*Wave) Update

func (w *Wave) Update(p *Player, healingMod uint64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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