[help] movement direction client server

This forum is currently in read-only mode.
  • i'm having problem about my game at movement direction . i want develop using client server architecture so this is a sample code at server side

    # function to manage  movement
       def Network_move(self, data):
          if ((data['player'] == 1) and (System.globalvar("myPlayer") != 1)):
             player1.SetPosition(data['playerx'],data['playery'])   
          elif ((data['player'] == 2) and (System.globalvar("myPlayer") != 2)):
             player2.SetPosition(data['playerx'],data['playery'])[/code:1lgq263f]
    this is at client side
    [code:1lgq263f]if System.globalvar('myPlayer') == 1:
       connection.Send({'action': 'move', 'player': 1, 'playerx': player1.X, 'playery': player1.Y})
    else:
       connection.Send({'action': 'move', 'player': 2, 'playerx': player2.X, 'playery': player2.Y})
    
    connection.Pump()
    myclient.Pump()[/code:1lgq263f]
    
    maybe this pict can show my problem. any can help?  
    
    Uploaded with [url=http://imageshack.us]ImageShack.us[/url]
    [url=http://img593.imageshack.us/i/25477973.jpg/][/url]
    
    Uploaded with [url=http://imageshack.us]ImageShack.us[/url]
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)