world

package
v0.0.0-...-52349ec Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Absorber

type Absorber interface {
	Absorbs() bool
}

type Breaker

type Breaker interface {
	Breaks() bool
}

type BreaksInfo

type BreaksInfo struct {
	AffectedByLaunch *box2d.B2Body
	EntryPoint       box2d.B2Vec2
}

type JSDrawable

type JSDrawable interface {
	FillStyle() string
	StrokeStyle() string
}

type JSObjects

type JSObjects struct {
	Context js.Value
	Doc     js.Value
	Canvas  js.Value
}

func (*JSObjects) Draw

func (jso *JSObjects) Draw(body *box2d.B2Body)

type StickyInfo

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

StickyInfo stores the two objects to be welded together after worldState.World.Step()

type WorldSettings

type WorldSettings struct {
	SimSpeed   float64
	Height     float64
	Width      float64
	WorldScale float64
	Resizing   bool
	LastResize float64
}

type WorldState

type WorldState struct {
	*WorldSettings
	*JSObjects
	Launches                int
	Player                  *box2d.B2Body
	WeldedDebris            *box2d.B2Body
	GoalBlock               *box2d.B2Body
	PlayerJoint             box2d.B2JointInterface
	PlayerCollisionDetected bool
	PlayerWelded            bool
	StickyArray             []StickyInfo
	AbsorbCount             int
	BreaksInfo
	World      *box2d.B2World
	ResetWorld bool
	TMark      float64
	Paused     bool
}

func Initialize

func Initialize() *WorldState

func (*WorldState) Clear

func (worldState *WorldState) Clear()

func (*WorldState) ClearAllJoints

func (worldState *WorldState) ClearAllJoints()

func (*WorldState) ClearJoints

func (worldState *WorldState) ClearJoints(body *box2d.B2Body)

func (*WorldState) CreateBouncyDebris

func (worldState *WorldState) CreateBouncyDebris()

func (*WorldState) CreateBreakableDebris

func (worldState *WorldState) CreateBreakableDebris()

func (*WorldState) CreateDebris

func (worldState *WorldState) CreateDebris()

func (*WorldState) CreateGoalBlock

func (worldState *WorldState) CreateGoalBlock()

func (*WorldState) CreateLaunchBlock

func (worldState *WorldState) CreateLaunchBlock()

func (*WorldState) CreatePlayer

func (worldState *WorldState) CreatePlayer()

func (*WorldState) CreateStaticBouncyDebris

func (worldState *WorldState) CreateStaticBouncyDebris()

func (*WorldState) CreateStaticDebris

func (worldState *WorldState) CreateStaticDebris()

func (*WorldState) CreateStickyDebris

func (worldState *WorldState) CreateStickyDebris()

func (*WorldState) CreateWater

func (worldState *WorldState) CreateWater()

func (WorldState) GetSmallestDimension

func (worldState WorldState) GetSmallestDimension() float64

func (*WorldState) HandleClick

func (worldState *WorldState) HandleClick(this js.Value, args []js.Value) interface{}

func (*WorldState) HandleKeys

func (worldState *WorldState) HandleKeys(this js.Value, args []js.Value) interface{}

func (*WorldState) HandlePause

func (worldState *WorldState) HandlePause(this js.Value, args []js.Value) interface{}

func (*WorldState) HandleUnpause

func (worldState *WorldState) HandleUnpause(this js.Value, args []js.Value) interface{}

func (WorldState) IsPlayerOutOfBounds

func (worldState WorldState) IsPlayerOutOfBounds() bool

func (*WorldState) LaunchPlayer

func (worldState *WorldState) LaunchPlayer(mx float64, my float64)

func (*WorldState) Populate

func (worldState *WorldState) Populate()

func (*WorldState) PushDebris

func (worldState *WorldState) PushDebris(impulseVelocity box2d.B2Vec2)

func (*WorldState) RenderFrame

func (worldState *WorldState) RenderFrame(this js.Value, args []js.Value) interface{}

func (*WorldState) Reset

func (worldState *WorldState) Reset()

func (*WorldState) Resize

func (worldState *WorldState) Resize() bool

func (*WorldState) SetLaunches

func (worldState *WorldState) SetLaunches(launches int)

func (*WorldState) Size

func (worldState *WorldState) Size()

func (*WorldState) Slice

func (worldState *WorldState) Slice(body *box2d.B2Body, impulse box2d.B2Vec2)

func (*WorldState) TriggerResetTimer

func (worldState *WorldState) TriggerResetTimer()

func (*WorldState) TriggerUpdateLaunches

func (worldState *WorldState) TriggerUpdateLaunches()

func (*WorldState) WeldContact

func (worldState *WorldState) WeldContact(contact box2d.B2ContactInterface)

func (*WorldState) WeldJoint

func (worldState *WorldState) WeldJoint()

Jump to

Keyboard shortcuts

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