When I intercept the properties, I currently wrap intercepted function calls into a closure (see basecomponent.intercept()) so that the 'this'this object can refer to the component itself. Without that the 'this'this object was still being referred to as the attachedEntityattachedEntity (from within the components version of that function), so to get the components properties I had to run a query.
Things I've used as reference:
http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ http://gameprogrammingpatterns.com/component.html
http://blog.bengarney.com/2010/06/12/composition-vs-inheritance/
- http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
- http://gameprogrammingpatterns.com/component.html
- http://blog.bengarney.com/2010/06/12/composition-vs-inheritance/
Full source code can be found here.
JumpPadComponentJumpPadComponent attached to a couple of standard entities:
Full source code can be found here: https://github.com/onedayitwillmake/ChuClone
