riser

package
v1.5.183 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Inactive riserState = iota
	IdlingUp
	MovingUp
	MovingLeft
	MovingRight
	GettingCarried
)
View Source
const (
	// SmallRiserWidth is the hitbox width of the riser.
	// Actual width is 16 (one extra pixel to left and right).
	SmallRiserWidth = 14
	// SmallRiserHeight is the hitbox height of the riser.
	// Actual height is 16 (one extra pixel to left and right).
	SmallRiserHeight = 14
	// SmallRiserOffsetDX is the riser's render offset.
	SmallRiserOffsetDX = -1
	// SmallRiserOffsetDY is the riser's render offset.
	SmallRiserOffsetDY = -1
	// LargeRiserWidth is the hitbox width of the riser.
	// Actual width is 16 (one extra pixel to left and right).
	LargeRiserWidth = 30
	// LargeRiserHeight is the hitbox height of the riser.
	// Actual height is 32 (one extra pixel to left and right).
	LargeRiserHeight = 14
	// LargeRiserOffsetDX is the riser's render offset.
	LargeRiserOffsetDX = -1
	// LargeRiserOffsetDY is the riser's render offset.
	LargeRiserOffsetDY = -1
	// RiserBorderPixels is the riser's border size.
	RiserBorderPixels = 1
	// CarriedSmallRiserWidth is the hitbox width of a riser being carried.
	CarriedSmallRiserWidth = 8
	// CarriedSmallRiserHeight is the hitbox height of a riser being carried.
	CarriedSmallRiserHeight = 8
	// CarriedLargeRiserWidth is the hitbox width of a riser being carried.
	CarriedLargeRiserWidth = 24
	// CarriedLargeRiserHeight is the hitbox height of a riser being carried.
	CarriedLargeRiserHeight = 8

	// IdleSpeed is the speed the riser moves upwards when not used.
	IdleSpeed = 15 * constants.SubPixelScale / engine.GameTPS

	// UpSpeed is the speed the riser moves upwards when the player is standing on it.
	UpSpeed = 60 * constants.SubPixelScale / engine.GameTPS

	// SideSpeed is the speed of the riser when pushed away.
	SideSpeed = 60 * constants.SubPixelScale / engine.GameTPS

	// FadeFrames is how many frames risers take to fade in or out.
	FadeFrames = 16

	// FollowFactor is how fast a riser should follow the player per second.
	FollowFactor = 24.0

	// FollowMaxDistance is the max distance allowed while following the player.
	// Hardest part: Multi-Party Authorization.
	FollowMaxDistance = 24

	// RepelSpeed is the speed at which risers repel each other until they no longer overlap.
	RepelSpeed = 15 * constants.SubPixelScale / engine.GameTPS
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Riser

type Riser struct {
	mixins.Physics
	World  *engine.World
	Entity *engine.Entity

	NormalSize  m.Delta
	CarriedSize m.Delta

	State riserState

	Anim      animation.State
	FadeFrame int

	PlayerOnGroundVec m.Delta
	// contains filtered or unexported fields
}

func (*Riser) Despawn

func (r *Riser) Despawn()

func (*Riser) PreDespawn

func (r *Riser) PreDespawn()

func (*Riser) Spawn

func (r *Riser) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error

func (*Riser) Touch

func (r *Riser) Touch(other *engine.Entity)

func (*Riser) Update

func (r *Riser) Update()

type RiserFsck

type RiserFsck struct {
	mixins.NonSolidTouchable
	World *engine.World

	Sound *sound.Sound
}

RiserFsck is an object that kills Risers when touching them. Note that if the original spawnpoint of the riser is visible, the riser will then respawn there.

func (*RiserFsck) Despawn

func (r *RiserFsck) Despawn()

func (*RiserFsck) Spawn

func (r *RiserFsck) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error

func (*RiserFsck) Touch

func (r *RiserFsck) Touch(other *engine.Entity)

Jump to

Keyboard shortcuts

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