Version 0.7.2
Added end level part for level 3. Larger blue particle now bounces off walls. Added new orange punching power. Added regulation for score bubble and enemy spawning in levels, they are now about the same of each in every game overall. Added many possible enemy and point spawns in levels. Added new level parts. Added red score bubble. Made locked powers faded. Made free mode start with everything unlocked.
This commit is contained in:
parent
0c7810979c
commit
ac2eb87d2f
3 changed files with 168 additions and 46 deletions
BIN
items.png
BIN
items.png
Binary file not shown.
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 865 B |
108
level.js
108
level.js
|
@ -106,12 +106,12 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'................###'
|
,'................###'
|
||||||
,'................###'
|
,'........E.......###'
|
||||||
,'.....########...###'
|
,'.....########...###'
|
||||||
,'.....########...###'
|
,'.....########...###'
|
||||||
,'.....###........###'
|
,'.....###........###'
|
||||||
,'########...########'
|
,'########...########'
|
||||||
,'########...########'
|
,'########.2.########'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -132,7 +132,7 @@ function defineLevels(){
|
||||||
,'######.............'
|
,'######.............'
|
||||||
,'######....###......'
|
,'######....###......'
|
||||||
,'##........###......'
|
,'##........###......'
|
||||||
,'##.E......###......'
|
,'##.E......###...0..'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -150,12 +150,12 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'.........E.........'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'##.................'
|
,'##.................'
|
||||||
,'##.................'
|
,'##...2..E..........'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -199,7 +199,7 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'###................'
|
,'###................'
|
||||||
,'###................'
|
,'###................'
|
||||||
,'###................'
|
,'###..........0.....'
|
||||||
,'...........#####...'
|
,'...........#####...'
|
||||||
,'...........#####...'
|
,'...........#####...'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -224,7 +224,7 @@ function defineLevels(){
|
||||||
,'###................'
|
,'###................'
|
||||||
,'#######............'
|
,'#######............'
|
||||||
,'###................'
|
,'###................'
|
||||||
,'###................'
|
,'###.0..............'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -242,7 +242,7 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'....E....0.........'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -265,7 +265,7 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'..1..............1.'
|
||||||
,'####wwwwwwwwww#####'
|
,'####wwwwwwwwww#####'
|
||||||
,'####wwwwwwwwww#####'
|
,'####wwwwwwwwww#####'
|
||||||
,'#######wwwwwww#####'
|
,'#######wwwwwww#####'
|
||||||
|
@ -293,7 +293,7 @@ function defineLevels(){
|
||||||
,'.........E.........'
|
,'.........E.........'
|
||||||
,'......#######......'
|
,'......#######......'
|
||||||
,'......#######......'
|
,'......#######......'
|
||||||
,'......#######......'
|
,'..0...#######...0..'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -313,7 +313,7 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'.........0.....0...'
|
||||||
,'......#############'
|
,'......#############'
|
||||||
,'......#############'
|
,'......#############'
|
||||||
,'...E..#############'
|
,'...E..#############'
|
||||||
|
@ -336,7 +336,7 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'................###'
|
,'................###'
|
||||||
,'................###'
|
,'..0..........0..###'
|
||||||
,'######...##########'
|
,'######...##########'
|
||||||
,'######.E.##########'
|
,'######.E.##########'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -379,13 +379,13 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'....1..........1...'
|
||||||
,'...###........###..'
|
,'...###........###..'
|
||||||
,'...#####......#####'
|
,'...#####......#####'
|
||||||
,'...#####......#####'
|
,'...#####......#####'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'.....E.............'
|
||||||
,'########....#######'
|
,'########....#######'
|
||||||
,'########xxxx#######'
|
,'########xxxx#######'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -408,7 +408,7 @@ function defineLevels(){
|
||||||
,'####...............'
|
,'####...............'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'......0......0.....'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -426,7 +426,7 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'............1......'
|
||||||
,'###........###.....'
|
,'###........###.....'
|
||||||
,'###........###.....'
|
,'###........###.....'
|
||||||
,'###................'
|
,'###................'
|
||||||
|
@ -454,7 +454,7 @@ function defineLevels(){
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'.........2.........'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -477,7 +477,7 @@ function defineLevels(){
|
||||||
,'......###..........'
|
,'......###..........'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'...................'
|
||||||
,'...................'
|
,'.........1.........'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
,'###################'
|
,'###################'
|
||||||
|
@ -530,7 +530,53 @@ function defineLevels(){
|
||||||
,'######################################'
|
,'######################################'
|
||||||
,'######################################'
|
,'######################################'
|
||||||
,'5n', '10n', 2, 15, 20
|
,'5n', '10n', 2, 15, 20
|
||||||
]
|
],
|
||||||
|
[
|
||||||
|
'......................................'
|
||||||
|
,'......................................'
|
||||||
|
,'......................................'
|
||||||
|
,'......................................'
|
||||||
|
,'.......................H..............'
|
||||||
|
,'......................###............'
|
||||||
|
,'......................###.............'
|
||||||
|
,'......................###...2.........'
|
||||||
|
,'......................###########.....'
|
||||||
|
,'......E...............###########.....'
|
||||||
|
,'################......###########.....'
|
||||||
|
,'################............#####.....'
|
||||||
|
,'################..E.........###.......'
|
||||||
|
,'######################......###.......'
|
||||||
|
,'############..........................'
|
||||||
|
,'############.....................#####'
|
||||||
|
,'############.3.#######################'
|
||||||
|
,'######################################'
|
||||||
|
,'######################################'
|
||||||
|
,'######################################'
|
||||||
|
,'10n', '5jl11', 2, 15, 20
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'...................'
|
||||||
|
,'...................'
|
||||||
|
,'...................'
|
||||||
|
,'...................'
|
||||||
|
,'...................'
|
||||||
|
,'...................'
|
||||||
|
,'...................'
|
||||||
|
,'...................'
|
||||||
|
,'...0...............'
|
||||||
|
,'.#####..............'
|
||||||
|
,'.#####.............'
|
||||||
|
,'...................'
|
||||||
|
,'..........###......'
|
||||||
|
,'..........###......'
|
||||||
|
,'....0..######.0.E..'
|
||||||
|
,'###################'
|
||||||
|
,'###################'
|
||||||
|
,'###################'
|
||||||
|
,'###################'
|
||||||
|
,'###################'
|
||||||
|
,'5jl11', '5n', 2, 15, 5
|
||||||
|
],
|
||||||
];
|
];
|
||||||
levelends = [
|
levelends = [
|
||||||
[
|
[
|
||||||
|
@ -576,6 +622,28 @@ function defineLevels(){
|
||||||
,'######################################################'
|
,'######################################################'
|
||||||
,'######################################################'
|
,'######################################################'
|
||||||
,'######################################################'
|
,'######################################################'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'..................................................................'
|
||||||
|
,'..................................................................'
|
||||||
|
,'.........................................#########################'
|
||||||
|
,'.........................................#########################'
|
||||||
|
,'.........................................#########################'
|
||||||
|
,'.........................................#####.............#######'
|
||||||
|
,'.........................................#####FFFFF........#######'
|
||||||
|
,'.........................................#############.....#######'
|
||||||
|
,'.........................................#############...E.#######'
|
||||||
|
,'.............22..........................#############..##########'
|
||||||
|
,'.....##.....####.........E..E.E.............###.........##########'
|
||||||
|
,'...HH##.....####.......#########..........E.###...2.1.2.##########'
|
||||||
|
,'...####.....####.......#########........#######..#################'
|
||||||
|
,'...####..........................................#################'
|
||||||
|
,'...####...3......E2......2......3...E............#################'
|
||||||
|
,'##################################################################'
|
||||||
|
,'##################################################################'
|
||||||
|
,'##################################################################'
|
||||||
|
,'##################################################################'
|
||||||
|
,'##################################################################'
|
||||||
]
|
]
|
||||||
]
|
];
|
||||||
}
|
}
|
88
sint.js
88
sint.js
|
@ -244,6 +244,8 @@ function play(){
|
||||||
if(cookies){
|
if(cookies){
|
||||||
setCookie('options', JSON.stringify(optionvars), 30);
|
setCookie('options', JSON.stringify(optionvars), 30);
|
||||||
}
|
}
|
||||||
|
totalLevelScore = 0;
|
||||||
|
totalEnemies = 0;
|
||||||
finTime = false;
|
finTime = false;
|
||||||
|
|
||||||
endAdded = false;
|
endAdded = false;
|
||||||
|
@ -258,6 +260,8 @@ function newLevel(){
|
||||||
partsInserted = [];
|
partsInserted = [];
|
||||||
ais = [];
|
ais = [];
|
||||||
items = [];
|
items = [];
|
||||||
|
totalLevelScore = 0;
|
||||||
|
totalEnemies = 0;
|
||||||
actors.splice(1, actors.length - 1);
|
actors.splice(1, actors.length - 1);
|
||||||
particles.splice(1, actors.length - 1);
|
particles.splice(1, actors.length - 1);
|
||||||
limitLeft = 16;
|
limitLeft = 16;
|
||||||
|
@ -549,7 +553,7 @@ function Actor(image, type, health, moveSpeed, energy, powers, xpos, ypos, width
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if(this.energy >= 3){
|
if(this.energy >= 3){
|
||||||
particles.push(new Particle(1, this.type, 4, Math.random() * 500 + 4500, this.x + 8, this.y - 8, Math.cos(angle + ((Math.random() - 0.5) * 0.03)) * 8, Math.sin(angle + ((Math.random() - 0.5) * 0.03)) * 8, 0, [0.999, 0.999]));
|
particles.push(new Particle(1, this.type, 4, Math.random() * 500 + 4500, this.x + 8, this.y - 8, Math.cos(angle + ((Math.random() - 0.5) * 0.03)) * 8, Math.sin(angle + ((Math.random() - 0.5) * 0.03)) * 8, 0, [0.999, 0.999], true, -0.3));
|
||||||
if(distanceToSound < 500){
|
if(distanceToSound < 500){
|
||||||
sound.shoot1.volume = (r(distanceToSound < 100 ? 1 : (500 - distanceToSound) / 400) * optionvars[1]) / 100;
|
sound.shoot1.volume = (r(distanceToSound < 100 ? 1 : (500 - distanceToSound) / 400) * optionvars[1]) / 100;
|
||||||
sound.shoot1.play();
|
sound.shoot1.play();
|
||||||
|
@ -567,6 +571,19 @@ function Actor(image, type, health, moveSpeed, energy, powers, xpos, ypos, width
|
||||||
this.energy -= 100;
|
this.energy -= 100;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
if(this.energy >= 80){
|
||||||
|
this.xvel = Math.cos(angle) * 18;
|
||||||
|
this.yvel = Math.sin(angle) * 15;
|
||||||
|
angle += Math.PI - 0.5;
|
||||||
|
for(var i = 0; i < 50; i++){
|
||||||
|
particles.push(new Particle(0, this.type, 7, 2500 + Math.random() * 1000, this.x + 8, this.y - 8, Math.cos(angle) * 3, Math.sin(angle) * 3, 0.5, [0.9985, 0.9985], false, -0.8));
|
||||||
|
angle += 0.02;
|
||||||
|
}
|
||||||
|
this.energy -= 80;
|
||||||
|
sound.shoot1.volume = (r(distanceToSound < 100 ? 1 : (500 - distanceToSound) / 400) * optionvars[1]) / 100;
|
||||||
|
sound.shoot1.play();
|
||||||
|
}
|
||||||
case 'en1':
|
case 'en1':
|
||||||
if(this.energy >= 2){
|
if(this.energy >= 2){
|
||||||
particles.push(new Particle(0, 1, 1, Math.random() * 500 + 5000, this.x + 8, this.y - 8, Math.cos(this.vars[0]) * 15 + this.xvel, Math.sin(this.vars[0]) * 15 + this.yvel, 0.4, [0.995, 0.995]));
|
particles.push(new Particle(0, 1, 1, Math.random() * 500 + 5000, this.x + 8, this.y - 8, Math.cos(this.vars[0]) * 15 + this.xvel, Math.sin(this.vars[0]) * 15 + this.yvel, 0.4, [0.995, 0.995]));
|
||||||
|
@ -606,7 +623,7 @@ function Actor(image, type, health, moveSpeed, energy, powers, xpos, ypos, width
|
||||||
break;
|
break;
|
||||||
case 'current':
|
case 'current':
|
||||||
this.action(this.select);
|
this.action(this.select);
|
||||||
if(this.select == 2){
|
if(this.select == 2 || this.select == 3){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -658,7 +675,7 @@ function Actor(image, type, health, moveSpeed, energy, powers, xpos, ypos, width
|
||||||
this.xvel = 0;
|
this.xvel = 0;
|
||||||
this.yvel = 0;
|
this.yvel = 0;
|
||||||
this.health = this.maxhealth;
|
this.health = this.maxhealth;
|
||||||
score -= 50;
|
score -= 50 * levelNo;
|
||||||
clockStart = new Date().getTime();
|
clockStart = new Date().getTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -728,6 +745,11 @@ function Item(type, xpos, ypos){
|
||||||
sound.point.volume = optionvars[1] / 150;
|
sound.point.volume = optionvars[1] / 150;
|
||||||
sound.point.play();
|
sound.point.play();
|
||||||
break;
|
break;
|
||||||
|
case 5:
|
||||||
|
score += 50;
|
||||||
|
sound.point.volume = optionvars[1] / 150;
|
||||||
|
sound.point.play();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
this.deleteme = true;
|
this.deleteme = true;
|
||||||
}
|
}
|
||||||
|
@ -735,12 +757,13 @@ function Item(type, xpos, ypos){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Particle(type, affiliation, drawType, lifespan, xpos, ypos, xvel, yvel, gravity, airRes, actDeath){
|
function Particle(type, affiliation, drawType, lifespan, xpos, ypos, xvel, yvel, gravity, airRes, actDeath, bounce){
|
||||||
this.gravity = typeof gravty !== 'undefined' ? gravity : 1;
|
this.gravity = typeof gravty !== 'undefined' ? gravity : 1;
|
||||||
this.x = xpos;
|
this.x = xpos;
|
||||||
this.y = ypos;
|
this.y = ypos;
|
||||||
this.drawType = drawType;
|
this.drawType = drawType;
|
||||||
this.actDeath = typeof actDeath === 'undefined' ? true : actDeath;
|
this.actDeath = typeof actDeath === 'undefined' ? true : actDeath;
|
||||||
|
this.bounce = typeof bounce === 'undefined' ? 0 : bounce;
|
||||||
this.xvel = xvel;
|
this.xvel = xvel;
|
||||||
this.yvel = yvel;
|
this.yvel = yvel;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -756,7 +779,7 @@ function Particle(type, affiliation, drawType, lifespan, xpos, ypos, xvel, yvel,
|
||||||
var angle = Math.random() * 360;
|
var angle = Math.random() * 360;
|
||||||
this.addx = Math.sin(angle) * ((particles.length + 200) / 5);
|
this.addx = Math.sin(angle) * ((particles.length + 200) / 5);
|
||||||
this.addy = Math.cos(angle) * ((particles.length + 200) / 10);
|
this.addy = Math.cos(angle) * ((particles.length + 200) / 10);
|
||||||
this.box = new Box(this.x, this.y, this.size, this.size, this.xvel, this.yvel, 1, gravity, this.air);
|
this.box = new Box(this.x, this.y, this.size, this.size, this.xvel, this.yvel, 1, gravity, this.air, this.bounce);
|
||||||
this.box.unstuck();
|
this.box.unstuck();
|
||||||
|
|
||||||
this.drawBox = function(alpha, width, color, size, fill, rel){
|
this.drawBox = function(alpha, width, color, size, fill, rel){
|
||||||
|
@ -774,6 +797,7 @@ function Particle(type, affiliation, drawType, lifespan, xpos, ypos, xvel, yvel,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
context.stroke();
|
context.stroke();
|
||||||
|
context.globalAlpha = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.draw = function(extendSize){
|
this.draw = function(extendSize){
|
||||||
|
@ -808,6 +832,7 @@ function Particle(type, affiliation, drawType, lifespan, xpos, ypos, xvel, yvel,
|
||||||
this.drawBox(1, 1 * extendSize, '#93b', 2 * extendSize);
|
this.drawBox(1, 1 * extendSize, '#93b', 2 * extendSize);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
this.drawBox(1, 1 * extendSize, '#f95', 2 * extendSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
context.globalAlpha = 1;
|
context.globalAlpha = 1;
|
||||||
|
@ -820,21 +845,33 @@ function Particle(type, affiliation, drawType, lifespan, xpos, ypos, xvel, yvel,
|
||||||
// 293;
|
// 293;
|
||||||
this.x = 480.5 - (35 * k);
|
this.x = 480.5 - (35 * k);
|
||||||
this.y = 293.5;
|
this.y = 293.5;
|
||||||
|
var unlocked = ((actors[0].powers - 1) >= k ? 1 : 5);
|
||||||
switch(k){
|
switch(k){
|
||||||
case 0:
|
case 0:
|
||||||
this.x -= 2;
|
this.x -= 2;
|
||||||
this.y -= 2;
|
this.y -= 2;
|
||||||
this.drawBox(1, 1.5, '#66b', 4, false, 0);
|
this.drawBox((1 / unlocked), 1.5, '#66b', 4, false, 0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
this.x -= 3;
|
this.x -= 3;
|
||||||
this.y -= 3;
|
this.y -= 3;
|
||||||
this.drawBox(0.8, 2, '#229', 6, false, 0);
|
this.drawBox((0.8 / unlocked), 2, '#229', 6, false, 0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.x -= 5;
|
this.x -= 5;
|
||||||
this.y -= 5;
|
this.y -= 5;
|
||||||
this.drawBox(1, 3, '#93b', 10, '#b7f', 0);
|
this.drawBox((1 / unlocked), 3, '#93b', 10, '#b7f', 0);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.x -= 2;
|
||||||
|
this.y -= 6;
|
||||||
|
this.drawBox((1 / unlocked), 1.5, '#f95', 4, false, 0);
|
||||||
|
this.x += 6;
|
||||||
|
this.y += 8;
|
||||||
|
this.drawBox((1 / unlocked), 1.5, '#f95', 4, false, 0);
|
||||||
|
this.x -= 12;
|
||||||
|
this.drawBox((1 / unlocked), 1.5, '#f95', 4, false, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.drawType = 'mouse';
|
this.drawType = 'mouse';
|
||||||
|
@ -925,7 +962,7 @@ function Particle(type, affiliation, drawType, lifespan, xpos, ypos, xvel, yvel,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collision detection class
|
// Collision detection class
|
||||||
function Box(x, y, w, h, xvel, yvel, colgroup, gravity, airRes){
|
function Box(x, y, w, h, xvel, yvel, colgroup, gravity, airRes, bounce){
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.width = w;
|
this.width = w;
|
||||||
|
@ -937,6 +974,7 @@ function Box(x, y, w, h, xvel, yvel, colgroup, gravity, airRes){
|
||||||
this.down = false;
|
this.down = false;
|
||||||
this.gravity = gravity;
|
this.gravity = gravity;
|
||||||
this.air = (typeof airRes === 'undefined' ? [0.99, 1] : airRes);
|
this.air = (typeof airRes === 'undefined' ? [0.99, 1] : airRes);
|
||||||
|
this.bounce = (typeof bounce === 'undefined' ? 0 : bounce);
|
||||||
this.health = 0;
|
this.health = 0;
|
||||||
this.inlava = false;
|
this.inlava = false;
|
||||||
this.setX = false;
|
this.setX = false;
|
||||||
|
@ -1049,7 +1087,7 @@ function Box(x, y, w, h, xvel, yvel, colgroup, gravity, airRes){
|
||||||
}else{
|
}else{
|
||||||
this.x = ((this.x >> 4) << 4) + (this.xvel > 0 ? 16 - (((this.width - 1) % 16) + 1) : 16);
|
this.x = ((this.x >> 4) << 4) + (this.xvel > 0 ? 16 - (((this.width - 1) % 16) + 1) : 16);
|
||||||
}
|
}
|
||||||
this.xvel = 0;
|
this.xvel = this.xvel * this.bounce;
|
||||||
velToKill = 0;
|
velToKill = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1074,7 +1112,7 @@ function Box(x, y, w, h, xvel, yvel, colgroup, gravity, airRes){
|
||||||
if(this.yvel < 0){
|
if(this.yvel < 0){
|
||||||
this.down = true;
|
this.down = true;
|
||||||
}
|
}
|
||||||
this.yvel = 0;
|
this.yvel = this.yvel * this.bounce;
|
||||||
velToKill = 0;
|
velToKill = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1142,7 +1180,9 @@ function drawLevel(lv){ // Draw level
|
||||||
}
|
}
|
||||||
context.fillRect((j << 4) - r(lookx), i << 4, 16, 16);
|
context.fillRect((j << 4) - r(lookx), i << 4, 16, 16);
|
||||||
}else if(lv[i][j] == 'E'){
|
}else if(lv[i][j] == 'E'){
|
||||||
switch(Math.floor(Math.random() * (lvDis[levelNo] + 0.999))){
|
var enemyToAdd = Math.floor(Math.random() * (lvDis[levelNo] + 0.999));
|
||||||
|
if(endAdded || totalEnemies < (level[0].length / 100)){
|
||||||
|
switch(enemyToAdd){
|
||||||
case 0:
|
case 0:
|
||||||
actors[actors.length] = new Actor(8, 1, 80, 5, 80, 3, j << 4, i << 4, 16, 16);
|
actors[actors.length] = new Actor(8, 1, 80, 5, 80, 3, j << 4, i << 4, 16, 16);
|
||||||
ais[ais.length] = new Ai(actors.length - 1, 'pace');
|
ais[ais.length] = new Ai(actors.length - 1, 'pace');
|
||||||
|
@ -1152,12 +1192,17 @@ function drawLevel(lv){ // Draw level
|
||||||
ais[ais.length] = new Ai(actors.length - 1, 'alphaBot');
|
ais[ais.length] = new Ai(actors.length - 1, 'alphaBot');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
totalEnemies += 1;
|
||||||
|
}
|
||||||
level[i] = setStrChar(level[i], j, '.');
|
level[i] = setStrChar(level[i], j, '.');
|
||||||
}else if(lv[i][j] == 'H'){
|
}else if(lv[i][j] == 'H'){
|
||||||
items[items.length] = new Item(0, j << 4, i << 4);
|
items[items.length] = new Item(0, j << 4, i << 4);
|
||||||
level[i] = setStrChar(level[i], j, '.');
|
level[i] = setStrChar(level[i], j, '.');
|
||||||
}else if(parseInt(lv[i][j]) > -1){
|
}else if(parseInt(lv[i][j]) > -1){
|
||||||
|
if(endAdded || totalLevelScore < (level[0].length / 20) * (levelNo + 2)){
|
||||||
items[items.length] = new Item(parseInt(lv[i][j]) + 2, j << 4, i << 4);
|
items[items.length] = new Item(parseInt(lv[i][j]) + 2, j << 4, i << 4);
|
||||||
|
totalLevelScore += [5, 10, 20, 50][lv[i][j]];
|
||||||
|
}
|
||||||
level[i] = setStrChar(level[i], j, '.');
|
level[i] = setStrChar(level[i], j, '.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1236,7 @@ function loopGame(){
|
||||||
var toInsert = levelparts[0];
|
var toInsert = levelparts[0];
|
||||||
partsInserted.push([false, '5n', 1, 1, 0, 0]);
|
partsInserted.push([false, '5n', 1, 1, 0, 0]);
|
||||||
partFound = true;
|
partFound = true;
|
||||||
}else if(level[0].length >= (20000 + (5000 * levelNo) >> 4)){
|
}else if(level[0].length >= (20000 + (5000 * levelNo) >> 4) && gameMode == 'adventure'){
|
||||||
var toInsert = levelends[levelNo];
|
var toInsert = levelends[levelNo];
|
||||||
partsInserted.push([false, '5n', 1, 1, 0, 0]);
|
partsInserted.push([false, '5n', 1, 1, 0, 0]);
|
||||||
partFound = true;
|
partFound = true;
|
||||||
|
@ -1220,6 +1265,10 @@ function loopGame(){
|
||||||
level = timelevels[levelNo];
|
level = timelevels[levelNo];
|
||||||
limitRight = (level[0].length << 4) - 516;
|
limitRight = (level[0].length << 4) - 516;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(limitLeft < actors[0].x - 8000){
|
||||||
|
limitLeft = actors[0].x - 8000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for(i in controllers){
|
for(i in controllers){
|
||||||
controllers[i].checkKeys();
|
controllers[i].checkKeys();
|
||||||
|
@ -1306,9 +1355,9 @@ function loopGame(){
|
||||||
if(mobile){
|
if(mobile){
|
||||||
context.fillText('RetX: ' + r(mouse.x), 420, 290);
|
context.fillText('RetX: ' + r(mouse.x), 420, 290);
|
||||||
context.fillText('RetX: ' + r(mouse.y), 490, 290);
|
context.fillText('RetX: ' + r(mouse.y), 490, 290);
|
||||||
context.fillText('Sint mobile version α 0.7.1', 490, 310);
|
context.fillText('Sint mobile version α 0.7.2', 490, 310);
|
||||||
}else{
|
}else{
|
||||||
context.fillText('Sint version α 0.7.1', 490, 20); // β
|
context.fillText('Sint version α 0.7.2', 490, 20); // β
|
||||||
if(cookies && game == 'menu'){
|
if(cookies && game == 'menu'){
|
||||||
context.fillText('Sint uses cookies to remember', 490, 290);
|
context.fillText('Sint uses cookies to remember', 490, 290);
|
||||||
context.fillText('options and time trial records', 490, 310);
|
context.fillText('options and time trial records', 490, 310);
|
||||||
|
@ -1359,9 +1408,9 @@ function loopGame(){
|
||||||
context.fillText('Points: ' + score, 250, 125);
|
context.fillText('Points: ' + score, 250, 125);
|
||||||
context.fillStyle = (ui.select == 3 ? 'fff' : '#eef');
|
context.fillStyle = (ui.select == 3 ? 'fff' : '#eef');
|
||||||
context.fillText('Continue', 250, 253);
|
context.fillText('Continue', 250, 253);
|
||||||
context.fillStyle = (score < upgrades.health[upgrades.healthOn] ? (ui.select == 0 ? '#f98' : '#fcd') : (ui.select == 2 ? '#fff' : '#eef'));
|
context.fillStyle = (score < upgrades.health[upgrades.healthOn] ? (ui.select == 0 ? '#f98' : '#fcd') : (ui.select == 0 ? '#fff' : '#eef'));
|
||||||
context.fillText('Upgrade health +100: ' + upgrades.health[upgrades.healthOn], 250, 153);
|
context.fillText('Upgrade health +100: ' + upgrades.health[upgrades.healthOn], 250, 153);
|
||||||
context.fillStyle = (score < upgrades.energy[upgrades.energyOn] ? (ui.select == 1 ? '#f98' : '#fcd') : (ui.select == 2 ? '#fff' : '#eef'));
|
context.fillStyle = (score < upgrades.energy[upgrades.energyOn] ? (ui.select == 1 ? '#f98' : '#fcd') : (ui.select == 1 ? '#fff' : '#eef'));
|
||||||
context.fillText('Upgrade max energy +100: ' + upgrades.energy[upgrades.energyOn], 250, 183);
|
context.fillText('Upgrade max energy +100: ' + upgrades.energy[upgrades.energyOn], 250, 183);
|
||||||
context.fillStyle = (score < upgrades.powers[actors[0].powers - 1] && actors[0].powers < 8 ? (ui.select == 2 ? '#f98' : '#fcd') : (ui.select == 2 ? '#fff' : '#eef'));
|
context.fillStyle = (score < upgrades.powers[actors[0].powers - 1] && actors[0].powers < 8 ? (ui.select == 2 ? '#f98' : '#fcd') : (ui.select == 2 ? '#fff' : '#eef'));
|
||||||
context.fillText('Unlock next power: ' + upgrades.powers[actors[0].powers - 1], 250, 213);
|
context.fillText('Unlock next power: ' + upgrades.powers[actors[0].powers - 1], 250, 213);
|
||||||
|
@ -1459,6 +1508,11 @@ function loopGame(){
|
||||||
game = 'playing';
|
game = 'playing';
|
||||||
gameMode = 'free';
|
gameMode = 'free';
|
||||||
levelNo = 19;
|
levelNo = 19;
|
||||||
|
actors[0].powers = 8;
|
||||||
|
actors[0].maxhealth = 500;
|
||||||
|
actors[0].health = 500;
|
||||||
|
actors[0].maxenergy = 500;
|
||||||
|
actors[0].energy = 500;
|
||||||
break;
|
break;
|
||||||
case 'time':
|
case 'time':
|
||||||
play();
|
play();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue