started with generic collision_system (not working yet)

This commit is contained in:
2024-02-26 18:31:36 +01:00
parent 0ca5d8f4a0
commit 267e15cc27
10 changed files with 275 additions and 100 deletions

14
components/collider.go Normal file
View File

@@ -0,0 +1,14 @@
package components
import "github.com/mlange-42/arche/ecs"
// if the function returns true, the entity will be removed. The
// supplied entity is the target entitiy with which the checked one
// collided.
type Collider struct {
CollisionHandler func(*ecs.World, *Position, *Position, *Velocity, ecs.Entity) bool
EdgeHandler func(*ecs.World, *Position, *Position, *Velocity, ecs.Entity) bool
PassoverHandler func(*ecs.World, *Position, *Velocity, *ecs.Entity) bool
PassoverFinishedHandler func(*ecs.World, *Position, *Velocity, *ecs.Entity) bool
}