-
August 11th, 2012, 02:40 PM
#1
Battleship Game
Hi everyone, I want to make battleship in c++. At the starting Program should ask user for mode - Single Player with AI or Multi-player. So how to start writing code for both??
-
August 12th, 2012, 08:01 AM
#2
Re: Battleship Game
First of all, I guess this question is not really related to Visual C++. It's about design decisions, maybe you should try another forum?
Now, to try to answer your question... In an object oriented solution you can prepare a virtual base class for your opponent player with a GetNextMove() method. Then you derive different classes, one for AI player (where you write your search algorithms, neural networks, etc), and one for network player (where you write code for network communication). You then create a factory that at runtime creates the interface object for the player type that matches the selected mode.
Anyway, that's a start. You should try to write some overall design paper before starting.
-
August 13th, 2012, 08:29 AM
#3
Re: Battleship Game
Do you know anything about programming and C++? Anyway, have a look here http://mariusbancila.ro/blog/2007/05...a-write-games/.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|