Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Novice Programmer

Options
  • 20-08-2010 2:43am
    #1
    Registered Users Posts: 627 ✭✭✭


    Hi there! Ive a few questions to ask and who better than the gurus ;) I'm studying games Dev and enjoy programming. My problem is that i like to just attack any given software idea by sitting down without proper planning tru "Design documents". I lean on debugger wayyy to much in visual studio and sometimes I have to rewrite major code because I didn't think it tru. Sooo does anyone have any advice on, i suppose, planning software? I know this is a bad habit to be getting into as a lot of time is wasted with all the restructuring. And also I'm looking for pointers on a practical/technical book/tutorial on OO. Its a bit petty to me still but I understand its importance but I don't understand it fully.


Comments

  • Closed Accounts Posts: 8,015 ✭✭✭CreepingDeath


    Most programmers go through that phase of jumping straight into code, but when you start working on large/complex systems you'll have to plan it.

    There's a very well known design pattern called the "model view controller" pattern which might help you in writing games, and pretty much anything else with a user interface.
    The idea is that you split your code into 3 logical sections.

    1. Model
    How you store your data.
    Eg. if you're writing a 2D platform game, this code would store the bitmap
    tiles, player location, bonus items etc. All you should do in this code section/class is add, remove and edit data items for the game.

    2. View
    How to display your game data.
    Here you want to take data from the model class and display it on the screen.

    3. Controller
    This is how you control the game, eg. mouse and keyboard input.
    As the part uses the mouse/keyboard, you take that input and change the game data in the model class. Eg. move the character, which in turn moves the map.

    By separating your code into nice logical sections, you can alter one section/class, without altering the other pieces radically.
    So you could port your game from the mobile phone to a PC by refactoring the view and controller bits, but leaving the model module intact.

    Had a quick look, but didn't find a decent OO tutorial. Only looked at the first page of results from Google.


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    I'm not really a programmer, more of a hack having come from a design background. Know nothing about game programming. But if I have to code something, I like to visualise it by drawing it out on a sketch pad. Not just the interface, but how I'll structure the code to avoid duplication and keep it as simple as possible. Its more a scribble, but seems to work.

    On a bigger project it would have to be more formal.


Advertisement