fruitroids

package
v0.0.0-...-04212e3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveWorld *flat.World

Functions

func RegisterFruitroidTypes

func RegisterFruitroidTypes()

Types

type BucketPair

type BucketPair struct {
	Bucket1 string
	Bucket2 string
}

type Bullet

type Bullet struct {
	flat.ActorBase
	Velocity     float64
	FireDelay    float64
	RotationRate float64
	// contains filtered or unexported fields
}

func (*Bullet) BeginPlay

func (b *Bullet) BeginPlay()

func (*Bullet) Draw

func (b *Bullet) Draw(screen *ebiten.Image)

func (*Bullet) SetDirection

func (b *Bullet) SetDirection(angle float64)

func (*Bullet) Update

func (b *Bullet) Update()

type CircleCollisionComponent

type CircleCollisionComponent struct {
	flat.ComponentBase

	ShowDebug      bool
	Radius         float64
	CollisionGroup string
}

func (*CircleCollisionComponent) BeginPlay

func (c *CircleCollisionComponent) BeginPlay()

func (*CircleCollisionComponent) CheckOverlap

func (c *CircleCollisionComponent) CheckOverlap(other *CircleCollisionComponent)

func (*CircleCollisionComponent) Draw

func (c *CircleCollisionComponent) Draw(screen *ebiten.Image)

type Fruitroids

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

func (*Fruitroids) BeginPlay

func (f *Fruitroids) BeginPlay(flow *GameFlow)

func (*Fruitroids) Draw

func (g *Fruitroids) Draw(screen *ebiten.Image)

func (*Fruitroids) IncScore

func (f *Fruitroids) IncScore(amount int)

func (*Fruitroids) Layout

func (g *Fruitroids) Layout(outsideWidth, outsideHeight int) (int, int)

func (*Fruitroids) NextWorld

func (f *Fruitroids) NextWorld()

func (*Fruitroids) Update

func (g *Fruitroids) Update() error

type GameFlow

type GameFlow struct {
	Worlds []*flat.World
	// contains filtered or unexported fields
}

func (*GameFlow) BeginPlay

func (g *GameFlow) BeginPlay()

func (*GameFlow) Draw

func (g *GameFlow) Draw(screen *ebiten.Image)

func (*GameFlow) EndMainPlay

func (g *GameFlow) EndMainPlay()

func (*GameFlow) NextWorld

func (g *GameFlow) NextWorld()

func (*GameFlow) Update

func (g *GameFlow) Update()

type LevelSpawn

type LevelSpawn struct {
	flat.ActorBase
	ToSpawn []SpawnConfig `flat:"inline"`
}

func (*LevelSpawn) BeginPlay

func (l *LevelSpawn) BeginPlay()

type PhysicsCollisionManager

type PhysicsCollisionManager struct {
	flat.ActorBase

	// Only collide against pairs of buckets, not everything
	Buckets []BucketPair
	// contains filtered or unexported fields
}

func (*PhysicsCollisionManager) Add

func (*PhysicsCollisionManager) BeginPlay

func (p *PhysicsCollisionManager) BeginPlay()

func (*PhysicsCollisionManager) Remove

func (*PhysicsCollisionManager) Update

func (p *PhysicsCollisionManager) Update()

type Roid

type Roid struct {
	flat.ActorBase
	// contains filtered or unexported fields
}

func (*Roid) BeginPlay

func (r *Roid) BeginPlay()

func (*Roid) Draw

func (r *Roid) Draw(screen *ebiten.Image)

func (*Roid) Update

func (r *Roid) Update()

type Ship

type Ship struct {
	flat.ActorBase
	RotationRate float64
	Acceleration float64
	MaxVelocity  float64
	BulletType   *Bullet
	// contains filtered or unexported fields
}

TOUR:Fruitroids 4 The Ship struct is our player controlled object. It embeds the flat.ActorBase struct. This mean two things 1) The flat.Actor interface is satisfied by Ship 2) Ship.BeginPlay *must* call ActorBase.BeginPlay(actor) Actors can have sub components added to them. The ship3.json asset has an Image component and a CircleCollisionComponent, those components take care of showing an image and colliding into things. The exported fields of this struct will be editable in the FruitEditor.

func (*Ship) BeginPlay

func (s *Ship) BeginPlay()

func (*Ship) Draw

func (s *Ship) Draw(screen *ebiten.Image)

func (*Ship) Update

func (s *Ship) Update()

type SpawnConfig

type SpawnConfig struct {
	CountMin    int
	CountMax    int
	SpeedMax    float64
	RotationMax float64
	RoidType    *Roid
}

type WorldType

type WorldType int
const (
	WorldType_Pre WorldType = iota
	WorldType_Main
	WorldType_Post
)

Jump to

Keyboard shortcuts

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