hakase-labs / hikari

Mega Man/Rockman game clone written by nerds for nerds.
43 stars 8 forks source link

Implement Entity Attachments #241

Open zackthehuman opened 8 years ago

zackthehuman commented 8 years ago

It should be possible to attach one Entity to another, calculating its position relative to the attached-to object. This kind of thing is needed for moving platforms, rush jet, shield weapons, etc.

Possible implementation could be via an Attachment object, which all Entities have a unique_ptr to. When it's non-null, positions are calculated based on the attachment. When it is null, positions are calculated in absolute terms.