peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general
peer 2 peer game of the general peer 2 peer game of the general
peer 2 peer game of the general
Go Back  Xtreme Visual Basic Talk > > > peer 2 peer game of the general


Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2013, 09:31 AM
gbraijin13 gbraijin13 is offline
Newcomer
 
Join Date: Nov 2013
Posts: 3
Question peer 2 peer game of the general


im making a peer to peer vb.net game ..the board are almost done and also the chat also done but all i need is how can i the 2 pieces? I use picture box for the pieces and also i use drag n drop codes for moving the picture box pls help me ...pls give me some idea how can i put make those picture box seen to the other pc...this is for my school thesis..
Reply With Quote
  #2  
Old 12-13-2013, 10:09 AM
passel's Avatar
passelpeer 2 peer game of the general passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,015
Default

What type of "drag n drop" code?
I would think that you would have objects (in this case pictureboxes) that represent all the players on each machine, with some sort of ID common to a given player on all machines.
If you were manually implementing the drag, as you dragged the object your code would periodically send the position and ID of the player object being moved in a message of your design between the machines. The receiving machines would see that player ID has moved, and move the cooresponding object on their end.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #3  
Old 12-14-2013, 10:39 PM
gbraijin13 gbraijin13 is offline
Newcomer
 
Join Date: Nov 2013
Posts: 3
Default this the flow of my game sir and also the SS

gameboard.jpg
Code:
 Private Sub GameBoard_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Call ScreenResolution()
        lblhostname.Text = Create.lblpname.Text
        listerner.Start()
        Timer2.Enabled = True
        Timer2.Start()
        txtinbox.Enabled = False
        pic1.AllowDrop = True
        pic2.AllowDrop = True
        pic3.AllowDrop = True
        pic4.AllowDrop = True
        pic5.AllowDrop = True
        pic6.AllowDrop = True
        pic7.AllowDrop = True
        pic8.AllowDrop = True
        pic9.AllowDrop = True
        pic10.AllowDrop = True
        pic11.AllowDrop = True
        pic12.AllowDrop = True
        pic13.AllowDrop = True
        pic14.AllowDrop = True
        pic15.AllowDrop = True
        pic16.AllowDrop = True
        pic17.AllowDrop = True
        pic18.AllowDrop = True
        pic19.AllowDrop = True
        pic20.AllowDrop = True
        pic21.AllowDrop = True
        pic22.AllowDrop = True
        pic23.AllowDrop = True
        pic24.AllowDrop = True
        pic25.AllowDrop = True
        pic26.AllowDrop = True
        pic27.AllowDrop = True
        pic28.AllowDrop = True
        pic29.AllowDrop = True
        pic30.AllowDrop = True
        pic31.AllowDrop = True
        pic32.AllowDrop = True
        pic33.AllowDrop = True
        pic34.AllowDrop = True
        pic35.AllowDrop = True
        pic36.AllowDrop = True
        pic37.AllowDrop = True
        pic38.AllowDrop = True
        pic39.AllowDrop = True
        pic40.AllowDrop = True
        pic41.AllowDrop = True
        pic42.AllowDrop = True
        pic43.AllowDrop = True
        pic44.AllowDrop = True
        pic45.AllowDrop = True
        pic46.AllowDrop = True
        pic47.AllowDrop = True
        pic48.AllowDrop = True
        pic49.AllowDrop = True
        pic50.AllowDrop = True
        pic51.AllowDrop = True
        pic52.AllowDrop = True
        pic53.AllowDrop = True
        pic54.AllowDrop = True
        pic55.AllowDrop = True
        pic56.AllowDrop = True
        pic57.AllowDrop = True
        pic58.AllowDrop = True
        pic59.AllowDrop = True
        pic60.AllowDrop = True
        pic61.AllowDrop = True
        pic62.AllowDrop = True
        pic63.AllowDrop = True
        pic64.AllowDrop = True
        pic65.AllowDrop = True
        pic66.AllowDrop = True
        pic67.AllowDrop = True
        pic68.AllowDrop = True
        pic69.AllowDrop = True
        pic70.AllowDrop = True
        pic71.AllowDrop = True
        pic72.AllowDrop = True
        lbldate.Text = Date.Today
    End Sub
    Private Sub PictureBox_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) _
    Handles pic1.DragDrop, pic2.DragDrop, _
    pic3.DragDrop, pic4.DragDrop, pic5.DragDrop, pic6.DragDrop, _
    pic7.DragDrop, pic8.DragDrop, pic9.DragDrop, pic10.DragDrop, _
    pic11.DragDrop, pic12.DragDrop, pic13.DragDrop, pic14.DragDrop, _
    pic15.DragDrop, pic16.DragDrop, pic17.DragDrop, pic18.DragDrop, _
    pic19.DragDrop, pic20.DragDrop, pic21.DragDrop, pic22.DragDrop _
    , pic23.DragDrop, pic24.DragDrop, pic25.DragDrop, pic26.DragDrop, _
    pic27.DragDrop, pic28.DragDrop, pic29.DragDrop, pic30.DragDrop, _
    pic31.DragDrop, pic32.DragDrop, pic33.DragDrop, pic34.DragDrop, _
    pic35.DragDrop, pic36.DragDrop, pic37.DragDrop, pic38.DragDrop, _
    pic39.DragDrop, pic40.DragDrop, pic41.DragDrop, pic42.DragDrop, _
    pic43.DragDrop, pic44.DragDrop, pic45.DragDrop, pic46.DragDrop, _
    pic47.DragDrop, pic48.DragDrop, pic49.DragDrop, pic50.DragDrop, _
    pic51.DragDrop, pic52.DragDrop, pic53.DragDrop _
    , pic54.DragDrop, pic55.DragDrop, pic56.DragDrop, pic57.DragDrop, _
    pic58.DragDrop, pic59.DragDrop, pic60.DragDrop, pic61.DragDrop, _
    pic62.DragDrop, pic63.DragDrop, pic64.DragDrop, pic65.DragDrop, _
    pic66.DragDrop, pic67.DragDrop, pic68.DragDrop, pic69.DragDrop, _
    pic70.DragDrop, pic71.DragDrop, pic72.DragDrop

        'Check if data is present
        If Not e.Data.GetDataPresent(DataFormats.Bitmap) Then Exit Sub

        'Determine if it is a copy or move operation
        If CBool(e.KeyState And 8) Then
            ' Display the copy cursor.
            e.Effect = DragDropEffects.Copy
        Else
            e.Effect = DragDropEffects.Move
        End If

        'Get a reference to the current textbox control
        Dim ctlCurrent As PictureBox = DirectCast(sender, PictureBox)
        'Paste the image to drop
        ctlCurrent.Image = DirectCast(e.Data.GetData(DataFormats.Bitmap), Image)
    End Sub
    Private Sub PictureBox_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) _
    Handles pic1.DragEnter, pic2.DragEnter, _
    pic3.DragEnter, pic4.DragEnter, pic5.DragEnter, pic6.DragEnter, _
    pic7.DragEnter, pic8.DragEnter, pic9.DragEnter, pic10.DragEnter, _
    pic11.DragEnter, pic12.DragEnter, pic13.DragEnter, pic14.DragEnter, _
    pic15.DragEnter, pic16.DragEnter, pic17.DragEnter, pic18.DragEnter, _
    pic19.DragEnter, pic20.DragEnter, pic21.DragEnter, pic22.DragEnter _
    , pic23.DragEnter, pic24.DragEnter, pic25.DragEnter, pic26.DragEnter, _
    pic27.DragEnter, pic28.DragEnter, pic29.DragEnter, pic30.DragEnter, _
    pic31.DragEnter, pic32.DragEnter, pic33.DragEnter, pic34.DragEnter, _
    pic35.DragEnter, pic36.DragEnter, pic37.DragEnter, pic38.DragEnter, _
    pic39.DragEnter, pic40.DragEnter, pic41.DragEnter, pic42.DragEnter, _
    pic43.DragEnter, pic44.DragEnter, pic45.DragEnter, pic46.DragEnter, _
    pic47.DragEnter, pic48.DragEnter, pic49.DragEnter, pic50.DragEnter, _
    pic51.DragEnter, pic52.DragEnter, pic53.DragEnter _
    , pic54.DragEnter, pic55.DragEnter, pic56.DragEnter, pic57.DragEnter, _
    pic58.DragEnter, pic59.DragEnter, pic60.DragEnter, pic61.DragEnter, _
    pic62.DragEnter, pic63.DragEnter, pic64.DragEnter, pic65.DragEnter, _
    pic66.DragEnter, pic67.DragEnter, pic68.DragEnter, pic69.DragEnter, _
    pic70.DragEnter, pic71.DragEnter, pic72.DragEnter

        'Check the format of the data being dropped.
        If e.Data.GetDataPresent(DataFormats.Bitmap) Then
            'Checks if the CTRL key is held
            If CBool(e.KeyState And 8) Then
                'Display the copy cursor.
                e.Effect = e.AllowedEffect And DragDropEffects.Copy
            Else
                'Display the move cursor
                e.Effect = e.AllowedEffect And DragDropEffects.Move
            End If
        Else
            'Display the no-drop cursor.
            e.Effect = DragDropEffects.None
        End If

    End Sub
    Private Sub PictureBox_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
    Handles pic1.MouseMove, pic2.MouseMove, _
    pic3.MouseMove, pic4.MouseMove, pic5.MouseMove, pic6.MouseMove, _
    pic7.MouseMove, pic8.MouseMove, pic9.MouseMove, pic10.MouseMove, _
    pic11.MouseMove, pic12.MouseMove, pic13.MouseMove, pic14.MouseMove, _
    pic15.MouseMove, pic16.MouseMove, pic17.MouseMove, pic18.MouseMove, _
    pic19.MouseMove, pic20.MouseMove, pic21.MouseMove, pic22.MouseMove _
    , pic23.MouseMove, pic24.MouseMove, pic25.MouseMove, pic26.MouseMove, _
    pic27.MouseMove, pic28.MouseMove, pic29.MouseMove, pic30.MouseMove, _
    pic31.MouseMove, pic32.MouseMove, pic33.MouseMove, pic34.MouseMove, _
    pic35.MouseMove, pic36.MouseMove, pic37.MouseMove, pic38.MouseMove, _
    pic39.MouseMove, pic40.MouseMove, pic41.MouseMove, pic42.MouseMove, _
    pic43.MouseMove, pic44.MouseMove, pic45.MouseMove, pic46.MouseMove, _
    pic47.MouseMove, pic48.MouseMove, pic49.MouseMove, pic50.MouseMove, _
    pic51.MouseMove, pic52.MouseMove, pic53.MouseMove _
    , pic54.MouseMove, pic55.MouseMove, pic56.MouseMove, pic57.MouseMove, _
    pic58.MouseMove, pic59.MouseMove, pic60.MouseMove, pic61.MouseMove, _
    pic62.MouseMove, pic63.MouseMove, pic64.MouseMove, pic65.MouseMove, _
    pic66.MouseMove, pic67.MouseMove, pic68.MouseMove, pic69.MouseMove, _
    pic70.MouseMove, pic71.MouseMove, pic72.MouseMove


        'Nothing to do if no mouse button is pressed.
        If e.Button = 0 Then Exit Sub

        'Get a reference to the current PictureBox control
        Dim ctlCurrent As PictureBox = DirectCast(sender, PictureBox)

        'If we get here, it means that the mouse is 
        '   being dragged outside the control.

        'Store the image to be drag into a DataObject object
        Dim objDO As New DataObject
        objDO.SetData(DataFormats.Bitmap, ctlCurrent.Image)
        'Starts the drag operation
        Dim effect As DragDropEffects = DragDropEffects.Copy Or DragDropEffects.Move
        effect = ctlCurrent.DoDragDrop(objDO, effect)

        'This portion of code will run after the code has been dropped.
        'Delete the image if it was a move.
        If effect = DragDropEffects.Move Then
            ctlCurrent.Image = Nothing
        End If
    End Sub

Last edited by passel; 12-16-2013 at 09:38 AM. Reason: Added Code tags
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general peer 2 peer game of the general
peer 2 peer game of the general
peer 2 peer game of the general
 
peer 2 peer game of the general
peer 2 peer game of the general
 
-->