fixed firework
This commit is contained in:
parent
3867f40907
commit
fcbfad55a4
|
|
@ -88,7 +88,7 @@ function App() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer">
|
<div className="footer">
|
||||||
<pre>Version: 1.1.0</pre>
|
<pre>Version: 1.1.2</pre>
|
||||||
<pre>
|
<pre>
|
||||||
Made by MasterGordon -{" "}
|
Made by MasterGordon -{" "}
|
||||||
<a target="_blank" href="https://github.com/MasterGordon/minesweeper">
|
<a target="_blank" href="https://github.com/MasterGordon/minesweeper">
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,7 @@ const useGameStore = create<GameState>((set, get) => ({
|
||||||
minesCount: mines,
|
minesCount: mines,
|
||||||
isGameOver: false,
|
isGameOver: false,
|
||||||
startTime: Date.now(),
|
startTime: Date.now(),
|
||||||
|
stage: 1,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
isMine: (x: number, y: number) => {
|
isMine: (x: number, y: number) => {
|
||||||
|
|
@ -259,7 +260,7 @@ const useGameStore = create<GameState>((set, get) => ({
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
triggerPostGame: () => {
|
triggerPostGame: () => {
|
||||||
const { isGameOver, getHasWon, expandBoard } = get();
|
const { getHasWon, expandBoard } = get();
|
||||||
if (getHasWon()) {
|
if (getHasWon()) {
|
||||||
expandBoard();
|
expandBoard();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,13 @@ const Timer = () => {
|
||||||
: game.isGameOver
|
: game.isGameOver
|
||||||
? "😢"
|
? "😢"
|
||||||
: emoteByStage[game.stage] || "😐"}
|
: emoteByStage[game.stage] || "😐"}
|
||||||
{game.getHasWon() && <Confetti mode="boom" particleCount={301} />}
|
{game.stage > 1 && (
|
||||||
|
<Confetti
|
||||||
|
mode="boom"
|
||||||
|
particleCount={20 * game.stage}
|
||||||
|
key={game.stage}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p style={{ width: "100px", textAlign: "right" }}>
|
<p style={{ width: "100px", textAlign: "right" }}>
|
||||||
{Math.max(
|
{Math.max(
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"root":["./src/App.tsx","./src/Button.tsx","./src/Game.ts","./src/GameContext.tsx","./src/GameState.ts","./src/Options.tsx","./src/Timer.tsx","./src/main.tsx","./src/vite-env.d.ts"],"version":"5.6.2"}
|
{"root":["./src/App.tsx","./src/Button.tsx","./src/Game.ts","./src/GameState.ts","./src/Options.tsx","./src/Timer.tsx","./src/main.tsx","./src/vite-env.d.ts"],"version":"5.6.2"}
|
||||||
Loading…
Reference in New Issue