Commit 5d3c53d0 authored by Neranga K.T.'s avatar Neranga K.T.

advance screen

parent ce9405ab
......@@ -51,6 +51,18 @@ import MediumGameScreenFive from '../screen/memory/medium/MediumGameScreenFive';
import MediumGameScreenFiveAll from '../screen/memory/medium/MediumGameScreenFiveAll';
import MediumGameScreenSix from '../screen/memory/medium/MediumGameScreenSix';
import MediumGameScreenSixAll from '../screen/memory/medium/MediumGameScreenSixAll';
import AdvanceGameScreenOne from '../screen/memory/advance/AdvanceGameScreenOne';
import AdvanceGameScreenOneAll from '../screen/memory/advance/AdvanceGameScreenOneAll';
import AdvanceGameScreenTwo from '../screen/memory/advance/AdvanceGameScreenTwo';
import AdvanceGameScreenTwoAll from '../screen/memory/advance/AdvanceGameScreenTwoAll';
import AdvanceGameScreenThree from '../screen/memory/advance/AdvanceGameScreenThree';
import AdvanceGameScreenThreeAll from '../screen/memory/advance/AdvanceGameScreenThreeAll';
import AdvanceGameScreenFour from '../screen/memory/advance/AdvanceGameScreenFour';
import AdvanceGameScreenFourAll from '../screen/memory/advance/AdvanceGameScreenFourAll';
import AdvanceGameScreenFive from '../screen/memory/advance/AdvanceGameScreenFive';
import AdvanceGameScreenFiveAll from '../screen/memory/advance/AdvanceGameScreenFiveAll';
import AdvanceGameScreenSix from '../screen/memory/advance/AdvanceGameScreenSix';
import AdvanceGameScreenSixAll from '../screen/memory/advance/AdvanceGameScreenSixAll';
import GameOverScreen from '../screen/memory/GameOverScreen';
import MemoryResult from '../screen/memory/MemoryResult';
import GameLevel from '../screen/memory/GameLevel';
......@@ -303,7 +315,7 @@ const AppRouter = () => {
headerStyle: {backgroundColor: Colors.primary},
}}
/>
<Stack.Screen
<Stack.Screen
options={{headerShown: false}}
name="MediumGameScreenOne"
component={MediumGameScreenOne}
......@@ -363,6 +375,66 @@ const AppRouter = () => {
name="MediumGameScreenSixAll"
component={MediumGameScreenSixAll}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenOne"
component={AdvanceGameScreenOne}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenOneAll"
component={AdvanceGameScreenOneAll}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenTwo"
component={AdvanceGameScreenTwo}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenTwoAll"
component={AdvanceGameScreenTwoAll}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenThree"
component={AdvanceGameScreenThree}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenThreeAll"
component={AdvanceGameScreenThreeAll}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenFour"
component={AdvanceGameScreenFour}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenFourAll"
component={AdvanceGameScreenFourAll}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenFive"
component={AdvanceGameScreenFive}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenFiveAll"
component={AdvanceGameScreenFiveAll}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenSix"
component={AdvanceGameScreenSix}
/>
<Stack.Screen
options={{headerShown: false}}
name="AdvanceGameScreenSixAll"
component={AdvanceGameScreenSixAll}
/>
<Stack.Screen
options={{headerShown: false}}
name="PrimaryType"
......
import React from 'react';
import {View,Text, StyleSheet, Button} from 'react-native';
const AdvanceLevelStart = () => {
const AdvanceLevelStart = ({navigation}) => {
return(
<View style={styles.screen}>
<Text>Advance Level Start</Text>
<Button title='Start' onPress={()=>{}} />
<Button title='Start' onPress={()=>{navigation.navigate('AdvanceGameScreenOne')}} />
</View>
);
}
......
......@@ -3,7 +3,7 @@ import {View, Text, StyleSheet, Image} from 'react-native';
import CountDown from 'react-native-countdown-component';
import Countdown from '../../../constants/Countdown';
const GameScreenFive = ({navigation}) => {
const AdvanceGameScreenFive = ({navigation}) => {
return(
<View style={styles.sreen}>
......@@ -16,9 +16,9 @@ const GameScreenFive = ({navigation}) => {
</View>
<CountDown
size={40}
until={Countdown.elementry}
until={Countdown.advance}
// onFinish={() => alert('Finished')}
onFinish={() => navigation.navigate('GameScreenFiveAll')}
onFinish={() => navigation.navigate('AdvanceGameScreenFiveAll')}
digitStyle={{backgroundColor: '#FFF', borderWidth: 2, borderColor: '#1CC625'}}
digitTxtStyle={{color: '#1CC625'}}
timeLabelStyle={{color: 'red', fontWeight: 'bold'}}
......@@ -66,4 +66,4 @@ const GameScreenFive = ({navigation}) => {
}
});
export default GameScreenFive;
\ No newline at end of file
export default AdvanceGameScreenFive;
\ No newline at end of file
......@@ -6,7 +6,7 @@ import { SCREEN5 } from '../../../memory/data/elementry-level';
let gameData = SCREEN5.sort((item)=>Math.random(item.id)-0.5);
const GameScreenFiveAll = ({navigation}) => {
const AdvanceGameScreenFiveAll = ({navigation}) => {
const shuffle = () => {
gameData = SCREEN5.sort((item)=>Math.random(item.id)-0.5);
......@@ -38,7 +38,7 @@ const GameScreenFiveAll = ({navigation}) => {
const renderImageItem = (itemData) => {
return(
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('GameScreenSix')}}>
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('AdvanceGameScreenSix')}}>
<Image style={styles.image} source={itemData.item.source}/>
</TouchableOpacity>
)
......@@ -87,4 +87,4 @@ const styles = StyleSheet.create({
});
export default GameScreenFiveAll;
\ No newline at end of file
export default AdvanceGameScreenFiveAll;
\ No newline at end of file
......@@ -3,13 +3,7 @@ import {View, Text, StyleSheet, Image} from 'react-native';
import CountDown from 'react-native-countdown-component';
import Countdown from '../../../constants/Countdown';
const GameScreenFour = ({navigation}) => {
useEffect(()=>{
setTimeout( () => {
navigation.navigate('GameScreenFourAll');
}, 5000 );
});
const AdvanceGameScreenFour = ({navigation}) => {
return(
<View style={styles.sreen}>
......@@ -23,9 +17,9 @@ const GameScreenFour = ({navigation}) => {
<Text style={styles.imageText}>Car - කාරය</Text>
<CountDown
size={40}
until={Countdown.elementry}
until={Countdown.advance}
// onFinish={() => alert('Finished')}
onFinish={() => navigation.navigate('GameScreenFourAll')}
onFinish={() => navigation.navigate('AdvanceGameScreenFourAll')}
digitStyle={{backgroundColor: '#FFF', borderWidth: 2, borderColor: '#1CC625'}}
digitTxtStyle={{color: '#1CC625'}}
timeLabelStyle={{color: 'red', fontWeight: 'bold'}}
......@@ -72,4 +66,4 @@ const GameScreenFour = ({navigation}) => {
}
});
export default GameScreenFour;
\ No newline at end of file
export default AdvanceGameScreenFour;
\ No newline at end of file
......@@ -6,7 +6,7 @@ import { SCREEN4 } from '../../../memory/data/elementry-level';
let gameData = SCREEN4.sort((item)=>Math.random(item.id)-0.5);
const GameScreenFourAll = ({navigation}) => {
const AdvanceGameScreenFourAll = ({navigation}) => {
const shuffle = () => {
gameData = SCREEN4.sort((item)=>Math.random(item.id)-0.5);
......@@ -38,7 +38,7 @@ const GameScreenFourAll = ({navigation}) => {
const renderImageItem = (itemData) => {
return(
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('GameScreenFive')}}>
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('AdvanceGameScreenFive')}}>
<Image style={styles.image} source={itemData.item.source}/>
</TouchableOpacity>
)
......@@ -87,4 +87,4 @@ const styles = StyleSheet.create({
});
export default GameScreenFourAll;
\ No newline at end of file
export default AdvanceGameScreenFourAll;
\ No newline at end of file
......@@ -7,7 +7,7 @@ import * as memoryActions from '../../../store/actions/memory';
import Levels from '../../../constants/Levels';
import Countdown from '../../../constants/Countdown';
const GameScreenOne = ({navigation}) => {
const AdvanceGameScreenOne = ({navigation}) => {
// useEffect(()=>{
// const backHandler = BackHandler.addEventListener('hardwareBackPress', () => true)
......@@ -17,7 +17,7 @@ const GameScreenOne = ({navigation}) => {
const dispatch = useDispatch();
useEffect(()=>{
dispatch(memoryActions.setGameLevel(Levels.elementry))
dispatch(memoryActions.setGameLevel(Levels.advance))
})
return(
......@@ -32,9 +32,9 @@ const GameScreenOne = ({navigation}) => {
<Text style={styles.imageText}>Pencil - පැන්සල</Text>
<CountDown
size={40}
until={Countdown.elementry}
until={Countdown.advance}
// onFinish={() => alert('Finished')}
onFinish={() => navigation.navigate('GameScreenOneAll')}
onFinish={() => navigation.navigate('AdvanceGameScreenOneAll')}
digitStyle={{backgroundColor: '#FFF', borderWidth: 2, borderColor: '#1CC625'}}
digitTxtStyle={{color: '#1CC625'}}
timeLabelStyle={{color: 'red', fontWeight: 'bold'}}
......@@ -81,4 +81,4 @@ const styles = StyleSheet.create({
}
});
export default GameScreenOne;
\ No newline at end of file
export default AdvanceGameScreenOne;
\ No newline at end of file
......@@ -6,7 +6,7 @@ import { SCREEN1 } from '../../../memory/data/elementry-level';
let gameData = SCREEN1.sort((item)=>Math.random(item.id)-0.5);
const GameScreenOneAll = ({navigation}) => {
const AdvanceGameScreenOneAll = ({navigation}) => {
const shuffle = () => {
gameData = SCREEN1.sort((item)=>Math.random(item.id)-0.5);
......@@ -38,7 +38,7 @@ const GameScreenOneAll = ({navigation}) => {
const renderImageItem = (itemData) => {
return(
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = [];navigation.navigate('GameScreenTwo')}}>
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = [];navigation.navigate('AdvanceGameScreenTwo')}}>
<Image style={styles.image} source={itemData.item.source}/>
</TouchableOpacity>
)
......@@ -86,4 +86,4 @@ const styles = StyleSheet.create({
});
export default GameScreenOneAll;
\ No newline at end of file
export default AdvanceGameScreenOneAll;
\ No newline at end of file
......@@ -3,7 +3,7 @@ import {View, Text, StyleSheet, Image} from 'react-native';
import CountDown from 'react-native-countdown-component';
import Countdown from '../../../constants/Countdown';
const GameScreenSix = ({navigation}) => {
const AdvanceGameScreenSix = ({navigation}) => {
return(
<View style={styles.sreen}>
......@@ -17,9 +17,9 @@ const GameScreenSix = ({navigation}) => {
<Text style={styles.imageText}>Pencil - පැන්සල</Text>
<CountDown
size={40}
until={Countdown.elementry}
until={Countdown.advance}
// onFinish={() => alert('Finished')}
onFinish={() => navigation.navigate('GameScreenSixAll')}
onFinish={() => navigation.navigate('AdvanceGameScreenSixAll')}
digitStyle={{backgroundColor: '#FFF', borderWidth: 2, borderColor: '#1CC625'}}
digitTxtStyle={{color: '#1CC625'}}
timeLabelStyle={{color: 'red', fontWeight: 'bold'}}
......@@ -66,4 +66,4 @@ const GameScreenSix = ({navigation}) => {
}
});
export default GameScreenSix;
\ No newline at end of file
export default AdvanceGameScreenSix;
\ No newline at end of file
......@@ -6,7 +6,7 @@ import { SCREEN6 } from '../../../memory/data/elementry-level';
let gameData = SCREEN6.sort((item)=>Math.random(item.id)-0.5);
const GameScreenSixAll = ({navigation}) => {
const AdvanceGameScreenSixAll = ({navigation}) => {
const shuffle = () => {
gameData = SCREEN6.sort((item)=>Math.random(item.id)-0.5);
......@@ -87,4 +87,4 @@ const styles = StyleSheet.create({
});
export default GameScreenSixAll;
\ No newline at end of file
export default AdvanceGameScreenSixAll;
\ No newline at end of file
......@@ -3,7 +3,7 @@ import {View, Text, StyleSheet, Image} from 'react-native';
import CountDown from 'react-native-countdown-component';
import Countdown from '../../../constants/Countdown';
const GameScreenThree = ({navigation}) => {
const AdvanceGameScreenThree = ({navigation}) => {
return(
<View style={styles.sreen}>
......@@ -17,9 +17,9 @@ const GameScreenThree = ({navigation}) => {
<Text style={styles.imageText}>Flower - මල</Text>
<CountDown
size={40}
until={Countdown.elementry}
until={Countdown.advance}
// onFinish={() => alert('Finished')}
onFinish={() => navigation.navigate('GameScreenThreeAll')}
onFinish={() => navigation.navigate('AdvanceGameScreenThreeAll')}
digitStyle={{backgroundColor: '#FFF', borderWidth: 2, borderColor: '#1CC625'}}
digitTxtStyle={{color: '#1CC625'}}
timeLabelStyle={{color: 'red', fontWeight: 'bold'}}
......@@ -66,4 +66,4 @@ const GameScreenThree = ({navigation}) => {
}
});
export default GameScreenThree;
\ No newline at end of file
export default AdvanceGameScreenThree;
\ No newline at end of file
......@@ -6,7 +6,7 @@ import { SCREEN3 } from '../../../memory/data/elementry-level';
let gameData = SCREEN3.sort((item)=>Math.random(item.id)-0.5);
const GameScreenThreeAll = ({navigation}) => {
const AdvanceGameScreenThreeAll = ({navigation}) => {
const shuffle = () => {
gameData = SCREEN3.sort((item)=>Math.random(item.id)-0.5);
......@@ -38,7 +38,7 @@ const GameScreenThreeAll = ({navigation}) => {
const renderImageItem = (itemData) => {
return(
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('GameScreenFour')}}>
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('AdvanceGameScreenFour')}}>
<Image style={styles.image} source={itemData.item.source}/>
</TouchableOpacity>
)
......@@ -87,4 +87,4 @@ const styles = StyleSheet.create({
});
export default GameScreenThreeAll;
\ No newline at end of file
export default AdvanceGameScreenThreeAll;
\ No newline at end of file
......@@ -3,7 +3,7 @@ import {View, Text, StyleSheet, Image} from 'react-native';
import CountDown from 'react-native-countdown-component';
import Countdown from '../../../constants/Countdown';
const GameScreenTwo = ({navigation}) => {
const AdvanceGameScreenTwo = ({navigation}) => {
return(
<View style={styles.sreen}>
......@@ -17,9 +17,9 @@ const GameScreenTwo = ({navigation}) => {
<Text style={styles.imageText}>Ball - බෝලය</Text>
<CountDown
size={40}
until={Countdown.elementry}
until={Countdown.advance}
// onFinish={() => alert('Finished')}
onFinish={() => navigation.navigate('GameScreenTwoAll')}
onFinish={() => navigation.navigate('AdvanceGameScreenTwoAll')}
digitStyle={{backgroundColor: '#FFF', borderWidth: 2, borderColor: '#1CC625'}}
digitTxtStyle={{color: '#1CC625'}}
timeLabelStyle={{color: 'red', fontWeight: 'bold'}}
......@@ -66,4 +66,4 @@ const GameScreenTwo = ({navigation}) => {
}
});
export default GameScreenTwo;
\ No newline at end of file
export default AdvanceGameScreenTwo;
\ No newline at end of file
......@@ -7,7 +7,7 @@ import { SCREEN2 } from '../../../memory/data/elementry-level';
let gameData = SCREEN2.sort((item)=>Math.random(item.id)-0.5);
const GameScreenTwoAll = ({navigation}) => {
const AdvanceGameScreenTwoAll = ({navigation}) => {
const shuffle = () => {
gameData = SCREEN2.sort((item)=>Math.random(item.id)-0.5);
......@@ -39,7 +39,7 @@ const GameScreenTwoAll = ({navigation}) => {
const renderImageItem = (itemData) => {
return(
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('GameScreenThree')}}>
<TouchableOpacity activeOpacity={0.7} style={styles.imageItem} onPress={()=>{dispatch(memoryActions.setAnswers({question: itemData.item.question, answer: itemData.item.answer})); setTimeOn(false); dispatch(memoryActions.setTime({question: itemData.item.question, time: time})); gameData = []; navigation.navigate('AdvanceGameScreenThree')}}>
<Image style={styles.image} source={itemData.item.source}/>
</TouchableOpacity>
)
......@@ -88,4 +88,4 @@ const styles = StyleSheet.create({
});
export default GameScreenTwoAll;
\ No newline at end of file
export default AdvanceGameScreenTwoAll;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment