{"size": 1802, "ext": "js", "max_stars_repo_path": "lib/plant.js", "max_stars_repo_name": "natejenkins/xkcd-mario", "max_stars_repo_stars_event_min_datetime": "2018-08-28T23:57:54.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-31T16:58:32.000Z", "max_issues_repo_path": "lib/plant.js", "max_issues_repo_name": "natejenkins/xkcd-mario", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/plant.js", "max_forks_repo_name": "natejenkins/xkcd-mario", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 36.04, "max_line_length": 287, "alphanum_fraction": 0.6609322974}
// Generated by CoffeeScript 1.9.3
(function() {
  var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  this.Plant = (function(superClass) {
    extend(Plant, superClass);

    function Plant(position) {
      this.position = position;
      this.update_position = bind(this.update_position, this);
      this.draw = bind(this.draw, this);
      this.jump = bind(this.jump, this);
      this.name = "plant";
      this.img_src = "./stick_figures/plant.png";
      this.num_frames = 3;
      Plant.__super__.constructor.call(this, this.name, this.position, this.img_src, this.num_frames);
      this.frame_factor = 7;
      setInterval(this.jump, 5000);
      this.gravity_factor = 0.1;
      this.player_speed = 0.0;
      this.creature_changes_direction = false;
      this.disable_collisions = true;
      this.minimum_y_position = this.position[1];
    }

    Plant.prototype.jump = function() {
      return this.fall_speed = -5;
    };

    Plant.prototype.draw = function(world_position) {
      this.frame_counter++;
      return Plant.__super__.draw.call(this, world_position);
    };

    Plant.prototype.update_position = function(world) {
      Plant.__super__.update_position.call(this, world);
      if (this.position[1] < this.minimum_y_position) {
        this.position[1] = this.minimum_y_position;
      }
      return this.calc_relative_position(world.position);
    };

    return Plant;

  })(this.Creature);

}).call(this);
