|
Windows Network Game ![]() As part of my university course, I had to construct a program using the C or C++ programming languages and using the Windows network protocols, that would allow multiple clients to connect to server. This project was implemented and completed over the course of one semester in university. Actual coding time was interspliced with the various other projects I had to create in the year. A simple console application was all that was required as part of the coursework specification, but I decided to take it one step further and create a network game, namely the world renowned Rock, Paper, Scissors game (though probably not world renowned by that name). Not only that but I decided to develop the client end application as nicely as possible, whilst pushing the boundaries of my own knowledge. Having never previously coded specifically for windows (platform independence comes in handy when porting!), I had a little bit of trouble getting started. So I decided that if I was starting from scratch, I would learn as much as I could, so delved into the world of MFC Dialog coding (affectionately known as "Pirate Lego" by our tutor).
By intertwining what we where being taught about network protocols and networking in general with the MFC applications I was testing for myself, I was able to create a simple looking client interface, which achieved exactly what I wanted, and looked much better than a black and white console window. This client contained a cascading array of options from selecting the IP and PORT of the server, to actually playing the game. Each option would allow you to move onto the next set of options, thus allowing extra protection against unexpected input during the game playing phase. Before it was entirely complete, I created the game server, which would handle several clients connecting, and the ability to play one player games (against the server), and two player games (the server selects two inactive players and pits them head to head). As the server would never be seen by the client, then a nice GUI was unnecessary in this case, so a simple console application would suffice.
Once both client and server matched protocols, and where complete, the program was tested and submitted to be marked. As a result the game is here for you to download and play. With the server, just unzip, go into the folder and double click the icon. I'm afraid you'll have to find your own IP address out. Nonetheless, unzip the client and double click the icon in the folder and immediately click "connect" to play on the local machine. Here are the files: If you encounter any problems, please don't just give up, e-mail me and it will allow me to fix the problems for later users. Thanks! If for some reason you use any of my work, please have the courtesy to site me as a reference. You can download the source code for this application using ftp, please e-mail for the details of this. My email address is in the "email" section of this site. Thank you.
All files are "zipped" use an application such as WinZip to
decompress these files. |