mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
18 lines
556 B
JavaScript
18 lines
556 B
JavaScript
"use client";
|
|
|
|
import { useSocket } from "@/context/socketContext";
|
|
import { useTeamConnexion } from "@/context/teamConnexionContext";
|
|
import { useTeamContext } from "@/context/teamContext";
|
|
|
|
export default function useGame() {
|
|
const {teamSocket} = useSocket();
|
|
const {teamId} = useTeamConnexion();
|
|
const {currentPosition, enemyPosition, gameState} = useTeamContext();
|
|
|
|
function sendCurrentPosition() {
|
|
teamSocket.emit("send_position");
|
|
}
|
|
|
|
|
|
return { sendCurrentPosition, enemyPosition, currentPosition, teamId, gameState};
|
|
} |