graphics

package
v0.0.0-...-157546e Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EyesModifiersNone float32 = iota
	EyesModifiersJoyful
	EyesModifiersAngry
)

Variables

View Source
var (
	AmbientColorsByLevel = [][]float32{
		0: {
			1, 1, 1,
			0.5, 0.5, 0.75,
			0.5, 0.5, 0.75,
			0.5, 0.5, 0.75,
			0.5, 0.5, 0.75,
			1, 1, 1,
		},
		1: {
			1, 1, 1,
			0.5, 0.5, 0.75,
			0.5, 0.5, 0.75,
			0.5, 0.5, 0.75,
			0.5, 0.5, 0.75,
			1, 1, 1,
		},
	}
	AgentColorsByLevel = [][]float32{
		0: {1, 0.5, 0.25},
		1: {0.5, 0.25, 1},
	}
	AgentEyesByLevel = []float32{
		0: EyesModifiersJoyful,
		1: EyesModifiersAngry,
	}
)
View Source
var (
	BrushImage = ebiten.NewImage(1, 1)
)

Functions

func AppendQuadVerticesIndices

func AppendQuadVerticesIndices(vertices []ebiten.Vertex, indices []uint16, index int, opts *QuadOpts) ([]ebiten.Vertex, []uint16)

func DrawRectBorder

func DrawRectBorder(dst *ebiten.Image, x, y, width, height, borderWidth, r, g, b, a float32)

Types

type QuadOpts

type QuadOpts struct {
	DstX, DstY          float32
	SrcX, SrcY          float32
	DstWidth, DstHeight float32
	SrcWidth, SrcHeight float32
	R, G, B, A          float32
}

type Renderer

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

func NewRenderer

func NewRenderer() *Renderer

func (*Renderer) Draw

func (r *Renderer) Draw(screen *ebiten.Image, state *State)

func (*Renderer) Update

func (r *Renderer) Update()

type State

type State struct {
	Level      int
	Map        *level.HMap
	Camera     *core.Camera
	Player     *agents.Player
	Agent      agents.Agent
	GameStatus core.GameStatus
	PlayerSeen bool
	AgentSeen  bool
}

Jump to

Keyboard shortcuts

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