Results 1 to 2 of 2

Thread: Drag and Drop Battleship Game

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    9

    Exclamation Drag and Drop Battleship Game

    I need help on dragging and dropping in my Battleship Game. I created 5 user controls each one corresponding to a different game piece (aircraft carrier, battleship, submarine, frigate, and minesweeper) Now I want to drag these pieces onto the game board.

    The gameboard is made up of 100 picture boxes for the player shown in the file gameboard.bmp

    when the controls are dropped onto the gameboard, i want the respective boxes to turn gray. (I am not worrying about making the ships turn vertical yet, that will come in version 2).

    I have not been able to get the drag drop feature to work yet, and I really need some help on that.

    I also set the tag property of each picturebox in the gameboard to an integer 1-100 (respectively). When the game starts, the computer will randomly select a number 1-100 to see if that boxes backcolor is gray. If it is, it will change the color to red. If not, white. I need to know how to point the randomly generated number to the respective player picturebox, if this can be done.

    I am including all the project and Solution files in a zip file if anyone cares to take a look at what i have so far. Feel free to e-mail me for questions at [email protected] or IM me on AIM at thomjp73.
    Attached Files Attached Files
    Last edited by thomjp73; Dec 5th, 2005 at 02:40 AM.

  2. #2
    Addicted Member Filik's Avatar
    Join Date
    Aug 2005
    Posts
    208

    Re: Drag and Drop Battleship Game

    There's a drag n drop example in 101, as far as i remember there's an example of dragging from one picture box to another
    They shout: "Give us cheap oil!"
    What will they shout when all the oil is gone? "Give us another planet full of oil!"



    1 Cigarete takes away 15 minutes of life, 1 minute of laughter gives you 15 minutes of life. What should you do?
    Smoke weed!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width