Battleship Game
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Battleship Game

  1. #1
    Join Date
    Aug 2012
    Posts
    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??

  2. #2
    Join Date
    Aug 2006
    Posts
    82

    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.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    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/.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center