<commit_before>define(["underscore", "jquery"], function(_, $) {
	
	"use strict";

	function generateStars(width, height, density) {

		if(density === null) {
			density = 10;
		}

		var x, y, stars = [], itr = 1/density * 100, seed, seed2;

		for(x = -1 * width; x < 2 * width; x+=itr) {
			for(y = -1 * width; y < 2 * height; y+=itr ) {
				seed = (new Date().getTime() + "").substring(11) * 1;
				seed2 = (new Date().getTime() + "").substring(11) * 1;

				stars.push({
					r: Math.random() * 1.2 * Math.random() * 1.3,
					x: x + ((Math.random() > .49 ? 1 : -1) * seed),
					y: y + ((Math.random() > .49 ? 1 : -1) * seed2)
				});
			}
		}

		return stars;
	}

	function getPlayer() {
		var player = {
			player: true,
			img: new Image(),
			sx: 0,
			sy: 0,
			sw: 85,
			sh: 54,
			dx: 0,
			dy: 0,
			dw: 85,
			dh: 54,
			aniOffset: {
				total: 4,
				width: 85
			}
		};

		player.img.src = "css/sprite_ufo.png";

		return player;
	}

	function generatePlanet() {
		var player = {
			img: new Image(),
			sx: 0,
			sy: 0,
			sw: 300,
			sh: 300,
			dx: -150,
			dy: -150,
			dw: 200,
			dh: 200
		};

		player.img.src = "css/planet.png";

		return player;
	}

	var Engine = (function() {

		var options, Engine, interval, $canvas, ctx,
			stars, entities, events, keys;

		Engine = function(_options) {

			options = _.extend(
				{
					fps   : 10,
					width : 780,
					height: 450,
					'$canvas'  : $('#canvas')
				},
				_options);

			stars = generateStars(options.width, options.height, 5);
			entities = [generatePlanet(), getPlayer()];
			events = [];
			keys = {};

			$canvas = options.$canvas;
			$canvas.attr('width',  options.width);
			$canvas.attr('height', options.height);

			ctx = $canvas[0].getContext("2d");			
		};

		Engine.prototype = {
			start: function() {
				var scope = this;

				$(document).on('keydown.engine', function(e) {
					keys[e.which] = true;
				});

				$(document).on('keyup.engine', function (e) {
					setTimeout(function() {
						delete keys[e.which];
					}, 10000/options.fps+100);				    
				});

				interval = setInterval(function() {
					scope.render.call(scope);
				}, 1000/options.fps);

			},<commit_msg>Update planet generation<commit_after>define(["underscore", "jquery"], function(_, $) {
	
	"use strict";

	function generateStars(width, height, density) {

		if(density === null) {
			density = 10;
		}

		var x, y, stars = [], itr = 1/density * 100, seed, seed2;

		for(x = -1 * width; x < 2 * width; x+=itr) {
			for(y = -1 * width; y < 2 * height; y+=itr ) {
				seed = (new Date().getTime() + "").substring(11) * 1;
				seed2 = (new Date().getTime() + "").substring(11) * 1;

				stars.push({
					r: Math.random() * 1.2 * Math.random() * 1.3,
					x: x + ((Math.random() > .49 ? 1 : -1) * seed),
					y: y + ((Math.random() > .49 ? 1 : -1) * seed2)
				});
			}
		}

		return stars;
	}

	function getPlayer() {
		var player = {
			player: true,
			img: new Image(),
			sx: 0,
			sy: 0,
			sw: 85,
			sh: 54,
			dx: 0,
			dy: 0,
			dw: 85,
			dh: 54,
			aniOffset: {
				total: 4,
				width: 85
			}
		};

		player.img.src = "css/sprite_ufo.png";

		return player;
	}

	function generatePlanet(x, y) {
		var player = {
			img: new Image(),
			sx: 0,
			sy: 0,
			sw: 300,
			sh: 300,
			dx: x,
			dy: y,
			dw: 200,
			dh: 200
		};

		player.img.src = "css/planet.png";

		return player;
	}

	var Engine = (function() {

		var options, Engine, interval, $canvas, ctx,
			stars, entities, events, keys;

		Engine = function(_options) {

			options = _.extend(
				{
					fps   : 10,
					width : 780,
					height: 450,
					'$canvas'  : $('#canvas')
				},
				_options);

			stars = generateStars(options.width, options.height, 5);
			entities = [generatePlanet(0, 0),
						getPlayer()];
			events = [];
			keys = {};

			$canvas = options.$canvas;
			$canvas.attr('width',  options.width);
			$canvas.attr('height', options.height);

			ctx = $canvas[0].getContext("2d");			
		};

		Engine.prototype = {
			start: function() {
				var scope = this;

				$(document).on('keydown.engine', function(e) {
					keys[e.which] = true;
				});

				$(document).on('keyup.engine', function (e) {
					setTimeout(function() {
						delete keys[e.which];
					}, 10000/options.fps+100);				    
				});

				interval = setInterval(function() {
					scope.render.call(scope);
				}, 1000/options.fps);

			},
{'fraction_non_alphanumeric': 0.1911060433295325, 'fraction_numerical': 0.03968072976054732, 'mean_word_length': 2.335361216730038, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7076084', 'n_tokens_mistral': 2215, 'n_tokens_neox': 1630, 'n_words': 390}