{"size": 823, "ext": "js", "max_stars_repo_path": "src/states/StartGame.js", "max_stars_repo_name": "sat-mathville/mathville", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/states/StartGame.js", "max_issues_repo_name": "sat-mathville/mathville", "max_issues_repo_issues_event_min_datetime": "2018-08-11T20:33:07.000Z", "max_issues_repo_issues_event_max_datetime": "2018-08-29T20:49:04.000Z", "max_forks_repo_path": "src/states/StartGame.js", "max_forks_repo_name": "sat-mathville/mathville", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 78, "max_forks_count": null, "avg_line_length": 30.4814814815, "max_line_length": 123, "alphanum_fraction": 0.6670716889}
/* globals __DEV__ */
import Phaser from 'phaser'
import store, {setCoord, fetchAllAbilities, getProblems} from '../store'

export default class extends Phaser.State {
  preload () {
    this.load.image('playBtn', '../assets/images/playBtn.png')
    store.dispatch(setCoord([450, 500]))
    store.dispatch(fetchAllAbilities())
    store.dispatch(getProblems())
  }
  create () {
    this.renderPlayButton()
  }
  renderPlayButton () {
    this.button1 = this.add.button(this.world.centerX, this.world.centerY, 'playBtn', this.actionOnClick, this, 2, 1, 0)
    this.button1.anchor.setTo(0.5, 0.5)

    this.txt = this.add.text(this.button1.x, this.button1.y, 'Start', {font: '80px Cinzel', fill: '#fff', align: 'center'})

    this.txt.anchor.setTo(0.5, 0.5)
  }
  actionOnClick () {
    this.game.state.start('Game')
  }
}
