Skip to content

Commit

Permalink
19/8/21 4:08 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
eboatwright committed Aug 19, 2021
1 parent 77fbc8d commit b2d0b2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtInComponentsAndSystems/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func (ts *TriggerSystem) Update(entity *pearl.Entity, scene *pearl.Scene) {
otherColliders := scene.FindEntitiesOfType("boxCollider")
trigger := entity.GetComponent("trigger").(*Trigger)
for _, other := range otherColliders {
if other == entity { continue }
if EntitiesOverlap(entity, other) {
trigger.OnTrigger(entity, other)
}
Expand All @@ -30,6 +31,6 @@ func (ts *TriggerSystem) Update(entity *pearl.Entity, scene *pearl.Scene) {

func (ts *TriggerSystem) Draw(entity *pearl.Entity, scene *pearl.Scene, screen *ebiten.Image, options *ebiten.DrawImageOptions) {}

func (ts *TriggerSystem) GetRequirement() []string {
func (ts *TriggerSystem) GetRequirements() []string {
return []string { "boxCollider", "trigger" }
}

0 comments on commit b2d0b2d

Please sign in to comment.