on click opponents bomb, you cannot target && refactor
This commit is contained in:
@@ -352,11 +352,17 @@ class GridControl extends React.Component {
|
||||
*/
|
||||
onHoverWithBomb(coords) {
|
||||
if (this.refs.userControl.state.bombSelected) {
|
||||
var activePlayer = this.refs.userControl.state.activePlayer ? 'blue' : 'red';
|
||||
|
||||
if (activePlayer === this.state.webPlayer) {
|
||||
/** clear cache, reset symbols */
|
||||
this.bombClear();
|
||||
|
||||
/** new cache && field activate */
|
||||
this.bombCreate(coords[0], coords[1]);
|
||||
} else {
|
||||
this.refs.userControl.setState({bombSelected: false});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ class GridField extends React.Component {
|
||||
componentWillMount() {
|
||||
var wave = Math.floor(Math.random() * 3) + 1;
|
||||
|
||||
console.log('mounted');
|
||||
|
||||
this.setState({
|
||||
currentImage: this.state.icons.root + this.state.icons.water[wave]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user