pjasicek / OpenClaw

Reimplementation of Captain Claw (1997) platformer
GNU General Public License v3.0
340 stars 40 forks source link

[Refactoring] TriggerComponent #119

Closed pjasicek closed 6 years ago

pjasicek commented 6 years ago

At this moment, only 1 trigger area is supported by a TriggerComponent and other components rely on it.

TriggerComponent should be able to hold any number of trigger areas, which should be distinguished by some Enum and TriggerObservers should register for begin/end overlap events by specifying which triggers they want to be alerted about.

pjasicek commented 6 years ago

Somehow implemented with with 39d0fecf6f5179c6f800607af1fa2b46871da312

Basically actor's components are now not dependant on a concrete use of TriggerComponent since any fixture can can be sensed by the TriggerComponent. TriggerObservers get additional information - which fixture triggered the event.