Results 1 to 12 of 12

Thread: Online Game <help please>

Hybrid View

  1. #1
    Lively Member
    Join Date
    Jan 2007
    Posts
    95

    Re: Online Game <help please>

    naaH! i'm also new to winsock... but i think this will not work... cyou have to send data in some other way..like this
    Winsock1.senddata "movechar|-10"
    because, the only recieve and sends messages...
    you can use these messages as commands
    you have to add a function that, when a player press left button, the winsock sends this message: "movechar|player1|-10"
    then you have to make another function wich will read the message, if the msg is a command it will move the character otherwise it will print the message to the chat box...i think i have not clear the ...

    let me try once again in rough coding

    function left_btn_onPress()
    {
    winsock.senddate "movechar|player1|-10" // if the user is player 2, change it to two
    }

    function right_btn_onPress()
    {
    winsock.senddate "movechar|player1|10"
    }

    function winsock_onRecieveData()
    {
    if data.startswith("movechar|") then
    data = split data with '|', (the first will be 'movechar', second you will get the player, and third u will get the distance to move. understand??)
    data[1] will be player
    data[2] will be the distance (u can use it like this: Label[data[1]].Top = Label[data[1]].Top + data[2] )

    elseif
    chatbox.text = chatbox.text + "\n" + data
    endif
    }

    this is just to give you the idea.... you can you your chatting program as the command sending program as well as chatting program

    dont forget to rate if the idea is good!
    Last edited by extreme.aly; Jun 13th, 2007 at 02:52 PM.

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