core

package
v0.0.0-...-e9df9b9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlayerMoveSpeed         = 9
	PlayerSlidingAngleSpeed = 0.03

	InitialPortalSpawnInterval   = 10 * logic.TPS  // 10sec
	InitialObstacleSpawnInterval = 2.5 * logic.TPS // 2.5sec
)
View Source
const (
	ObstacleKindDeath byte = iota
	ObstacleKindPortalNone
	ObstacleKindPortalNorth
	ObstacleKindPortalSouth
)
View Source
const (
	PlayerRadius = 56

	RingRadius          = logic.ScreenHeight / 2
	RingAttractionForce = PlayerMoveSpeed * 1.05
	MaxPlayerDistance   = RingRadius - 96 // 96 was originally the player's radius

	SidesCount = graphics.ImageResolution
	DepthToWin = SidesCount

	RotateTextureZInterval = 12
)

Variables

View Source
var (
	DataTexture = ebiten.NewImage(graphics.ImageResolution, graphics.ImageResolution)
)

Functions

func GetTip

func GetTip() string

Types

type Attraction

type Attraction byte
const (
	AttractionNone Attraction = iota
	AttractionSouth
	AttractionNorth
)

type Coating

type Coating struct {
	Surfaces []Attraction
}

type Difficulty

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

func (*Difficulty) String

func (d *Difficulty) String() string

type Game

type Game struct {
	Direction geom.Vec2
	Ring      *Ring
	Obstacles []*Obstacle
	Player    *Player
	Over      bool
	// contains filtered or unexported fields
}

func NewGame

func NewGame() *Game

func (*Game) GetDifficulty

func (g *Game) GetDifficulty() *Difficulty

func (*Game) GetScore

func (g *Game) GetScore() int64

func (*Game) Update

func (g *Game) Update()

type Obstacle

type Obstacle struct {
	Z            float32
	Angle        float32
	Scale        float32
	Triangles    []*geom.Triangle
	SrcTriangles []*geom.Triangle
	// contains filtered or unexported fields
}

func (*Obstacle) GetAlpha

func (o *Obstacle) GetAlpha() float32

func (*Obstacle) GetColor

func (o *Obstacle) GetColor() []float32

func (*Obstacle) Update

func (o *Obstacle) Update(z float32)

type Player

type Player struct {
	DashingTicks uint64
	DashEnergy   float32
	Attraction   Attraction
	Position     geom.Vec2
	Rotation     geom.Vec3
	BonesSet     assets.BoneSet
}

func (*Player) GetColor

func (p *Player) GetColor() []float32

func (*Player) GetDashMultiplier

func (p *Player) GetDashMultiplier() float32

func (*Player) Update

func (p *Player) Update()

type Ring

type Ring struct {
	Z        float32
	Center   geom.Vec2
	Coating  *Coating
	Texture0 *ebiten.Image
	Texture1 *ebiten.Image
	Texture2 *ebiten.Image
	// contains filtered or unexported fields
}

func (*Ring) GetAttraction

func (r *Ring) GetAttraction() Attraction

func (*Ring) Update

func (r *Ring) Update(ringAdvanceSpeed float32)

Jump to

Keyboard shortcuts

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