I'm making my first game. I'm a quite experienced C programmer, but I never went through games/graphics rendering, so I need some help from you.
From making this game, I want to learn both how a game is structured and works (in practice, because in theory I already know how games work) and OOP in C++.
I know Java, Python and PHP, but this is my first (serious) experience with C++.
So, this is what I have:
- Visual C++ 2012 Express
- Some GDI+ tests (please, finish reading the post )
- A lot of ideas on how to implement things
- A lot of difficulties, most of them are about timing and drawing
First of all, let me explain why I'm using GDI+: because It is easy. I will probably re-implement the rendering part of the game once it is finished with a better library, but I gave a look at SDL and Allegro and I couldn't even figure out how to draw a line (just kidding, I'm not that bad, but everything is more immediate with GDI+, and it is fully object-oriented).
The game is about planes: there will be some planes on the screen, there will be physics and collisions, the planes will shot other planes on the screen.
So here's the idea: I made (read: thought about making) some classes: Body (abstract), which has 3 fields (id, position), PhysicBody (abstract, inherits id and position from Body, and has acceleration field), ControllableBody (abstract, provides virtual methods to add acceleration/change the position) and on top of this last class I will implement Joystick input and computer-controlled planes/bodies, and a generic Plane class (with all the properties of the plane)
So for example I have a plane called "Simple plane", controllable by the player, and I would implement it like this:
But here comes the first problem: I would have to create 2 copies of each kind of plane, one inheriting from PlayerControllableBody (class which takes the input from joystick/keyboard) and the other one from AIControllableBody (class which generates the input real-time moving and making shoot the enemy planes).
So this is not a good solution.
The second thing which blocks me is, how I already say, the timing: I'm building this into a standalone Win32 application, so I've got the message loop... Not so good for a game, no?
So please, I need your help on these points. Programming is my passion. I'm 15, and I would like to program 3D video games when I'll grow up. I know that I will have to work hard, and I will do one step at a time to reach my objective.
Thanks in advance guys, I really count on you
And sorry for my English ;)
Edited by thedd, 03 October 2012 - 02:31 PM.