[help] movement direction client server

For questions about using Classic.

Post » Mon Jan 31, 2011 8:31 am

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
[code:1lgq263f]# 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? :cry:

Uploaded with ImageShack.us


Uploaded with ImageShack.us
B
1
G
1
Posts: 1
Reputation: 427

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests