Commit 40dd8cbc authored by Neranga K.T.'s avatar Neranga K.T.

.

parent 727fd1bd
export default { export default {
elementry: 7, elementry: 2,
medium: 5, medium: 5,
advance: 2 advance: 2
} }
\ No newline at end of file
import { Center, Column, Row } from 'native-base'; import { Center, Column, Row } from 'native-base';
import React from 'react'; import React, {useState} from 'react';
import {Text, View, StyleSheet, Button, ScrollView, Image,ImageBackground, TouchableOpacity} from 'react-native'; import {Text, View, StyleSheet, Button, ScrollView, Image,ImageBackground, TouchableOpacity, Modal, Alert, Pressable} from 'react-native';
import MainButton from '../../component/memory/MainButton'; import MainButton from '../../component/memory/MainButton';
const GameLevel = ({navigation}) => { const GameLevel = ({navigation}) => {
const [modalVisible, setModalVisible] = useState(false);
const [mediumModalVisible, setMediumModalVisible] = useState(false);
return ( return (
<ScrollView> <ScrollView>
{/* <Image style={styles.image} source={{ uri: 'https://cdn.pixabay.com/photo/2014/09/21/21/31/flowers-455591_960_720.jpg' }} /> */} <Modal
animationType="slide"
transparent={true}
visible={modalVisible}
onRequestClose={() => {
Alert.alert("Modal has been closed.");
setModalVisible(!modalVisible);
}}
>
<View style={styles.centeredView}>
<View style={styles.modalView}>
<Text style={styles.modalText}>Please select matching images</Text>
<View style={{ flexDirection: 'row' }} >
<Pressable
style={[styles.button, styles.buttonClose]}
onPress={() => {setModalVisible(!modalVisible); navigation.navigate('GameScreenOne'); }}
>
<Text style={styles.textStyle}>Start</Text>
</Pressable>
<Pressable
style={[styles.button, styles.buttonClose]}
onPress={() => {setModalVisible(!modalVisible)}}
>
<Text style={styles.textStyle}>Cancel</Text>
</Pressable>
</View>
</View>
</View>
</Modal>
<Modal
animationType="slide"
transparent={true}
visible={mediumModalVisible}
onRequestClose={() => {
Alert.alert("Modal has been closed.");
setModalVisible(!mediumModalVisible);
}}
>
<View style={styles.centeredView}>
<View style={styles.modalView}>
<Text style={styles.modalText}>Please select matching images</Text>
<View style={{ flexDirection: 'row' }} >
<Pressable
style={[styles.button, styles.buttonClose]}
onPress={() => {setModalVisible(!mediumModalVisible); navigation.navigate('MediumGameScreenOne'); }}
>
<Text style={styles.textStyle}>Start</Text>
</Pressable>
<Pressable
style={[styles.button, styles.buttonClose]}
onPress={() => {setModalVisible(!mediumModalVisible)}}
>
<Text style={styles.textStyle}>Cancel</Text>
</Pressable>
</View>
</View>
</View>
</Modal>
<View style={{ marginBottom: 20 }}> <View style={{ marginBottom: 20 }}>
<View style={styles.gameItemRow}> <View style={styles.gameItemRow}>
<ImageBackground source={{ uri: 'https://cdn.pixabay.com/photo/2014/09/21/21/31/flowers-455591_960_720.jpg' }} <ImageBackground source={{ uri: 'https://cdn.pixabay.com/photo/2014/09/21/21/31/flowers-455591_960_720.jpg' }}
...@@ -19,10 +79,11 @@ const GameLevel = ({navigation}) => { ...@@ -19,10 +79,11 @@ const GameLevel = ({navigation}) => {
</View> </View>
</View> </View>
<View style={styles.screen} > <View style={styles.screen} >
<MainButton styles={styles.elementryBtn} onPress={()=>{navigation.navigate('StartGameScreen')}}> <MainButton styles={styles.elementryBtn} onPress={() => setModalVisible(true)}>
Elementry Elementry
</MainButton> </MainButton>
<MainButton styles={styles.mediumBtn} onPress={()=>{navigation.navigate('MediumLevelStart')}}> <MainButton styles={styles.mediumBtn} onPress={()=>{setMediumModalVisible(true)}}>
{/* navigation.navigate('MediumLevelStart') */}
Medium Medium
</MainButton> </MainButton>
<MainButton styles={styles.advanceBtn} onPress={()=>{navigation.navigate('AdvanceLevelStart')}}> <MainButton styles={styles.advanceBtn} onPress={()=>{navigation.navigate('AdvanceLevelStart')}}>
...@@ -94,6 +155,51 @@ const styles = StyleSheet.create({ ...@@ -94,6 +155,51 @@ const styles = StyleSheet.create({
gameItemRow: { gameItemRow: {
flexDirection: 'row', flexDirection: 'row',
}, },
centeredView: {
flex: 1,
justifyContent: "center",
alignItems: "center",
marginTop: 22
},
modalView: {
margin: 20,
backgroundColor: "white",
borderRadius: 20,
padding: 35,
alignItems: "center",
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 2
},
shadowOpacity: 0.25,
shadowRadius: 4,
elevation: 5
},
button: {
borderRadius: 20,
padding: 10,
elevation: 2,
marginHorizontal: 10
},
buttonOpen: {
backgroundColor: "#F194FF",
},
buttonClose: {
backgroundColor: "#2196F3",
},
textStyle: {
color: "white",
fontWeight: "bold",
textAlign: "center",
fontSize: 20
},
modalText: {
marginBottom: 15,
textAlign: "center",
fontSize: 20
}
}); });
export default GameLevel; export default GameLevel;
......
...@@ -61,11 +61,11 @@ const GameOverScreen = ({navigation}) => { ...@@ -61,11 +61,11 @@ const GameOverScreen = ({navigation}) => {
} }
if(data>=3.0){ if(data>=3.0){
disorderLevel = 'High' disorderLevel = 'High';
}else if (data>=1.5) { }else if (data>=1.5) {
disorderLevel = 'Medium' disorderLevel = 'Medium';
} else { } else {
disorderLevel = 'low' disorderLevel = 'low';
} }
const insertData = () => { const insertData = () => {
...@@ -89,8 +89,11 @@ const GameOverScreen = ({navigation}) => { ...@@ -89,8 +89,11 @@ const GameOverScreen = ({navigation}) => {
if(!loading){ if(!loading){
insertData(); insertData();
resultText=( resultText=(
// <Text style={styles.resultText}>
// <Text>Child's disorder level is </Text> <Text style={styles.highlight}>{disorderLevel}</Text>
// </Text>
<Text style={styles.resultText}> <Text style={styles.resultText}>
<Text>Child's disorder level is </Text> <Text style={styles.highlight}>{disorderLevel}</Text> {disorderLevel == 'High' ? `Hmm...It looks like you have to keep remember more...` : disorderLevel == 'Medium' ? `Hey...nicely played! Good!` : 'Wow! You are Excellent!'}
</Text> </Text>
); );
} }
...@@ -101,7 +104,7 @@ const GameOverScreen = ({navigation}) => { ...@@ -101,7 +104,7 @@ const GameOverScreen = ({navigation}) => {
<View style={styles.imageContainer}> <View style={styles.imageContainer}>
<Image <Image
fadeDuration={1000} fadeDuration={1000}
source={require('../../memory/images/assets/success.png')} source={require('../../memory/images/assets/navo2.png')}
style={styles.image} style={styles.image}
/> />
</View> </View>
...@@ -125,10 +128,10 @@ const styles = StyleSheet.create({ ...@@ -125,10 +128,10 @@ const styles = StyleSheet.create({
imageContainer: { imageContainer: {
width: '80%', width: '80%',
height: 300, height: 300,
borderColor: 'black', // borderColor: 'black',
borderWidth: 2, // borderWidth: 2,
borderRadius: 200, borderRadius: 200,
overflow: 'hidden', // overflow: 'hidden',
marginVertical: 30 marginVertical: 30
}, },
image : { image : {
...@@ -150,7 +153,8 @@ const styles = StyleSheet.create({ ...@@ -150,7 +153,8 @@ const styles = StyleSheet.create({
}, },
resultText: { resultText: {
textAlign: 'center', textAlign: 'center',
fontSize: 18 fontSize: 22,
fontWeight: 'bold'
} }
}); });
......
import React from 'react'; import React from 'react';
import {Text, View, StyleSheet, Button} from 'react-native'; import {Text, View, StyleSheet, Button, Image, ImageBackground} from 'react-native';
const StartGameScreen = ({navigation}) => { const StartGameScreen = ({navigation}) => {
return( return(
<View style={styles.screen}> <View style={styles.screen}>
<Text>Start Game Screen</Text> {/* <ImageBackground source={require('../../memory/images/assets/gameback.png')} resizeMode="cover" style={styles.imageback}> */}
<Button title='Start' onPress={()=>{navigation.navigate("GameScreenOne")}}/> <View style={styles.imageContainer}>
<Text style={{ fontSize: 20, fontWeight: 'bold' }}>Select matching images</Text>
<Image
fadeDuration={1000}
source={require('../../memory/images/assets/navo1.png')}
style={styles.image}
/>
</View>
<Button title='Start' onPress={()=>{navigation.navigate("GameScreenOne")}}/>
{/* </ImageBackground> */}
</View> </View>
); );
} }
...@@ -15,7 +24,28 @@ const styles = StyleSheet.create({ ...@@ -15,7 +24,28 @@ const styles = StyleSheet.create({
flex: 1, flex: 1,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center' alignItems: 'center'
} },
imageContainer: {
alignItems: 'center',
width: '80%',
height: 300,
// borderColor: 'black',
// borderWidth: 2,
borderRadius: 200,
// overflow: 'hidden',
marginVertical: 30
},
image : {
width: '100%',
height: '100%'
},
// imageback: {
// flex: 1,
// justifyContent: 'center',
// width: '100%',
// height: '100%',
// padding: 20
// }
}); });
export default StartGameScreen; export default StartGameScreen;
\ No newline at end of file
...@@ -27,7 +27,7 @@ const GameScreenFive = ({navigation}) => { ...@@ -27,7 +27,7 @@ const GameScreenFive = ({navigation}) => {
timeLabels={{s: 'Seconds'}} timeLabels={{s: 'Seconds'}}
style={styles.counter} style={styles.counter}
/> />
<Text style={styles.imageText}>Fish - මාළුවා</Text> <Text style={styles.imageText}>Fish</Text>
</View> </View>
); );
} }
......
...@@ -4,12 +4,6 @@ import CountDown from 'react-native-countdown-component'; ...@@ -4,12 +4,6 @@ import CountDown from 'react-native-countdown-component';
import Countdown from '../../../constants/Countdown'; import Countdown from '../../../constants/Countdown';
const GameScreenFour = ({navigation}) => { const GameScreenFour = ({navigation}) => {
useEffect(()=>{
setTimeout( () => {
navigation.navigate('GameScreenFourAll');
}, 5000 );
});
return( return(
<View style={styles.sreen}> <View style={styles.sreen}>
...@@ -20,7 +14,7 @@ const GameScreenFour = ({navigation}) => { ...@@ -20,7 +14,7 @@ const GameScreenFour = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Car - කාරය</Text> <Text style={styles.imageText}>Car</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.elementry} until={Countdown.elementry}
......
...@@ -29,7 +29,7 @@ const GameScreenOne = ({navigation}) => { ...@@ -29,7 +29,7 @@ const GameScreenOne = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Pencil - පැන්සල</Text> <Text style={styles.imageText}>Pencil</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.elementry} until={Countdown.elementry}
......
...@@ -14,7 +14,7 @@ const GameScreenSix = ({navigation}) => { ...@@ -14,7 +14,7 @@ const GameScreenSix = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Pencil - පැන්සල</Text> <Text style={styles.imageText}>Pencil</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.elementry} until={Countdown.elementry}
......
...@@ -14,7 +14,7 @@ const GameScreenThree = ({navigation}) => { ...@@ -14,7 +14,7 @@ const GameScreenThree = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Flower - මල</Text> <Text style={styles.imageText}>Flower</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.elementry} until={Countdown.elementry}
......
...@@ -14,7 +14,7 @@ const GameScreenTwo = ({navigation}) => { ...@@ -14,7 +14,7 @@ const GameScreenTwo = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Ball - බෝලය</Text> <Text style={styles.imageText}>Ball</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.elementry} until={Countdown.elementry}
......
...@@ -14,6 +14,7 @@ const MediumGameScreenFive = ({navigation}) => { ...@@ -14,6 +14,7 @@ const MediumGameScreenFive = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Shadow of Horse</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.medium} until={Countdown.medium}
......
...@@ -14,7 +14,7 @@ const MediumGameScreenFour = ({navigation}) => { ...@@ -14,7 +14,7 @@ const MediumGameScreenFour = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Car - කාරය</Text> <Text style={styles.imageText}>A boy with a balloon</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.medium} until={Countdown.medium}
......
...@@ -29,7 +29,7 @@ const MediumGameScreenOne = ({navigation}) => { ...@@ -29,7 +29,7 @@ const MediumGameScreenOne = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Pencil - පැන්සල</Text> <Text style={styles.imageText}>Birds</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.medium} until={Countdown.medium}
......
...@@ -14,7 +14,7 @@ const MediumGameScreenSix = ({navigation}) => { ...@@ -14,7 +14,7 @@ const MediumGameScreenSix = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Pencil - පැන්සල</Text> <Text style={styles.imageText}>Arrow</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.medium} until={Countdown.medium}
......
...@@ -14,7 +14,7 @@ const MediumGameScreenThree = ({navigation}) => { ...@@ -14,7 +14,7 @@ const MediumGameScreenThree = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Flower - මල</Text> <Text style={styles.imageText}>Circle and Rectangle</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.medium} until={Countdown.medium}
......
...@@ -14,7 +14,7 @@ const MediumGameScreenTwo = ({navigation}) => { ...@@ -14,7 +14,7 @@ const MediumGameScreenTwo = ({navigation}) => {
style={styles.image} style={styles.image}
/> />
</View> </View>
<Text style={styles.imageText}>Ball - බෝලය</Text> <Text style={styles.imageText}>Boy with a bicycle</Text>
<CountDown <CountDown
size={40} size={40}
until={Countdown.medium} until={Countdown.medium}
......
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