Noah2610 / deathfloor

Work-in-progress Mega Man inspired game.
MIT License
2 stars 0 forks source link

Enemy ledge turn #45

Closed Noah2610 closed 4 years ago

Noah2610 commented 4 years ago

Add logic for making enemies turn around when they hit a floor ledge.

Noah2610 commented 4 years ago

Add LedgeDetector component, that generates events. Should be able to configure which corners to detect ledges for, and when to trigger depending on which side the entity is standing on. Generates events which include which corner was detected.

Noah2610 commented 4 years ago

Delelte corner detector entities when entity is deleted or entity switches variant.

Noah2610 commented 4 years ago

Working.

Entity config example:

See the ledge detector component in the example for some doc comments. See the variant's OnLedgeDetect events for usage example.

Basically, when you add the LedgeDetector component to an entity, it will produce ledge detector events, which can be listened to with the OnLedgeDetect event. Ledge detecting on its own does nothing, except generate those events.

@hoichael Merged in master.