Programming for Games

Hello everyone, I am a second year student at Atlantic University. I am studying video game animation and design.

Microsoft has a competition here in PR in which you design a game for a windows phone, Now it seems as if I will have to be the one to program it. I have only just begun learning about programming so this would be quite the challenge to undertake. Our game is meant to be a side scroller with 3D models. I am not really sure how to even begin working on this. I know it is a lot to ask but if anyone could show me at least the basics for creating games I would greatly appreciate it. And if by chance you know of any good tutorials please do let me know.

Thank you all in advanced
I have no personal experience with the windows phone platform, however, one of the first things to determine in your case would probably be whether you'll be developping using 2D or 3D -- as the overall structure of a 2D app/game will somewhat differ from a 3D one in terms of loading models, moving them, checking for collisions etc. A side-scroller with actual 3D models would involve that you export your models from your 3D modeling software and then re-import them, light them and then have them perform their animation clips while moving in two axes of movement (say, the X and Y axes). If you did a 2D side-scroller, you could pre-render your 3D models' animations and import them in your app/game as images that contain the frames of the animation (often referred to as a spritesheet), much like traditional 2D animation flipbooks. The first approach would involve using an existing model loader library for loading your chosen 3D model file-type, or writing a set of 3D model loading functions on your own. The second involves loading prerendered image files -- like PNG for instance.

Similarly, your bounding boxes, collision detection and general transformation math would differ, in one case you'd have 3D math, in the other 2D. In some cases you can use world-aligned bounding boxes (no rotation of the bounding box takes place) and they generally simplify calculations. For 2D side-scrollers in particular, it is not uncommon to see world-aligned bounding boxes used (if you refer yourself to 80's-90's 2D side-scrollers this is almost a given, as rotations are usually done only pictorially -- the animated image sequence shows an object/character rotating, but the bounding box that defines collisions, as well as the rectangle that you render the sprite in, are always world-aligned). Depending on your project, world-aligned bounding boxes could work for you or not. If not, your movement and collision algorithms will have to be more extensive for good results -- of course this naturally gives the best results and flexibility.

For 2D rendering, as I briefly mentioned earlier, your environments and characters could be designed in pre-rendered 3D (and your collision geometry defined as 2D rectangles or convex surfaces). The environment and characters could also be designed in 2D (in Photoshop, etc), or any mixture of the two (2D-3D), as the final output that will constitute your app/game's input will be simple image files. On the other hand, 3D rendering will require that you design and export your environment and characters in your chosen 3D model file-type (as previously mentioned), and also handle textures for those models, and lighting for your environment to show up in the viewport as your 3D game runs.

Hope this helps you somewhat. For basic 2D rendering and collision concepts like the ones I mentioned above, I remember that this site had some good examples, although the tutorials use SDL (I don't know if you could use that on a windows phone). Note that they are ordered with the newest first, so the series actually begins from the bottom up.

For books (since most of the information you'll actually use in the end will be found in detail there), I recommend Frank Luna's books on DirectX (for 3D rendering), as well as the "OpenGL Programming Guide" by Dave Shreiner and the Khronos OpenGL ARB Working Group. Also: Lengyel's "Mathematics for 3D Game Programming and Computer Graphics", and Ericson's "Real-Time Collision Detection".

Last edited on
Topic archived. No new replies allowed.