Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Added victory conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
browntj16 committed Apr 28, 2024
1 parent 09dd450 commit 242ff3d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,10 @@ function GameBoard({ game, setBegin }: { game: Game, setBegin: any}) {
}
let vicButtons = <></>
if(player1.hp <= 0){
vicButtons =
vicButtons = <VictoryButtons winnerPlayer={player1} stateChange={setBegin}></VictoryButtons>
}
else if(player2.hp <= 0){

vicButtons= <VictoryButtons winnerPlayer={player2} stateChange={setBegin}></VictoryButtons>
}

return (
Expand Down Expand Up @@ -557,7 +557,7 @@ function AttackingButtons({player, game, reset, resetState}: {player: Player, ga
)
}

function victoryButtons({winnerPlayer, stateChange}: {winnerPlayer: Player, stateChange: any}){
function VictoryButtons({winnerPlayer, stateChange}: {winnerPlayer: Player, stateChange: any}){
function handleClick(){
stateChange(false);
}
Expand Down Expand Up @@ -642,6 +642,7 @@ function App() {
let h = function () {
setBegin(true);
};

let page = <></>;
if (begin) {
let game = new Game();
Expand Down

0 comments on commit 242ff3d

Please sign in to comment.