<commit_before>var demo = {}, player, cursors;
var stomach_fruits = {};
var stomach_icons = {};
var stomach_tracker = {};
var map_redfruits = {}, map_bluefruits = {}, map_yellowfruits = {}, map_orangefruits = {}, map_purplefruits = {}, map_greenfruits = {};
var fruit_types = ["red", "blue", "yellow", "orange", "purple", "green"];
var clrs = {"red": 0xff0000, "blue": 0x0000ff, "yellow": 0xffff00, "orange": 0xff8000, "purple": 0x6600cc, "green": 0x00b33c}
var birds_group = {}, snakes_group = {};
var cat_boss, cat_boss_health;
var catMoveTimeStamp = 0, catHitTimeStamp = 0;

demo.state0 = function(){};
demo.state0.prototype = {
    preload: function(){
        loadImages()
    },
    create: function(){
        game.physics.startSystem(Phaser.Physics.ARCADE);
        game.stage.backgroundColor = '#FFFFFF';
        addChangeStateEventListeners();
        
        createChameleon(200,game.world.height);
        cursors = game.input.keyboard.createCursorKeys();
        
        // Init Stomach
        createInventory();
        
        make_fruit_groups();
        make_enemy_groups();
        
        placeRedFruit(500,500);
        placeRedFruit(500,300);
        placeBlueFruit(400,300);
        placeYellowFruit(300,300);
        placeOrangeFruit(200,200);
        placePurpleFruit(200,300);
        placeGreenFruit(200,400);
        
        placeBird(200, 100, clrs["red"]);
        place_cat_boss(400, 100);
        
    },
    update: function(){
        chameleonmove();
        moveBird();
        cat_boss_move();
        stomach_icons.red.events.onInputDown.add(chameleonred,this);
        stomach_icons.blue.events.onInputDown.add(chameleonblue,this);
        stomach_icons.yellow.events.onInputDown.add(chameleonyellow,this);
        stomach_icons.orange.events.onInputDown.add(chameleonorange,this);
        stomach_icons.purple.events.onInputDown.add(chameleonpurple,this);
        stomach_icons.green.events.onInputDown.add(chameleongreen,this);
    }
};


function changeState(i, stateNum){
    console.log('state' + stateNum);
    game.state.start('state' + stateNum);
}

function addKeyCallback(key, fn, args){
    game.input.keyboard.addKey(key).onDown.add(fn, null, null, args);
}

function addChangeStateEventListeners(){
    addKeyCallback(Phaser.Keyboard.ZERO, changeState, 0);
    addKeyCallback(Phaser.Keyboard.ONE, changeState, 1);
    addKeyCallback(Phaser.Keyboard.TWO, changeState, 2)
}<commit_msg>removed vars from state 0<commit_after>

demo.state0 = function(){};
demo.state0.prototype = {
    preload: function(){
        loadImages()
    },
    create: function(){
        game.physics.startSystem(Phaser.Physics.ARCADE);
        game.stage.backgroundColor = '#FFFFFF';
        addChangeStateEventListeners();
        
        createChameleon(200,game.world.height);
        cursors = game.input.keyboard.createCursorKeys();
        
        // Init Stomach
        createInventory();
        
        make_fruit_groups();
        make_enemy_groups();
        
        placeRedFruit(500,500);
        placeRedFruit(500,300);
        placeBlueFruit(400,300);
        placeYellowFruit(300,300);
        placeOrangeFruit(200,200);
        placePurpleFruit(200,300);
        placeGreenFruit(200,400);
        
        placeBird(200, 100, clrs["red"]);
        place_cat_boss(400, 100);
        
    },
    update: function(){
        chameleonmove();
        moveBird();
        cat_boss_move();
        stomach_icons.red.events.onInputDown.add(chameleonred,this);
        stomach_icons.blue.events.onInputDown.add(chameleonblue,this);
        stomach_icons.yellow.events.onInputDown.add(chameleonyellow,this);
        stomach_icons.orange.events.onInputDown.add(chameleonorange,this);
        stomach_icons.purple.events.onInputDown.add(chameleonpurple,this);
        stomach_icons.green.events.onInputDown.add(chameleongreen,this);
    }
};


function changeState(i, stateNum){
    console.log('state' + stateNum);
    game.state.start('state' + stateNum);
}

function addKeyCallback(key, fn, args){
    game.input.keyboard.addKey(key).onDown.add(fn, null, null, args);
}

function addChangeStateEventListeners(){
    addKeyCallback(Phaser.Keyboard.ZERO, changeState, 0);
    addKeyCallback(Phaser.Keyboard.ONE, changeState, 1);
    // state 2 doesnt work currently 
    addKeyCallback(Phaser.Keyboard.TWO, changeState, 2);
}
{'fraction_non_alphanumeric': 0.13272311212814644, 'fraction_numerical': 0.035697940503432495, 'mean_word_length': 3.2313649564375604, 'pattern_counts': {'":': 6, '<': 3, '<?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': '2917349', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1455, 'n_words': 198}