I have a very general question. I have always struggled deciding when to create a Class or just make a Method for something.
A game I started last year for fun (to learn) I picked up this last weekend again. It's like Asteroids where you have rocks floating on the screen. I could create a simple method that would return a UIImageView with the rock on the screen or create a rock Class that I can use to to do the same thing? But creating a rock it would be created in the viewController for the screen which is not the MVC design, if I even.
If I decided to create a rock Class to populate the screen with rocks, the rock Object it's self would not be responsible for moving the rock on screen, it would just return the rock every time I needed a rock object? The game engine would be responsible for moving and rotating the newly created object?
Now creating a Rock Class it would be a subclass of NSObject? But that feels wrong since it is a view but even in NSObject I can have a method return a UIImageView for the rock.
I would think after all the reading I have done and testing this subject would be second nature to me after all these years now.
Any help is appreciated as always.
Thanks.
A game I started last year for fun (to learn) I picked up this last weekend again. It's like Asteroids where you have rocks floating on the screen. I could create a simple method that would return a UIImageView with the rock on the screen or create a rock Class that I can use to to do the same thing? But creating a rock it would be created in the viewController for the screen which is not the MVC design, if I even.
If I decided to create a rock Class to populate the screen with rocks, the rock Object it's self would not be responsible for moving the rock on screen, it would just return the rock every time I needed a rock object? The game engine would be responsible for moving and rotating the newly created object?
Now creating a Rock Class it would be a subclass of NSObject? But that feels wrong since it is a view but even in NSObject I can have a method return a UIImageView for the rock.
I would think after all the reading I have done and testing this subject would be second nature to me after all these years now.
Any help is appreciated as always.
Thanks.