Skip to content

Commit d5f93bc

Browse files
committed
Reset lives when starting a new game to prevent inheriting state from previous game
1 parent c607d67 commit d5f93bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/game/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const App: React.FC<AppProps> = ({
176176
onStartGame={(level: number) => {
177177
// Reset ship and sound to clean state
178178
dispatch(shipSlice.actions.resetShip())
179+
dispatch(shipSlice.actions.resetLives())
179180

180181
// Invalidate high score if starting at level > 1
181182
if (level > 1) {

0 commit comments

Comments
 (0)