feat:(game) added a reset button to avoid reload

pull/3/head
Alex 2024-02-02 11:41:44 +01:00
parent f22f19590d
commit 51c2f3f8f8
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@ export const PlayerController = () => {
const rightPressed = useKeyboardControls((state) => state[Controls.right]);
const jumpPressed = useKeyboardControls((state) => state[Controls.jump]);
const shootPressed = useKeyboardControls((state) => state[Controls.shoot]);
const resetPressed = useKeyboardControls((state) => state[Controls.reset]);
const [isOnGround, setIsOnGround] = useState(false);
const body = useRef();
@ -394,6 +395,11 @@ export const PlayerController = () => {
// MISC
if(resetPressed) {
body.current.setTranslation({x: 8, y: 2, z: -119});
}
// ITEMS