load maps from png files
This commit is contained in:
parent
51334af8c3
commit
6bed7d918f
13 changed files with 86 additions and 61 deletions
|
@ -28,7 +28,7 @@ export default function App() {
|
|||
if (isLoggedIn)
|
||||
return;
|
||||
const result = await postPlayer(nameId);
|
||||
setLoggedIn(result !== null);
|
||||
setLoggedIn(result.ok);
|
||||
}, [nameId, isLoggedIn])();
|
||||
|
||||
return <Column className='flex-grow'>
|
||||
|
@ -43,11 +43,10 @@ export default function App() {
|
|||
</Row>
|
||||
<ClientScreen logout={logout} theme={theme}/>
|
||||
{nameId.name === '' && <JoinForm setNameId={setNameId} clientId={nameId.id}/>}
|
||||
{isLoggedIn && <Row className='GadgetRows'>
|
||||
<Controls playerId={nameId.id} logout={logout}/>
|
||||
<PlayerInfo playerId={nameId.id} logout={logout}/>
|
||||
<Row className='GadgetRows'>
|
||||
{isLoggedIn && <Controls playerId={nameId.id} logout={logout}/>}
|
||||
{isLoggedIn && <PlayerInfo playerId={nameId.id} logout={logout}/>}
|
||||
<Scoreboard/>
|
||||
</Row>
|
||||
}
|
||||
</Column>;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,8 @@ export default function ClientScreen({logout, theme}: { logout: () => void, them
|
|||
sendMessage,
|
||||
getWebSocket
|
||||
} = useWebSocket(import.meta.env.VITE_TANK_SCREEN_URL, {
|
||||
onError: logout
|
||||
onError: logout,
|
||||
shouldReconnect: () => true,
|
||||
});
|
||||
|
||||
const socket = getWebSocket();
|
||||
|
|
|
@ -13,7 +13,8 @@ export default function Controls({playerId, logout}: {
|
|||
getWebSocket,
|
||||
readyState
|
||||
} = useWebSocket(url.toString(), {
|
||||
onError: logout
|
||||
onError: logout,
|
||||
shouldReconnect: () => true,
|
||||
});
|
||||
|
||||
const socket = getWebSocket();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue