Open GL vs. UIImageView

Discussion in 'iOS Programming' started by Gregorski, Aug 11, 2009.

  1. Gregorski macrumors newbie

    Jan 27, 2009
    I've got an idea for a game but I'm after some advice on coding method, specifically whether I will be able to use UIImageViews rather than learning OpenGL.

    My idea requires a top-down view of a game area/map. This will need to scroll over several "pages" (i.e screen areas). Let's say, for example, this is a car racing game where the track covers an area of 4 iphone-screens x 4 iphone-screens. Would I be able to create the whole map as a UIImageView and move it around so the correct area is visible. Would I also be able then to create the cars as UIImageViews and move them appropriately. Would hit testing be easy for tracking whether the car is on the track etc or has hit the barrier? Alternatively, should I be looking at learning OpenGL to achieve this. I have a clear idea of what I want to achieve, I just need some pointers as to how to start off, specifically with the map scrolling to begin with and possibly with the sprites. I think the game mechanics/logic/internals (whatever you want to call it) are fairly straightforward for me to code.

    Any input would be greatly appreciated. I'm new to Objective-C, iPhone SDK, and games programming, but in no way new to programming in general.
  2. Menge macrumors 6502a


    Dec 22, 2008
    Your idea would work with both things. However, OpenGL will get you a lot further in terms of scalability and performance (and even battery life, I believe).

    About the hit testing being easy: it'll vary with the complexity of your hit shapes and speeds.

    For instance, I'm working on a game that has very fast objects moving around. Hit testing will often have to retrace that object's step in order to find out if it collided in between frames. But I doubt a car racing game will have such issues.
  3. Kingbombs macrumors member

    Jun 24, 2009
    lets say its a first per shooter you are making, if the user presses the forward key, then check if with that extra movement if the user will hit the wall, if he does then stop him
    Thats a better way than having to re-trace your steps, also if your game slows right down im guessing theres a small chance you could briefly appear outside of the game boundaries
  4. lazydog macrumors 6502a

    Sep 3, 2005
    Cramlington, UK

    Go with OpenGL! It's not that difficult...

    b e n
  5. mccannmarc macrumors 6502


    Aug 15, 2008
    Manchester, UK
    For simple games this is true. However a lot of the more advanced titles run seperate graphics and physics engines (each running in seperate threads may I add) and doing this would be a pain in the ass as well as a huge performance killer as in every draw frame you would have to update the physics which is *usually* unnecessary.

    EDIT: WOO and this post made me a 6502! :D
  6. Gregorski thread starter macrumors newbie

    Jan 27, 2009
    OK, many thanks for the responses. I'll give OpenGL a go.

Share This Page