Update basic Game code

This commit is contained in:
nickofolas 2022-04-24 14:38:39 -05:00
parent ab034f6f1a
commit 217f6d1e57

@ -1,19 +1,17 @@
import { use } from "../../ui/Context"; import { Button, Container, Paper, Typography } from "@mui/material";
import React, { useState } from "react"; import React, { useState } from "react";
import Grid from "@mui/material/Grid"; import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
import Button from "@mui/material/Button"; import { use } from "../../ui/Context";
import { Countdown } from "./Countdown";
import { BracketGame } from "./BracketGame";
import { SlashGame } from "./SlashGame";
import { BackwardGame } from "./BackwardGame"; import { BackwardGame } from "./BackwardGame";
import { BracketGame } from "./BracketGame";
import { BribeGame } from "./BribeGame"; import { BribeGame } from "./BribeGame";
import { CheatCodeGame } from "./CheatCodeGame"; import { CheatCodeGame } from "./CheatCodeGame";
import { Countdown } from "./Countdown";
import { Cyberpunk2077Game } from "./Cyberpunk2077Game"; import { Cyberpunk2077Game } from "./Cyberpunk2077Game";
import { MinesweeperGame } from "./MinesweeperGame"; import { MinesweeperGame } from "./MinesweeperGame";
import { WireCuttingGame } from "./WireCuttingGame"; import { SlashGame } from "./SlashGame";
import { Victory } from "./Victory"; import { Victory } from "./Victory";
import Typography from "@mui/material/Typography"; import { WireCuttingGame } from "./WireCuttingGame";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
interface IProps { interface IProps {
StartingDifficulty: number; StartingDifficulty: number;
@ -113,7 +111,7 @@ export function Game(props: IProps): React.ReactElement {
stageComponent = <Countdown onFinish={() => setStage(Stage.Minigame)} />; stageComponent = <Countdown onFinish={() => setStage(Stage.Minigame)} />;
break; break;
case Stage.Minigame: { case Stage.Minigame: {
const MiniGame = minigames[gameIds.id]; const MiniGame = SlashGame; // minigames[gameIds.id];
stageComponent = <MiniGame onSuccess={success} onFailure={failure} difficulty={props.Difficulty + level / 50} />; stageComponent = <MiniGame onSuccess={success} onFailure={failure} difficulty={props.Difficulty + level / 50} />;
break; break;
} }
@ -139,22 +137,18 @@ export function Game(props: IProps): React.ReactElement {
} }
return ( return (
<> <Container>
<Grid container spacing={3}> <Paper sx={{ p: 1, mb: 1, display: "grid", justifyItems: "center", gap: 1 }}>
<Grid item xs={3}> <Button sx={{ width: "100%" }} onClick={cancel}>
<Button onClick={cancel}>Cancel</Button> Cancel
</Grid> </Button>
<Grid item xs={3}> <Typography variant="h5">
<Typography> Level {level} / {props.MaxLevel}
Level: {level}&nbsp;/&nbsp;{props.MaxLevel} </Typography>
</Typography> <Progress />
<Progress /> </Paper>
</Grid>
<Grid item xs={12}> {stageComponent}
{stageComponent} </Container>
</Grid>
</Grid>
</>
); );
} }