<commit_before>// KineticJS JavaScript Framework http://www.kineticjs.com/ Copyright 2013, <NAME>. Licensed under the MIT license.

// Get jsons from the server
var objects_json_text = getJSON('objects.json');
var legends_json = JSON.parse(getJSON('legends.json'));

// Create stage and everything in it from json
var stage = Kinetic.Node.create(objects_json_text, 'container');

// Scale stage to window size
//stage.setWidth(window.innerWidth);
//stage.setHeight(window.innerHeight);

// Define variables from stage for easier use

// Texts & layers
var monologue = stage.get('#monologue')[0];
var speech_bubble = stage.get('#speech_bubble')[0];
var interaction_text = stage.get('#interaction_text')[0];
var input_text = stage.get('#input_text')[0];
var start_layer = stage.get("#start_layer")[0];
var input_layer = stage.get('#input_layer')[0];
var intro_layer = stage.get("#intro_layer")[0];
var outro_layer = stage.get("#outro_layer")[0];
var end_layer = stage.get("#end_layer")[0];
var background_layer = stage.get("#background_layer")[0];
var object_layer_locker_room_1 = stage.get('#object_layer_locker_room_1')[0];
var object_layer_locker_room_2 = stage.get('#object_layer_locker_room_2')[0];
var object_layer_shower_room = stage.get('#object_layer_shower_room')[0];
var object_layer_wc_1 = stage.get('#object_layer_wc_1')[0];
var object_layer_wc_2 = stage.get('#object_layer_wc_2')[0];
var inventory_layer = stage.get('#inventory_layer')[0];
var character_layer = stage.get('#character_layer')[0];
var text_layer = stage.get('#text_layer')[0];
var fade_layer = stage.get("#fade_layer")[0];

// Character frames
var speak_1 = stage.get('#character_speak_1')[0];
var speak_2 = stage.get('#character_speak_2')[0];
var idle_1 = stage.get('#character_idle_1')[0];
var idle_2 = stage.get('#character_idle_2')[0];
var panic = stage.get('#character_panic')[0];

// Decals of the cieni
var cieni_eyes_decal = stage.get('#cieni_eyes')[0];
var cieni_mouth_decal = stage.get('#cieni_mouth')[0];

// Scale background and UI elements
stage.get("#locker_room_1")[0].setSize(stage.getWidth(), stage.getHeight() - 100);
stage.get("#locker_room_2")[0].setSize(stage.getWidth(), stage.getHeight() - 100);
stage.get("#black_screen")[0].setSize(stage.getWidth(), stage.getHeight());
stage.get("#inventory_bar")[0].setY(stage.getHeight() - 100);
stage.get("#inventory_bar")[0].setWidth(stage.getWidth());

// Make a json object from the json string
var objects_json = stage.toObject();

// Variable for saving the current room (for changing backgrounds and object layers)
var current_background = 'locker_room_1';

// The amount of rewards found
var rewards = 0;

// Timeout event for showing monologue animation for certain duration
var monologue_timeout;

// Temporary location for inventory items if they need to be moved back to the location because of invalid interaction
var x;
var y;

// For limiting the amount of intersection checks
var delayEnabled = false;

// For checking whether player has selected their jersey number
var number_selected = false;

// Music
// NOTE: mp3 music works in iPad/Safari, but not on Firefox. ogg music would work in Firefox, but not in Safari.
// TODO: figure out what platform/browser is being used, and use different files accordingly
var start_music = new Audio('audio/alku_musax_mono_20131213.mp3');
var intro_music = new Audio('audio/intro_mono_20131213.mp3');
var end_music = new Audio('audio/loppu_musax_mono_20131213.mp3');
start_music.loop = true;

// The item dragged from the inventory<commit_msg>Update audio file type comment: MP3 works<commit_after>// KineticJS JavaScript Framework http://www.kineticjs.com/ Copyright 2013, <NAME>. Licensed under the MIT license.

// Get jsons from the server
var objects_json_text = getJSON('objects.json');
var legends_json = JSON.parse(getJSON('legends.json'));

// Create stage and everything in it from json
var stage = Kinetic.Node.create(objects_json_text, 'container');

// Scale stage to window size
//stage.setWidth(window.innerWidth);
//stage.setHeight(window.innerHeight);

// Define variables from stage for easier use

// Texts & layers
var monologue = stage.get('#monologue')[0];
var speech_bubble = stage.get('#speech_bubble')[0];
var interaction_text = stage.get('#interaction_text')[0];
var input_text = stage.get('#input_text')[0];
var start_layer = stage.get("#start_layer")[0];
var input_layer = stage.get('#input_layer')[0];
var intro_layer = stage.get("#intro_layer")[0];
var outro_layer = stage.get("#outro_layer")[0];
var end_layer = stage.get("#end_layer")[0];
var background_layer = stage.get("#background_layer")[0];
var object_layer_locker_room_1 = stage.get('#object_layer_locker_room_1')[0];
var object_layer_locker_room_2 = stage.get('#object_layer_locker_room_2')[0];
var object_layer_shower_room = stage.get('#object_layer_shower_room')[0];
var object_layer_wc_1 = stage.get('#object_layer_wc_1')[0];
var object_layer_wc_2 = stage.get('#object_layer_wc_2')[0];
var inventory_layer = stage.get('#inventory_layer')[0];
var character_layer = stage.get('#character_layer')[0];
var text_layer = stage.get('#text_layer')[0];
var fade_layer = stage.get("#fade_layer")[0];

// Character frames
var speak_1 = stage.get('#character_speak_1')[0];
var speak_2 = stage.get('#character_speak_2')[0];
var idle_1 = stage.get('#character_idle_1')[0];
var idle_2 = stage.get('#character_idle_2')[0];
var panic = stage.get('#character_panic')[0];

// Decals of the cieni
var cieni_eyes_decal = stage.get('#cieni_eyes')[0];
var cieni_mouth_decal = stage.get('#cieni_mouth')[0];

// Scale background and UI elements
stage.get("#locker_room_1")[0].setSize(stage.getWidth(), stage.getHeight() - 100);
stage.get("#locker_room_2")[0].setSize(stage.getWidth(), stage.getHeight() - 100);
stage.get("#black_screen")[0].setSize(stage.getWidth(), stage.getHeight());
stage.get("#inventory_bar")[0].setY(stage.getHeight() - 100);
stage.get("#inventory_bar")[0].setWidth(stage.getWidth());

// Make a json object from the json string
var objects_json = stage.toObject();

// Variable for saving the current room (for changing backgrounds and object layers)
var current_background = 'locker_room_1';

// The amount of rewards found
var rewards = 0;

// Timeout event for showing monologue animation for certain duration
var monologue_timeout;

// Temporary location for inventory items if they need to be moved back to the location because of invalid interaction
var x;
var y;

// For limiting the amount of intersection checks
var delayEnabled = false;

// For checking whether player has selected their jersey number
var number_selected = false;

// Music
// Different browsers and different browser versions support different formats. MP3 should work with in all the major
// browsers in current versions.
var start_music = new Audio('audio/alku_musax_mono_20131213.mp3');
var intro_music = new Audio('audio/intro_mono_20131213.mp3');
var end_music = new Audio('audio/loppu_musax_mono_20131213.mp3');
start_music.loop = true;

// The item dragged from the inventory
{'fraction_non_alphanumeric': 0.14133673903788846, 'fraction_numerical': 0.026252305945792535, 'mean_word_length': 6.213920163766632, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '163538', 'n_tokens_mistral': 2376, 'n_tokens_neox': 2286, 'n_words': 585}