<commit_before>var twistval = 3.5;

var fixedjoy = true; //fixed joystick

var jloc = new Object();

var keys = {
	left: 37,
	right: 39,
	up: 38,
	space: 32
}

function initControls() {
	jloc = {
		x: w*3/4,
		y: h*3/4
	};
	
	window.addEventListener("keydown", keydown, false);
	window.addEventListener("keyup", keyup, false);
	window.addEventListener("keypress", keypress, false);
	
	canvas.onmousedown = onmousedown
	
	canvas.addEventListener('touchstart', ontouchstart, false);        
	canvas.addEventListener('touchmove', ontouchmove, false);
	canvas.addEventListener('touchend', ontouchend, false);
}

var mousedrag = false

var currentmouse = null

var lastmouse = {
	x: null,
	y: null
}

function ontouchstart(e) {
	e.preventDefault();
	pogo.spring.restLength = 0.25;
	pogo.spring.applyForce();
}

function ontouchmove(e) {
	e.preventDefault();
	if(lastmouse.x!=null) {
    	if (lastmouse.x!=e.touches[0].clientX||true) {
    		a = lastmouse.x-e.touches[0].clientX;
    		b = lastmouse.y-e.touches[0].clientY;
    		pogo.frame.body.angularVelocity = 3*((Math.atan(a/b)-pogo.frame.body.angle));
    	} else {
    		pogo.frame.body.angularVelocity = 0;
    	}
    } else {
    	if(fixedjoy) {
    		lastmouse = {
        			x: jloc.x,
        			y: jloc.y
        	}
    	} else {
		    lastmouse = {
	    			x: e.touches[0].clientX,
	    			y: e.touches[0].clientY
	    	}<commit_msg>fixed bug<commit_after>var twistval = 3.5;

var fixedjoy = true; //fixed joystick

var jloc = new Object();

var keys = {
	left: 37,
	right: 39,
	up: 38,
	space: 32
}

function initControls() {
	jloc = {
		x: w*3/4,
		y: h*3/4
	};
	
	window.addEventListener("keydown", keydown, false);
	window.addEventListener("keyup", keyup, false);
	window.addEventListener("keypress", keypress, false);
	
	canvas.onmousedown = onmousedown
	
	canvas.addEventListener('touchstart', ontouchstart, false);        
	canvas.addEventListener('touchmove', ontouchmove, false);
	canvas.addEventListener('touchend', ontouchend, false);
}

var mousedrag = false

var currentmouse = null

var lastmouse = {
	x: null,
	y: null
}

function ontouchstart(e) {
	e.preventDefault();
	pogo.spring.restLength = 0.25;
	pogo.spring.applyForce();
	
	currentmouse = {
		clientX: e.touches[0].clientX,
		clientY: e.touches[0].clientY
	}
}

function ontouchmove(e) {
	e.preventDefault();
	if(lastmouse.x!=null) {
    	if (lastmouse.x!=e.touches[0].clientX||true) {
    		a = lastmouse.x-e.touches[0].clientX;
    		b = lastmouse.y-e.touches[0].clientY;
    		pogo.frame.body.angularVelocity = 3*((Math.atan(a/b)-pogo.frame.body.angle));
    	} else {
    		pogo.frame.body.angularVelocity = 0;
    	}
    	
    	currentmouse = {
    			clientX: e.touches[0].clientX,
    			clientY: e.touches[0].clientY
    	}
    } else {
    	if(fixedjoy) {
    		lastmouse = {
        			x: jloc.x,
        			y: jloc.y
        	}
    	} else {
		    lastmouse = {
	    			x: e.touches[0].clientX,
	    			y: e.touches[0].clientY
	    	}
{'fraction_non_alphanumeric': 0.15120967741935484, 'fraction_numerical': 0.01747311827956989, 'mean_word_length': 2.906824146981627, 'pattern_counts': {'":': 0, '<': 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': '2721375', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1171, 'n_words': 201}