<commit_before>var ship;
var expl_anim;
var enemies = [];
var bullets = [];
var lasers = [];
var score = 0
var highscore = 0
var edgeCount = 0
var overInsertCoin = false

var mobile = getCookie("mobileInput")==='true'
var mobileH = (mobile)?200:0;

var mother = null
var drawMother = false
var spawnedMother = false
var spawnMother = false

var nextLevel = true

var player_img;

var level = 0

function setup(){
	var canvas = createCanvas(800, 600+mobileH)
	canvas.parent("frame")
	frameRate(60)
	
	player_img = loadImage("assets/Player.png")
	
	
	//load highscore
	highscore = parseInt(getCookie("highscore")) || 0;
	if(highscore === 0)
		setCookie("highscore", "0", 365, "/SpaceInvaders")
	
	//setup all the animations
	alienSetup()
	explosionSetup()
	setupMothership()
	setupLaser()
	
	//show score
	$('#score').text("Score: " + score)
	$('#highscore').text("Highscore: " + highscore)
	
	resetGame()
}

function resetGame(){
	enemies = []
	bullets = []
	lasers = []
	edgeCount = 0
	mother = null
	drawMother = null
	spawnedMother = false
	spawnMother = false
	level = 0
	ship = new Ship(player_img)
	
	//create two rows each of identical aliens
	for(var x = 0; x < 10; x++){
		for(var y = 0; y < 2; y++){
			enemies.push(new alien(alien1_frames, x*60+50, y*50+50))
		}
	}
	
	for(var x = 0; x < 10; x++){
		for(var y = 0; y < 2; y++){
			enemies.push(new alien(alien2_frames, x*60+50, y*50+150))
		}
	}
	
	nextL()
}

function nextL(){
	if(nextLevel)
	{<commit_msg>Fixed level stuck at 1<commit_after>var ship;
var expl_anim;
var enemies = [];
var bullets = [];
var lasers = [];
var score = 0
var highscore = 0
var edgeCount = 0
var overInsertCoin = false

var mobile = getCookie("mobileInput")==='true'
var mobileH = (mobile)?200:0;

var mother = null
var drawMother = false
var spawnedMother = false
var spawnMother = false

var nextLevel = true

var player_img;

var level = 0

function setup(){
	var canvas = createCanvas(800, 600+mobileH)
	canvas.parent("frame")
	frameRate(60)
	
	player_img = loadImage("assets/Player.png")
	
	
	//load highscore
	highscore = parseInt(getCookie("highscore")) || 0;
	if(highscore === 0)
		setCookie("highscore", "0", 365, "/SpaceInvaders")
	
	//setup all the animations
	alienSetup()
	explosionSetup()
	setupMothership()
	setupLaser()
	
	//show score
	$('#score').text("Score: " + score)
	$('#highscore').text("Highscore: " + highscore)
	
	resetGame()
}

function resetGame(){
	enemies = []
	bullets = []
	lasers = []
	edgeCount = 0
	mother = null
	drawMother = null
	spawnedMother = false
	spawnMother = false
	ship = new Ship(player_img)
	
	//create two rows each of identical aliens
	for(var x = 0; x < 10; x++){
		for(var y = 0; y < 2; y++){
			enemies.push(new alien(alien1_frames, x*60+50, y*50+50))
		}
	}
	
	for(var x = 0; x < 10; x++){
		for(var y = 0; y < 2; y++){
			enemies.push(new alien(alien2_frames, x*60+50, y*50+150))
		}
	}
	
	nextL()
}

function nextL(){
	if(nextLevel)
	{
{'fraction_non_alphanumeric': 0.15654843110504774, 'fraction_numerical': 0.03615279672578445, 'mean_word_length': 3.9965928449744466, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1966599', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1073, 'n_words': 296}