|
|
@ -79,7 +79,16 @@ function Game(props){ |
|
|
|
scrollDestination.current = newDestination; |
|
|
|
challengeState.current = challengeState.current + 1; |
|
|
|
setScrollOrigin(newOrigin); |
|
|
|
|
|
|
|
if (challengeState.current >= 20) { |
|
|
|
completeChallenge(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function completeChallenge(){ |
|
|
|
clearInterval(localTimer.current); |
|
|
|
setTimerState(4); |
|
|
|
} |
|
|
|
|
|
|
|
function generateSquare(pairIndex){ |
|
|
@ -153,8 +162,18 @@ function Game(props){ |
|
|
|
destination={scrollDestination.current} |
|
|
|
duration={250} |
|
|
|
> |
|
|
|
<View style={[styles.gameStart]} /> |
|
|
|
<View style={[styles.gameView]} /> |
|
|
|
{squareMemo} |
|
|
|
<View style={[styles.gameView, styles.flexRow, styles.spaceEvenly, styles.centeredItems]}> |
|
|
|
<MaterialIcon |
|
|
|
name={Icons.squareIcons.check} |
|
|
|
color={Colors.material.green800} |
|
|
|
size={Metrics.icons.buttonIcon} |
|
|
|
/> |
|
|
|
<Text style={[styles.headerTitleFont, styles.greyText]}> |
|
|
|
Finish |
|
|
|
</Text> |
|
|
|
</View> |
|
|
|
</Autoscroll> |
|
|
|
</View> |
|
|
|
</SafeAreaView> |
|
|
|