(props)
| 5 | |
| 6 | export default class GameLoop extends Component { |
| 7 | constructor(props) { |
| 8 | super(props); |
| 9 | this.timer = props.timer || new DefaultTimer(); |
| 10 | this.timer.subscribe(this.updateHandler); |
| 11 | this.touches = []; |
| 12 | this.screen = Dimensions.get("window"); |
| 13 | this.previousTime = null; |
| 14 | this.previousDelta = null; |
| 15 | this.touchProcessor = props.touchProcessor(this.touches); |
| 16 | this.layout = null; |
| 17 | } |
| 18 | |
| 19 | componentDidMount() { |
| 20 | if (this.props.running) this.start(); |