Hello,
using chipmunk in my game, recently decided to create a class for my meteors, a Sprite class.
Anyways I use chipmunk for physics setup and I was wondering if it's ok to update the object from inside the class, and remove it from inside the class as-well.
I mean, I have an instance of my Meteor class inside my GameLayer, and I call updateShape on my space, but I can't get reference to my class (Meteor class).
So... do I implement the update method inside my Meteor class and then call it on the object from the updateChipmunk method? like so:
- (void)updateChipmunk:(ccTime) delta {
for( Meteor *m in meteorArray)
[m update];
}
Or maybe there's a way to access the meteor instance from within the eachShape??
Any advice on how to implement Sprite + chipmunk classes inside a game would be greatly appreciated, as I really think this is necessary - using the power of OOP I mean.