I am new to Obj C, but have developed many types of games in Flash. I have multiple squares (UIImageViews) that have the exact same properties;
- can be collision detected (converted to CGRect)
- can have a background image (image.png)
- can set an int variable on itself to set state (0-3)
- can be a type of square represented by another int variable (0-3)
In Flash I could create a movieClip instance and define it's properties on that instance. Then I can duplicate the instance and give it different names. Now all the instances can have their own properties set depending on their own state in the game.
How can I do this in OBJ C. Is there a way to define an object, like a UIImageView *square that also has a CGRect.frame, a .background property, an int state variable, and an int type variable? Then if I create an instance and name it square_01, square_02, etc... Is this possible?
The way I have it setup now looks like a giant list of properties as I am having to create a UIImageView, a CGRect, and 2 int vars, for each square that I know I am going to be creating. I want to refactor and simplify so that my code doesn't get out of hand as I feel is starting to be the case.
Thanks in advance,