Advertisement

Object Oriented Design Tutorials

Started by January 28, 2001 09:49 AM
1 comment, last by gatekeeper 24 years ago
I am a newcomer and I have almost finished my first game but it consists of one source file that is around 6500 lines long. How do I make my game in modules (AI, Physics, etc.) so the game is broken up into many small .cpp files? I can''t find any step by step tutorials on how to link these files together.
That''s hardly OOD and lots & lots of files isn''t a great idea either.

I usually keep related classes together...

  /////////////Network.h#ifndef __NETWORK_H#define __NETWORK_H#include "Player.h"#include <afxtempl.h>//////////////Prototypesclass CNetworkServerDx8;class CNetworkClientDx8;class CPacket;//class definitions...#endif //__NETWORK_H  


  #include "stdafx.h"#include "GameEngine.h"#include "Network.h"#ifndef __NETWORK_CPP#define __NETWORK_CPP///////////////////////////////////////////////////////////////////////////////////PacketCPacket::CPacket():length(0), packettype(PT_EMPTY), serialnum(0), ecc(0), data(0), m_dwDataSize(0)	{	m_dwDataSize=128;	data = new BYTE[m_dwDataSize];	}/On & on...#endif __NETWORK_CPP  


Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
Thanks for the help. Maybe I used the wrong title but I didn't really know what to call it. OOD just sounded like the appropriate buzzword. I don't really understand how the primary cpp knows which cpp contains the network info. I know the primary cpp will include the network header file (I am not talking about the packet header in the network code just in case you misunderstood).

Edited by - gatekeeper on January 28, 2001 9:07:24 PM

This topic is closed to new replies.

Advertisement