{"size": 1340, "ext": "js", "max_stars_repo_path": "js/activity.js", "max_stars_repo_name": "eohomegrownapps/synonymantonym-activity", "max_stars_repo_stars_event_min_datetime": "2017-01-10T05:57:05.000Z", "max_stars_repo_stars_event_max_datetime": "2017-01-10T05:57:05.000Z", "max_issues_repo_path": "js/activity.js", "max_issues_repo_name": "eohomegrownapps/synonymantonym-activity", "max_issues_repo_issues_event_min_datetime": "2016-12-23T14:06:50.000Z", "max_issues_repo_issues_event_max_datetime": "2017-01-04T10:55:38.000Z", "max_forks_repo_path": "js/activity.js", "max_forks_repo_name": "eohomegrownapps/synonymantonym-activity", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 8, "max_forks_count": null, "avg_line_length": 25.2830188679, "max_line_length": 147, "alphanum_fraction": 0.6313432836}
define(["sugar-web/activity/activity",'easeljs','tweenjs','activity/game','activity/wordbox','activity/word','activity/worddata'], function (act) {

	// Manipulate the DOM only when it is ready.
	require(['domReady!'], function (doc) {

		// Initialize the activity.
		act.setup();
		runactivity(act,doc);

	});

});

function runactivity(act,doc){
	var canvas;
	var stage;
	var g;

	function prepareJSON(_callback){
	    g.worddata = JSON.parse(data);
	    _callback();    
	}

	function init(){
		//console.log(doc);
		console.log(act);
		canvas = document.getElementById('actualcanvas');
    	canvas.width = window.innerWidth; 
    	canvas.height = window.innerHeight-55;
    	centerX = canvas.width/2;
    	centerY = (canvas.height-55)/2;
    	stage = new createjs.Stage(canvas);
    	stage.mouseEventsEnabled = true;
    	createjs.Ticker.setFPS(30);
    	createjs.Ticker.addEventListener("tick", handleTick);
		function handleTick() {
		    stage.update();
		}
	    g = new Game(stage, doc);
	    prepareJSON(function() {
	        console.log('Ready');
	        g.init();
	    });  
	    window.addEventListener('resize', resizeCanvas, false);
	    function resizeCanvas() {
	        canvas.width = window.innerWidth;
	        canvas.height = window.innerHeight-55;
	        stage.update();
	        g.resize();
	    }
	}
    init();
}