<commit_before>'use strict';
var Point = require('../prefabs/point');
var Avatar = require('../prefabs/avatar');

function Play() {}
Play.prototype = {
  create: function() {
    this.backgroundMap = this.game.add.sprite(0, 0, 'map');
    this.pointGroup = this.game.add.group();
    this.createBoardFromGameData();
    this.putAvatarToCurrentPoint();
  },
  update: function() {
  },
  render: function() {
    // this.game.debug.inputInfo(32, 32);
    // this.game.debug.pointer(this.game.input.activePointer);
  },
  createBoardFromGameData: function() {
    var data = this.game.data;

    var startPoint = this.game.add.sprite(data.startPoint.x, data.startPoint.y, 'start-end', 0);
    startPoint.state = 'start';
    startPoint.anchor.setTo(0.5, 0.5);
    startPoint.scale.setTo(0.5, 0.5);
    this.pointGroup.add(startPoint);

    var endPoint = this.game.add.sprite(data.endPoint.x, data.endPoint.y, 'start-end', 1);
    endPoint.anchor.setTo(0.5, 0.5);
    endPoint.scale.setTo(0.5, 0.5);
    this.pointGroup.add(endPoint);

    this.avatar = new Avatar(this.game, 246, 143);
    this.game.add.existing(this.avatar);

    for (var i = 0; i < data.points.length; i++) {
      var pointData = data.points[i];
      this.pointGroup.add(new Point(this.game, pointData, this.clickListener, this));
    }
  },
  putAvatarToCurrentPoint: function() {
    var currentPoint = this.pointGroup.iterate('state', Point.STATES.CURRENT, Phaser.Group.RETURN_CHILD);

    if (currentPoint !== null) {
      this.avatar.position.x = currentPoint.x;
      this.avatar.position.y = currentPoint.y;
    } else {
      var startPoint = this.pointGroup.iterate('state', 'start', Phaser.Group.RETURN_CHILD);<commit_msg>Make Point show completed frame after a quiz state is finished successfully.<commit_after>'use strict';
var Point = require('../prefabs/point');
var Avatar = require('../prefabs/avatar');

function Play() {}
Play.prototype = {
  create: function() {
    this.backgroundMap = this.game.add.sprite(0, 0, 'map');
    this.pointGroup = this.game.add.group();
    this.createBoardFromGameData();
    this.putAvatarToCurrentPoint();
  },
  update: function() {
  },
  render: function() {
    // this.game.debug.inputInfo(32, 32);
    // this.game.debug.pointer(this.game.input.activePointer);
  },
  createBoardFromGameData: function() {
    var data = this.game.data;

    var startPoint = this.game.add.sprite(data.startPoint.x, data.startPoint.y, 'start-end', 0);
    startPoint.state = 'start';
    startPoint.anchor.setTo(0.5, 0.5);
    startPoint.scale.setTo(0.5, 0.5);
    this.pointGroup.add(startPoint);

    var endPoint = this.game.add.sprite(data.endPoint.x, data.endPoint.y, 'start-end', 1);
    endPoint.anchor.setTo(0.5, 0.5);
    endPoint.scale.setTo(0.5, 0.5);
    this.pointGroup.add(endPoint);

    this.avatar = new Avatar(this.game, 246, 143);
    this.game.add.existing(this.avatar);

    for (var i = 0; i < data.points.length; i++) {
      var pointData = data.points[i];
      this.pointGroup.add(new Point(this.game, pointData, this.clickListener, this));
    }
  },
  putAvatarToCurrentPoint: function() {
    var currentPoint = this.pointGroup.iterate('state', Point.STATES.CURRENT, Phaser.Group.RETURN_CHILD);

    if (currentPoint !== null) {
      this.avatar.position.x = currentPoint.x;
      this.avatar.position.y = currentPoint.y;
      currentPoint.frame = 3;
    } else {
      var startPoint = this.pointGroup.iterate('state', 'start', Phaser.Group.RETURN_CHILD);
{'fraction_non_alphanumeric': 0.16452442159383032, 'fraction_numerical': 0.017994858611825194, 'mean_word_length': 3.4611464968152865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7087395', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1202, 'n_words': 208}