logo

package
v0.0.0-...-28575ab Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 14 Imported by: 0

README

Arche Demo

The demo on the landing page of Arche Demo.

A simple simulation with 30.000 entities.

Each entity has a target pixel in the logo. It accelerates towards this target, as well as away from the mouse pointer in case it is within a certain distance.

See the live demo for this example.

Documentation

Overview

Package logo provides an interactive animation of the Arche logo.

Index

Constants

This section is empty.

Variables

View Source

Logo is the embedded Ache logo.

Functions

func Run

func Run()

Types

type Grid

type Grid struct {
	Data   [][]bool
	Width  int
	Height int
}

Grid resource, holding the logo image data.

type Position

type Position struct {
	X float64
	Y float64
}

Position component

type SysInitEntities

type SysInitEntities struct {
}

SysInitEntities is a system to initialize entities by creating one for each white pixel of the Arche Logo, obtained via resource Grid.

Each entity has it's associated pixel as Target position, and is places in a random location on the output [Image] area.

func (*SysInitEntities) Finalize

func (s *SysInitEntities) Finalize(world *ecs.World)

Finalize the system

func (*SysInitEntities) Initialize

func (s *SysInitEntities) Initialize(world *ecs.World)

Initialize the system

func (*SysInitEntities) Update

func (s *SysInitEntities) Update(world *ecs.World)

Update the system

type SysMoveEntities

type SysMoveEntities struct {
	// Maximum speed of an entity.
	MaxSpeed float64
	// Maximum acceleration of an entity.
	MaxAcc float64
	// Maximum acceleration of an entity when fleeing.
	MaxAccFlee float64
	// Minimum flee distance, with maximum fleeing acceleration.
	MinFleeDistance float64
	// Maximum fleeing distance. Beyond that distance, entities don't flee.
	MaxFleeDistance float64
	// Dampening of entity movement.
	Damp float64
	// contains filtered or unexported fields
}

SysMoveEntities is a system that moves entities around. Entities accelerate towards their Target position, as well as away from the mouse if it is within a certain distance.

func (*SysMoveEntities) Finalize

func (s *SysMoveEntities) Finalize(world *ecs.World)

Finalize the system

func (*SysMoveEntities) Initialize

func (s *SysMoveEntities) Initialize(world *ecs.World)

Initialize the system

func (*SysMoveEntities) Update

func (s *SysMoveEntities) Update(world *ecs.World)

Update the system

type Target

type Target struct {
	X float64
	Y float64
}

Target position component

type UISysDrawEntities

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

UISysDrawEntities is a system that draws entities as white pixels on an [Image] resource.

func (*UISysDrawEntities) FinalizeUI

func (s *UISysDrawEntities) FinalizeUI(world *ecs.World)

FinalizeUI the system

func (*UISysDrawEntities) InitializeUI

func (s *UISysDrawEntities) InitializeUI(world *ecs.World)

InitializeUI the system

func (*UISysDrawEntities) PostUpdateUI

func (s *UISysDrawEntities) PostUpdateUI(world *ecs.World)

PostUpdateUI the system

func (*UISysDrawEntities) UpdateUI

func (s *UISysDrawEntities) UpdateUI(world *ecs.World)

UpdateUI the system

type UISysManagePause

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

UISysManagePause is a simple system that transfers the pause state from the common.PauseMouseListener resource to the model's model.Systems.

func (*UISysManagePause) FinalizeUI

func (s *UISysManagePause) FinalizeUI(world *ecs.World)

FinalizeUI the system

func (*UISysManagePause) InitializeUI

func (s *UISysManagePause) InitializeUI(world *ecs.World)

InitializeUI the system

func (*UISysManagePause) PostUpdateUI

func (s *UISysManagePause) PostUpdateUI(world *ecs.World)

PostUpdateUI the system

func (*UISysManagePause) UpdateUI

func (s *UISysManagePause) UpdateUI(world *ecs.World)

UpdateUI the system

type Velocity

type Velocity struct {
	X float64
	Y float64
}

Velocity component

Jump to

Keyboard shortcuts

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