doodle/pkg/uix/actor_events.go
Noah Petherbridge 1523deeb9c Return False: Solid Collision Between Actors
* Implement the handler code for `return false` when actors are
  colliding with each other and wish to act like solid walls.
* The locked doors will `return false` when they're closed and the
  colliding actor does not have the matching key.
* Add arbitrary key/value storage to Actors. The colored keys will set
  an actor value "key:%TITLE%" on the one who touched the key before
  destroying itself. The colored doors check that key when touched to
  decide whether to open.
* The trapdoor now only opens if you're touching it from the top (your
  overlap box Y value is 0), but if you touch it from below and the door
  is closed, it acts like a solid object.
2019-05-28 21:43:30 -07:00

11 lines
254 B
Go

package uix
import "git.kirsle.net/apps/doodle/lib/render"
// CollideEvent holds data sent to an actor's Collide handler.
type CollideEvent struct {
Actor *Actor
Overlap render.Rect
InHitbox bool // If the two elected hitboxes are overlapping
}