From f9adcafc6ecf145005e2dc9dac4df27edf53e05b Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 29 Dec 2022 23:50:08 -0800 Subject: [PATCH] some improvements --- src/template/Sections.jsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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 { - +