Merge branch 'main' of github.com:Kum1ta/PTME_Transcendence
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
# By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2024/09/13 16:20:58 by tomoron #+# #+# #
|
||||
# Updated: 2024/09/16 14:03:03 by tomoron ### ########.fr #
|
||||
# Updated: 2024/09/16 14:16:03 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@ -92,7 +92,7 @@ class Game:
|
||||
self.p2.sync_send(data_raw)
|
||||
|
||||
def move(self, socket, pos, up):
|
||||
opponent = p1 if socket != p1 else p2
|
||||
opponent = self.p1 if socket != self.p1 else self.p2
|
||||
opponent.sync_send({"type":"game","content":{"action":3, "pos":pos, "up":up}})
|
||||
|
||||
async def gameLoop(self):
|
||||
|
@ -6,13 +6,13 @@
|
||||
# By: tomoron <tomoron@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2024/09/16 13:54:55 by tomoron #+# #+# #
|
||||
# Updated: 2024/09/16 14:03:09 by tomoron ### ########.fr #
|
||||
# Updated: 2024/09/16 14:18:04 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
def move(socket, content):
|
||||
async def move(socket, content):
|
||||
up = content.get("up", False)
|
||||
pos = content.get("pos", None)
|
||||
if(pos == None):
|
||||
return;
|
||||
socket.game.move(socket, up, pos)
|
||||
socket.game.move(socket, pos, up)
|
||||
|
Reference in New Issue
Block a user