diff --git a/squarenotsquare/src/screens/Game.js b/squarenotsquare/src/screens/Game.js index 8ae9dfb..d8533cb 100644 --- a/squarenotsquare/src/screens/Game.js +++ b/squarenotsquare/src/screens/Game.js @@ -5,6 +5,7 @@ import {genSquareChallenge} from '../libs/Random'; import {shapes} from '../libs/ShapeEnum'; import { styles } from "./styles/AppStyles"; import Autoscroll from "../components/Autoscroll"; +import Fade from "../components/Fade"; import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icons from '../themes/Icons'; import Colors from "../themes/Colors"; @@ -13,8 +14,8 @@ import Metrics from "../themes/Metrics"; function Game(props){ const squareChallenge = useRef(genSquareChallenge()); - const squareMemo = useMemo(renderPairs, [squareChallenge]); const challengeState = useRef(0); + const squareMemo = useMemo(renderPairs, [challengeState.current]); const [timerState, setTimerState] = useState(0); const localTimer = useRef(null); const startTime = useRef(0); @@ -113,17 +114,21 @@ function Game(props){ function generatePair(answer, shapeIndex, pairIndex) { if (answer === 0) { return ( - - {generateSquare(pairIndex)} - {generateShape(shapeIndex, pairIndex)} - + + + {generateSquare(pairIndex)} + {generateShape(shapeIndex, pairIndex)} + + ); } else { return ( - - {generateShape(shapeIndex, pairIndex)} - {generateSquare(pairIndex)} - + + + {generateShape(shapeIndex, pairIndex)} + {generateSquare(pairIndex)} + + ); } }