diff --git a/src/template/Sections.jsx b/src/template/Sections.jsx index 3978684..64fac6d 100644 --- a/src/template/Sections.jsx +++ b/src/template/Sections.jsx @@ -75,10 +75,18 @@ export function Section2() { class GenerateBombOverlay extends React.Component { constructor(props) { super(props); - let bombCoords = this.generateCoords(props.amount); + let bombCoords = this.generateCoords(this.ifOver(props.amount)); this.state = {coords: bombCoords, color: props.color}; } + ifOver(amt) { + if (amt > 100) { + return 100; + } else { + return amt; + } + } + generateCoords(amt) { let bombCoords = []; for (let i = 0; i < amt; i++) { @@ -95,7 +103,7 @@ class GenerateBombOverlay extends React.Component { componentDidUpdate(prevProps) { if (this.props.amount !== prevProps.amount) { - let bombCoords = this.generateCoords(this.props.amount); + let bombCoords = this.generateCoords(this.ifOver(this.props.amount)); this.setState({ coords: bombCoords }); @@ -137,13 +145,13 @@ class GameMap extends React.Component { render() { return ( <> -

Game Map

+

Metaverse Map

@@ -152,7 +160,7 @@ class GameMap extends React.Component { - +