Some general Cocoa Game questions

Discussion in 'Public Game Developers Forum' started by Armchairpilot, May 6, 2009.

  1. Armchairpilot

    Armchairpilot Member

    Mar 18, 2009
    10
    0
    0
    I'm really happy with how far I've come with my "game", but I've hit a brick wall. From what I can tell, it's because Model - View -Controller seems a very limiting way to make a game. Do games usually conform to MVC? I would like to have a "unit" class have many or all of it's resources in one set of .m and .h files. So all I would have to do is initialize the unit and things that normally go into the ViewController like IBActions are setup and I don't have to link this button with that unit to that action.

    I also think that Interface Builder is hurting more then it's helping at this point. Is it even possible to make a game using IB? It was nice starting out, but I've gotten to a point where I can see the limitations in my code, because it's just setup for what I allready put on the screen in IB. I can't have the user "create" more units in the middle of a game.
     
  2. eVp

    eVp Well-Known Member

    Dec 4, 2008
    180
    0
    0
    I'd say 99.99% of the games on app store are done with OpenGL. I hate to break it to you, but that really is the way to go. (and IB won't help there at all).
     
  3. Armchairpilot

    Armchairpilot Member

    Mar 18, 2009
    10
    0
    0
    OK, I'll have to look into that. I haven't been looking at OpenGL at all because I assumed that it was used only for 3D stuff. I knew you could do
    2d with it, but I thought that's not really what it was used for. I'll start reading up on OpenGL. Thanks.
     
  4. portablehOle

    portablehOle Well-Known Member

    Jan 28, 2009
    46
    0
    0
    Contrary to the impression you'd get reading beginner's tutorials, you don't need IB at all to build an app. In fact, I'd recommend against using it. You can programmatically create and control views, and if you do you'll have a much better understanding of MVC and Cocoa programming in general.
     
  5. Little White Bear Studios

    Little White Bear Studios Well-Known Member
    Patreon Silver

    Aug 27, 2008
    2,572
    0
    0
    I'm sorry, but that is incorrect. There are a ton of non-OpenGL games. If all you need to do is move 2D images on the screen, at a not extreme speed, OpenGL is massive overkill, and has a very large learning curve. Yes, OpenGL opens the door to more types of games, but it's certainly not a requirement for making a winning game.

    And to the original poster, you don't need to use Interface Builder, nor do you need to follow strictly to any model. None of my games use Interface Builder or OpenGL, and probably don't conform perfectly to MVC. But I'm not saying sticking to the model is a bad thing to strive for.
     
  6. Armchairpilot

    Armchairpilot Member

    Mar 18, 2009
    10
    0
    0
    Yeah, that's what I was slowly figuring out. IB looks great for traditional apps, but I started to realize how useless it is for games. I'm cool with not using IB, I just need to find some toutorials that don't use it.

    I actually could create an extremely rudimentary game with what I have now. The code would just look horrid, because there would be a lot of code that's more or less the same for each unit on the screen (right now I only have 2).

    I was just hoping I could shove a lot of the code that would be in the ViewController for each unit, into the unit class itself so all I would need to do is initialize that class and I've got all the stuff I need. And I'm hoping I can do that if I build the interface programmically instead of using IB. Is that a proper way of doing it, or does MVC stand even in a game where you're probably not going to reuse any of the code anyway?
     
  7. Armchairpilot

    Armchairpilot Member

    Mar 18, 2009
    10
    0
    0
    Cool, that's what I was wondering. I've been cobbling together information and how-tos on how to make iphone apps to apply them to a game, and most of them are very strict with MVC and I wasn't sure how well that applied to games. I'm hoping that this new iPhone Game Projects book by PJ Cabrera that's comming out in June will help get me on the right track.

    Oh, here's the link to that book if anyone's interested:

    http://www.amazon.com/iPhone-Games-Projects-PJ-Cabrera/dp/1430219688/ref=sr_1_1?ie=UTF8&s=books&qid=1241639451&sr=8-1
     
  8. ImNotWorking

    ImNotWorking Member

    Apr 29, 2009
    8
    0
    0
  9. Armchairpilot

    Armchairpilot Member

    Mar 18, 2009
    10
    0
    0
  10. ImNotWorking

    ImNotWorking Member

    Apr 29, 2009
    8
    0
    0
    No problem. Good luck! :)
     

Share This Page