代码拉取完成,页面将自动刷新
import React, { Component } from 'react';
import { Dimensions, PixelRatio } from 'react-native';
import GameOverView from './src/view/GameOverView';
import GameNotStartView from './src/view/GameNotStartView';
import GamePauseView from './src/view/GamePauseView';
import GamePlayingView from './src/view/GamePlayingView';
import {GAME_STATE_NOT_START, GAME_STATE_PLAYING, GAME_STATE_PAUSE, GAME_STATE_OVER} from './src/utils/Constants';
if (!__DEV__) {
global.console = {
info: () => {},
log: () => {},
warn: () => {},
debug: () => {},
error: () => {},
};
}
export default class App extends Component<{}> {
constructor(props) {
super(props);
this.state = {
gameState: GAME_STATE_NOT_START
};
}
render() {
switch (this.state.gameState) {
case GAME_STATE_NOT_START:
return <GameNotStartView changeGameState={this.changeGameState} />;
break;
case GAME_STATE_PLAYING:
return <GamePlayingView changeGameState={this.changeGameState} />;
break;
case GAME_STATE_PAUSE:
return <GamePauseView changeGameState={this.changeGameState} />;
break;
case GAME_STATE_OVER:
return <GameOverView changeGameState={this.changeGameState} />;
break;
}
}
changeGameState = (state)=>{
this.setState({
gameState: state
});
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。