| 24 | |
| 25 | export default class GameEngine extends Component { |
| 26 | constructor(props) { |
| 27 | super(props); |
| 28 | this.state = { |
| 29 | entities: null |
| 30 | }; |
| 31 | this.timer = props.timer || new DefaultTimer(); |
| 32 | this.timer.subscribe(this.updateHandler); |
| 33 | this.touches = []; |
| 34 | this.screen = Dimensions.get("window"); |
| 35 | this.previousTime = null; |
| 36 | this.previousDelta = null; |
| 37 | this.events = []; |
| 38 | this.touchProcessor = props.touchProcessor(this.touches); |
| 39 | this.layout = null; |
| 40 | } |
| 41 | |
| 42 | async componentDidMount() { |
| 43 | let entities = getEntitiesFromProps(this.props); |