so just a general question on what people think is the most efficient method for programming a game. My game will have a number of images moving all over the screen and rotating, changing, etc.
The two options I see for a construction are:
-
Create 1 UIViewController and add to it a bunch of UIImageViews
at runtime, and then move these UIImageViews around programatically -
Create a UIVIewController and add to it a sublclass of UIView,
say GameView. Then, add an array of objects (which contains data
like UIImage and location) to GameView, and override the drawRect
method of GameView to draw these objects.
My question is, which one seems like it would put the least strain on the device? Is it bad to have a large number of UIImageViews moving around, because it seems like they have to remember a lot more data than just the UIImage and location, which is pretty much all I need.
Use the UIImages in the UIView. It’ll be a lot lighter-weight, and it makes more sense. For best performance, though, you’re going to need to switch to OpenGL.