Created
November 16, 2019 11:46
-
-
Save garganurag893/99363cc58836e38f8a8aa702636a3a7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {PureComponent} from 'react'; | |
import {StatusBar, StyleSheet, View} from 'react-native'; | |
import Entities from './src/entities'; | |
import {GameEngine} from 'react-native-game-engine'; | |
export default class App extends PureComponent { | |
constructor(props) { | |
super(props); | |
this.state = { | |
running: true, | |
}; | |
this.gameEngine = null; | |
console.disableYellowBox = true; | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
<GameEngine | |
ref={ref => { | |
this.gameEngine = ref; | |
}} | |
style={styles.gameContainer} | |
entities={Entities()} | |
running={this.state.running}> | |
<StatusBar hidden={true} /> | |
</GameEngine> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#000', | |
}, | |
gameContainer: { | |
position: 'absolute', | |
top: 0, | |
bottom: 0, | |
left: 0, | |
right: 0, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment