When it comes to the point when you need to create a class, say Enemy class, to make inside the calculations, what's the best way create this subclass? Is there any example of this?
Is subclassing a good idea in cocos2d? If not, what's the solution?
A fast, easy to use, free, and community supported 2D game engine
When it comes to the point when you need to create a class, say Enemy class, to make inside the calculations, what's the best way create this subclass? Is there any example of this?
Is subclassing a good idea in cocos2d? If not, what's the solution?
I'm not sure but one way is to make a class that inherits from its super class.
One example is this:
@interface HelloWorldLayer : //this is where you put the super class
{
}
I'm also new to cocos2d, so this may not be helpful much.
@marg11 , it would be a good idea to use this forum's search feature and search for the term "subclass". There are a lot of good examples and advice on the subject here.
This a decent thread to start with http://www.cocos2d-iphone.org/forum/topic/6621
You must log in to post.