<commit_before>package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.text.FlxText;
import flixel.ui.FlxButton;
import flixel.math.FlxMath;
import flixel.util.FlxSpriteUtil;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import sprites.Map;
import sprites.Player;
import sprites.Enemy;
import sprites.pickups.Pickup;

class PlayState extends FlxState
{
  private var map:Map;
  private var player_1:Player;
  private var player_2:Player;
  private var spawn_engine:Spawn;
  private var pickups:List<Pickup>;
  private var enemies:List<Enemy>;
  private var timer:FlxTimer;
  private var survival_type:Bool;
  private var timer_text:FlxText;
  private var p1score:FlxText;
  private var p2score:FlxText;


	override public function create():Void
	{
    pickups = new List<Pickup>();
    enemies = new List<Enemy>();
    survival_type = true;

		super.create();
    map = new Map(this);
    map.makeGraphic( Main.STAGE_WIDTH, Main.STAGE_HEIGHT, Main.BACKGROUND_GREY );
    Map.drawGridLines( this, map );
    Map.drawTopBar( this, map );

    bgColor = Main.BACKGROUND_GREY;
    add(map);
    add(flixel.util.FlxCollision.createCameraWall(FlxG.camera, true, 1));

    timer = new FlxTimer();
    timer.start(Settings.time_limit, function(t){
      FlxG.switchState(new EndState(
            player_1.points,
            player_2.points,
            survival_type ?
              EndState.EndType.SURVIVED :
              EndState.EndType.TIME_OUT
            ));
    });

    p1score = new FlxText( 4 * ( Main.STAGE_WIDTH / Map.GRID_LINES_X ) , 10, Std.string(0));
    p1score.setFormat( AssetPaths.CHUNKY_FONT, 18, Main.FONT_RED, FlxTextAlign.LEFT, FlxTextBorderStyle.SHADOW, FlxColor.BLACK, true);
    add(p1score);

    p2score = new FlxText( Main.STAGE_WIDTH - 2 * ( Main.STAGE_WIDTH / Map.GRID_LINES_X ) , 10, Std.string(0));
    p2score.setFormat( AssetPaths.CHUNKY_FONT, 18, Main.FONT_BLUE, FlxTextAlign.LEFT, FlxTextBorderStyle.SHADOW, FlxColor.BLACK, true);
    add(p2score);

    timer_text = new FlxText( Main.STAGE_WIDTH / 2 , 10, Std.string(Std.int( timer.time )));
    timer_text.setFormat( AssetPaths.CHUNKY_FONT, 18, Main.FONT_GREY, FlxTextAlign.LEFT, FlxTextBorderStyle.SHADOW, FlxColor.BLACK, true);
    add(timer_text);

#if neko
    Spawn.dev();<commit_msg>Changes 0 to '0' in player scores.<commit_after>package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.text.FlxText;
import flixel.ui.FlxButton;
import flixel.math.FlxMath;
import flixel.util.FlxSpriteUtil;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import sprites.Map;
import sprites.Player;
import sprites.Enemy;
import sprites.pickups.Pickup;

class PlayState extends FlxState
{
  private var map:Map;
  private var player_1:Player;
  private var player_2:Player;
  private var spawn_engine:Spawn;
  private var pickups:List<Pickup>;
  private var enemies:List<Enemy>;
  private var timer:FlxTimer;
  private var survival_type:Bool;
  private var timer_text:FlxText;
  private var p1score:FlxText;
  private var p2score:FlxText;


	override public function create():Void
	{
    pickups = new List<Pickup>();
    enemies = new List<Enemy>();
    survival_type = true;
		super.create();
    map = new Map(this);
    map.makeGraphic( Main.STAGE_WIDTH, Main.STAGE_HEIGHT, Main.BACKGROUND_GREY );
    Map.drawGridLines( this, map );
    Map.drawTopBar( this, map );

    bgColor = Main.BACKGROUND_GREY;
    add(map);
    add(flixel.util.FlxCollision.createCameraWall(FlxG.camera, true, 1));

    timer = new FlxTimer();
    timer.start(Settings.time_limit, function(t){
      FlxG.switchState(new EndState(
            player_1.points,
            player_2.points,
            survival_type ?
              EndState.EndType.SURVIVED :
              EndState.EndType.TIME_OUT
            ));
    });

    p1score = new FlxText( 4 * ( Main.STAGE_WIDTH / Map.GRID_LINES_X ) , 10, '0');
    p1score.setFormat( AssetPaths.CHUNKY_FONT, 18, Main.FONT_RED, FlxTextAlign.LEFT, FlxTextBorderStyle.SHADOW, FlxColor.BLACK, true);
    add(p1score);

    p2score = new FlxText( Main.STAGE_WIDTH - 2 * ( Main.STAGE_WIDTH / Map.GRID_LINES_X ) , 10, '0');
    p2score.setFormat( AssetPaths.CHUNKY_FONT, 18, Main.FONT_BLUE, FlxTextAlign.LEFT, FlxTextBorderStyle.SHADOW, FlxColor.BLACK, true);
    add(p2score);

    timer_text = new FlxText( Main.STAGE_WIDTH / 2 , 10, Std.string(Std.int( timer.time )));
    timer_text.setFormat( AssetPaths.CHUNKY_FONT, 18, Main.FONT_GREY, FlxTextAlign.LEFT, FlxTextBorderStyle.SHADOW, FlxColor.BLACK, true);
    add(timer_text);

#if neko
    Spawn.dev();
{'fraction_non_alphanumeric': 0.11295180722891567, 'fraction_numerical': 0.01333907056798623, 'mean_word_length': 3.817616580310881, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '615448', 'n_tokens_mistral': 1769, 'n_tokens_neox': 1686, 'n_words': 331}