Skip to content

Instantly share code, notes, and snippets.

@garganurag893
Created November 16, 2019 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garganurag893/99363cc58836e38f8a8aa702636a3a7f to your computer and use it in GitHub Desktop.
Save garganurag893/99363cc58836e38f8a8aa702636a3a7f to your computer and use it in GitHub Desktop.
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