User prompt
So every so often red sunbeams appear that need two snowflakes to be destroyed.
User prompt
So the song Frozen Savior plays all the time in the game
User prompt
So when the ice cube is destroyed it generates ice particles ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Create a power up that makes you throw 10 snowflakes instead of 1 for 5 seconds ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
So the sun rays are bigger and there is a problem that makes the canyon shake, solve it
User prompt
So the snowflakes are bigger
User prompt
Now so the cannon is bigger much bigger
User prompt
So the game gets bigger
Code edit (1 edits merged)
Please save this source code
User prompt
Arctic Guardian: Polar Bear Rescue
Initial prompt
Create a game where you have to move an ice beam from right to left that points upwards, that every 2 seconds throws a snowflake and that rays of sun fall randomly from the sky And they are destroyed by colliding with snowflakes the objective is to protect the Arctic from the sun's rays at the top a sad polar bear appears in a block of ice when you complete a level it will change Happy polar bear
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Cannon = Container.expand(function () {
var self = Container.call(this);
var cannonGraphics = self.attachAsset('cannon', {
anchorX: 0.5,
anchorY: 1.0
});
// Shield effect
var shieldGraphics = self.attachAsset('snowflake', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3,
scaleY: 3,
alpha: 0,
y: -40
});
shieldGraphics.tint = 0x00ffff;
self.moveSpeed = 8;
self.isMoving = false;
self.targetX = self.x;
self.hasShield = false;
self.shieldTime = 0;
self.rapidFireActive = false;
self.rapidFireTime = 0;
self.shieldBobTimer = 0;
self.update = function () {
if (self.isMoving) {
var diff = self.targetX - self.x;
if (Math.abs(diff) > 2) {
self.x += diff > 0 ? self.moveSpeed : -self.moveSpeed;
} else {
self.x = self.targetX;
self.isMoving = false;
}
}
// Keep cannon within screen bounds
if (self.x < 60) self.x = 60;
if (self.x > 1988) self.x = 1988;
// Update shield
if (self.hasShield) {
self.shieldTime--;
self.shieldBobTimer += 0.1;
shieldGraphics.alpha = 0.6 + Math.sin(self.shieldBobTimer) * 0.2;
shieldGraphics.rotation += 0.05;
if (self.shieldTime <= 0) {
self.hasShield = false;
shieldGraphics.alpha = 0;
}
}
// Update rapid fire
if (self.rapidFireActive) {
self.rapidFireTime--;
cannonGraphics.tint = 0xff6600;
if (self.rapidFireTime <= 0) {
self.rapidFireActive = false;
cannonGraphics.tint = 0xffffff;
}
}
};
self.moveTo = function (targetX) {
self.targetX = targetX;
self.isMoving = true;
};
self.activateShield = function () {
self.hasShield = true;
self.shieldTime = 600; // 10 seconds at 60fps
};
self.activateRapidFire = function () {
self.rapidFireActive = true;
self.rapidFireTime = 600; // 10 seconds at 60fps
};
return self;
});
var ParticleEffect = Container.expand(function () {
var self = Container.call(this);
var particles = [];
self.createExplosion = function (x, y, color, count) {
for (var i = 0; i < count; i++) {
var particle = self.attachAsset('snowflake', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.3,
scaleY: 0.3,
x: x,
y: y
});
particle.tint = color;
var angle = Math.PI * 2 * i / count;
var speed = 100 + Math.random() * 100;
particle.vx = Math.cos(angle) * speed;
particle.vy = Math.sin(angle) * speed;
particle.life = 60; // frames
particles.push(particle);
}
};
self.update = function () {
for (var i = particles.length - 1; i >= 0; i--) {
var particle = particles[i];
particle.x += particle.vx * 0.016;
particle.y += particle.vy * 0.016;
particle.vy += 200 * 0.016; // gravity
particle.life--;
particle.alpha = particle.life / 60;
if (particle.life <= 0) {
particle.destroy();
particles.splice(i, 1);
}
}
};
return self;
});
var PolarBearDisplay = Container.expand(function () {
var self = Container.call(this);
var iceBlock = self.attachAsset('iceblocksad', {
anchorX: 0.5,
anchorY: 0.5
});
var bearSad = self.attachAsset('polarbearsad', {
anchorX: 0.5,
anchorY: 0.5,
y: 10
});
var bearHappy = self.attachAsset('polarbearhappy', {
anchorX: 0.5,
anchorY: 0.5,
y: 10,
alpha: 0
});
self.showHappy = function () {
tween(iceBlock, {
alpha: 0
}, {
duration: 1000
});
tween(bearSad, {
alpha: 0
}, {
duration: 1000
});
tween(bearHappy, {
alpha: 1
}, {
duration: 1000
});
};
return self;
});
var PowerUp = Container.expand(function () {
var self = Container.call(this);
self.type = 'shield'; // 'shield' or 'rapidfire'
var powerUpGraphics = self.attachAsset('snowflake', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
scaleY: 1.5
});
if (self.type === 'rapidfire') {
powerUpGraphics.tint = 0xff6600;
} else {
powerUpGraphics.tint = 0x00ffff;
}
self.speed = 2;
self.bobTimer = 0;
self.update = function () {
self.y += self.speed;
self.bobTimer += 0.1;
powerUpGraphics.y = Math.sin(self.bobTimer) * 10;
powerUpGraphics.rotation += 0.05;
};
return self;
});
var Snowflake = Container.expand(function () {
var self = Container.call(this);
var snowflakeGraphics = self.attachAsset('snowflake', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -12;
self.update = function () {
self.y += self.speed;
};
return self;
});
var SunRay = Container.expand(function () {
var self = Container.call(this);
var sunrayGraphics = self.attachAsset('sunray', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 4;
self.update = function () {
self.y += self.speed;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
var cannon;
var snowflakes = [];
var sunrays = [];
var powerUps = [];
var polarBearDisplay;
var particleSystem;
var lastShotTime = 0;
var lastSunRaySpawn = 0;
var lastPowerUpSpawn = 0;
var sunRaySpawnInterval = 3000; // 3 seconds initially
var powerUpSpawnInterval = 15000; // 15 seconds
var raysDestroyed = 0;
var raysNeededForLevel = 10;
var currentLevel = 1;
var gameWon = false;
var totalScore = 0;
var combo = 0;
var comboTimer = 0;
// Create score display
var scoreText = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
// Create combo display
var comboText = new Text2('', {
size: 40,
fill: 0xFFD700
});
comboText.anchor.set(0.5, 0);
comboText.y = 80;
LK.gui.top.addChild(comboText);
// Create level display
var levelText = new Text2('Level: 1', {
size: 50,
fill: 0xFFFFFF
});
levelText.anchor.set(0, 0);
levelText.x = 150;
levelText.y = 20;
LK.gui.topRight.addChild(levelText);
// Create power-up status
var powerUpText = new Text2('', {
size: 35,
fill: 0x00FFFF
});
powerUpText.anchor.set(0, 0);
powerUpText.x = 150;
powerUpText.y = 80;
LK.gui.topRight.addChild(powerUpText);
// Create cannon
cannon = game.addChild(new Cannon());
cannon.x = 1024;
cannon.y = 2680;
// Create particle system
particleSystem = game.addChild(new ParticleEffect());
// Create polar bear display
polarBearDisplay = game.addChild(new PolarBearDisplay());
polarBearDisplay.x = 1024;
polarBearDisplay.y = 200;
// Touch controls
game.down = function (x, y, obj) {
cannon.moveTo(x);
};
game.move = function (x, y, obj) {
cannon.moveTo(x);
};
// Main game update loop
game.update = function () {
var currentTime = LK.ticks * 16.67; // Convert to milliseconds
// Update combo timer
if (comboTimer > 0) {
comboTimer--;
if (comboTimer <= 0) {
combo = 0;
comboText.setText('');
}
}
// Auto-shoot snowflakes (faster with rapid fire)
var shootInterval = cannon.rapidFireActive ? 500 : 2000;
if (currentTime - lastShotTime >= shootInterval) {
var newSnowflake = new Snowflake();
newSnowflake.x = cannon.x;
newSnowflake.y = cannon.y - 50;
newSnowflake.lastY = newSnowflake.y;
snowflakes.push(newSnowflake);
game.addChild(newSnowflake);
lastShotTime = currentTime;
LK.getSound('shoot').play();
}
// Spawn sun rays
if (currentTime - lastSunRaySpawn >= sunRaySpawnInterval) {
var newSunRay = new SunRay();
newSunRay.x = Math.random() * (2048 - 120) + 60;
newSunRay.y = -30;
newSunRay.lastY = newSunRay.y;
sunrays.push(newSunRay);
game.addChild(newSunRay);
lastSunRaySpawn = currentTime;
// Randomly vary spawn interval
sunRaySpawnInterval = Math.max(800, 2000 + Math.random() * 2000 - currentLevel * 100);
}
// Spawn power-ups
if (currentTime - lastPowerUpSpawn >= powerUpSpawnInterval) {
var newPowerUp = new PowerUp();
newPowerUp.type = Math.random() < 0.5 ? 'shield' : 'rapidfire';
newPowerUp.x = Math.random() * (2048 - 200) + 100;
newPowerUp.y = -30;
powerUps.push(newPowerUp);
game.addChild(newPowerUp);
lastPowerUpSpawn = currentTime;
powerUpSpawnInterval = 12000 + Math.random() * 8000;
}
// Update power-up status display
var statusText = '';
if (cannon.hasShield) {
statusText += 'SHIELD: ' + Math.ceil(cannon.shieldTime / 60) + 's ';
}
if (cannon.rapidFireActive) {
statusText += 'RAPID FIRE: ' + Math.ceil(cannon.rapidFireTime / 60) + 's';
}
powerUpText.setText(statusText);
// Update and check snowflakes
for (var i = snowflakes.length - 1; i >= 0; i--) {
var snowflake = snowflakes[i];
// Check if snowflake went off screen
if (snowflake.lastY >= -50 && snowflake.y < -50) {
snowflake.destroy();
snowflakes.splice(i, 1);
continue;
}
snowflake.lastY = snowflake.y;
}
// Update power-ups
for (var p = powerUps.length - 1; p >= 0; p--) {
var powerUp = powerUps[p];
if (powerUp.y > 2800) {
powerUp.destroy();
powerUps.splice(p, 1);
continue;
}
// Check collision with cannon
if (powerUp.intersects(cannon)) {
if (powerUp.type === 'shield') {
cannon.activateShield();
} else if (powerUp.type === 'rapidfire') {
cannon.activateRapidFire();
}
particleSystem.createExplosion(powerUp.x, powerUp.y, 0x00ffff, 8);
powerUp.destroy();
powerUps.splice(p, 1);
}
}
// Update and check sun rays
for (var j = sunrays.length - 1; j >= 0; j--) {
var sunray = sunrays[j];
// Check if sun ray reached ground
if (sunray.lastY <= 2750 && sunray.y > 2750) {
if (!cannon.hasShield) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
} else {
// Shield absorbs the hit
cannon.hasShield = false;
cannon.shieldTime = 0;
particleSystem.createExplosion(sunray.x, sunray.y, 0x00ffff, 12);
sunray.destroy();
sunrays.splice(j, 1);
}
}
sunray.lastY = sunray.y;
}
// Check collisions between snowflakes and sun rays
for (var s = snowflakes.length - 1; s >= 0; s--) {
var snowflake = snowflakes[s];
for (var r = sunrays.length - 1; r >= 0; r--) {
var sunray = sunrays[r];
if (snowflake.intersects(sunray)) {
// Collision detected
raysDestroyed++;
combo++;
comboTimer = 180; // 3 seconds at 60fps
var points = 10 + (combo - 1) * 5;
totalScore += points;
scoreText.setText('Score: ' + totalScore);
if (combo > 1) {
comboText.setText('COMBO x' + combo + ' (+' + points + ')');
}
LK.getSound('hit').play();
// Create explosion effect
particleSystem.createExplosion(sunray.x, sunray.y, 0xffd700, 10);
// Remove both objects
snowflake.destroy();
snowflakes.splice(s, 1);
sunray.destroy();
sunrays.splice(r, 1);
// Check level completion
if (raysDestroyed >= raysNeededForLevel && !gameWon) {
gameWon = true;
polarBearDisplay.showHappy();
LK.getSound('levelcomplete').play();
LK.setTimeout(function () {
// Next level
currentLevel++;
levelText.setText('Level: ' + currentLevel);
raysNeededForLevel += 5;
gameWon = false;
combo = 0;
comboTimer = 0;
comboText.setText('');
// Reset polar bear display
polarBearDisplay.destroy();
polarBearDisplay = game.addChild(new PolarBearDisplay());
polarBearDisplay.x = 1024;
polarBearDisplay.y = 200;
}, 3000);
}
break;
}
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -11,11 +11,26 @@
var cannonGraphics = self.attachAsset('cannon', {
anchorX: 0.5,
anchorY: 1.0
});
+ // Shield effect
+ var shieldGraphics = self.attachAsset('snowflake', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 3,
+ scaleY: 3,
+ alpha: 0,
+ y: -40
+ });
+ shieldGraphics.tint = 0x00ffff;
self.moveSpeed = 8;
self.isMoving = false;
self.targetX = self.x;
+ self.hasShield = false;
+ self.shieldTime = 0;
+ self.rapidFireActive = false;
+ self.rapidFireTime = 0;
+ self.shieldBobTimer = 0;
self.update = function () {
if (self.isMoving) {
var diff = self.targetX - self.x;
if (Math.abs(diff) > 2) {
@@ -27,15 +42,81 @@
}
// Keep cannon within screen bounds
if (self.x < 60) self.x = 60;
if (self.x > 1988) self.x = 1988;
+ // Update shield
+ if (self.hasShield) {
+ self.shieldTime--;
+ self.shieldBobTimer += 0.1;
+ shieldGraphics.alpha = 0.6 + Math.sin(self.shieldBobTimer) * 0.2;
+ shieldGraphics.rotation += 0.05;
+ if (self.shieldTime <= 0) {
+ self.hasShield = false;
+ shieldGraphics.alpha = 0;
+ }
+ }
+ // Update rapid fire
+ if (self.rapidFireActive) {
+ self.rapidFireTime--;
+ cannonGraphics.tint = 0xff6600;
+ if (self.rapidFireTime <= 0) {
+ self.rapidFireActive = false;
+ cannonGraphics.tint = 0xffffff;
+ }
+ }
};
self.moveTo = function (targetX) {
self.targetX = targetX;
self.isMoving = true;
};
+ self.activateShield = function () {
+ self.hasShield = true;
+ self.shieldTime = 600; // 10 seconds at 60fps
+ };
+ self.activateRapidFire = function () {
+ self.rapidFireActive = true;
+ self.rapidFireTime = 600; // 10 seconds at 60fps
+ };
return self;
});
+var ParticleEffect = Container.expand(function () {
+ var self = Container.call(this);
+ var particles = [];
+ self.createExplosion = function (x, y, color, count) {
+ for (var i = 0; i < count; i++) {
+ var particle = self.attachAsset('snowflake', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.3,
+ scaleY: 0.3,
+ x: x,
+ y: y
+ });
+ particle.tint = color;
+ var angle = Math.PI * 2 * i / count;
+ var speed = 100 + Math.random() * 100;
+ particle.vx = Math.cos(angle) * speed;
+ particle.vy = Math.sin(angle) * speed;
+ particle.life = 60; // frames
+ particles.push(particle);
+ }
+ };
+ self.update = function () {
+ for (var i = particles.length - 1; i >= 0; i--) {
+ var particle = particles[i];
+ particle.x += particle.vx * 0.016;
+ particle.y += particle.vy * 0.016;
+ particle.vy += 200 * 0.016; // gravity
+ particle.life--;
+ particle.alpha = particle.life / 60;
+ if (particle.life <= 0) {
+ particle.destroy();
+ particles.splice(i, 1);
+ }
+ }
+ };
+ return self;
+});
var PolarBearDisplay = Container.expand(function () {
var self = Container.call(this);
var iceBlock = self.attachAsset('iceblocksad', {
anchorX: 0.5,
@@ -70,8 +151,32 @@
});
};
return self;
});
+var PowerUp = Container.expand(function () {
+ var self = Container.call(this);
+ self.type = 'shield'; // 'shield' or 'rapidfire'
+ var powerUpGraphics = self.attachAsset('snowflake', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 1.5,
+ scaleY: 1.5
+ });
+ if (self.type === 'rapidfire') {
+ powerUpGraphics.tint = 0xff6600;
+ } else {
+ powerUpGraphics.tint = 0x00ffff;
+ }
+ self.speed = 2;
+ self.bobTimer = 0;
+ self.update = function () {
+ self.y += self.speed;
+ self.bobTimer += 0.1;
+ powerUpGraphics.y = Math.sin(self.bobTimer) * 10;
+ powerUpGraphics.rotation += 0.05;
+ };
+ return self;
+});
var Snowflake = Container.expand(function () {
var self = Container.call(this);
var snowflakeGraphics = self.attachAsset('snowflake', {
anchorX: 0.5,
@@ -108,23 +213,38 @@
****/
var cannon;
var snowflakes = [];
var sunrays = [];
+var powerUps = [];
var polarBearDisplay;
+var particleSystem;
var lastShotTime = 0;
var lastSunRaySpawn = 0;
+var lastPowerUpSpawn = 0;
var sunRaySpawnInterval = 3000; // 3 seconds initially
+var powerUpSpawnInterval = 15000; // 15 seconds
var raysDestroyed = 0;
var raysNeededForLevel = 10;
var currentLevel = 1;
var gameWon = false;
+var totalScore = 0;
+var combo = 0;
+var comboTimer = 0;
// Create score display
-var scoreText = new Text2('Rays Destroyed: 0', {
+var scoreText = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
+// Create combo display
+var comboText = new Text2('', {
+ size: 40,
+ fill: 0xFFD700
+});
+comboText.anchor.set(0.5, 0);
+comboText.y = 80;
+LK.gui.top.addChild(comboText);
// Create level display
var levelText = new Text2('Level: 1', {
size: 50,
fill: 0xFFFFFF
@@ -132,12 +252,23 @@
levelText.anchor.set(0, 0);
levelText.x = 150;
levelText.y = 20;
LK.gui.topRight.addChild(levelText);
+// Create power-up status
+var powerUpText = new Text2('', {
+ size: 35,
+ fill: 0x00FFFF
+});
+powerUpText.anchor.set(0, 0);
+powerUpText.x = 150;
+powerUpText.y = 80;
+LK.gui.topRight.addChild(powerUpText);
// Create cannon
cannon = game.addChild(new Cannon());
cannon.x = 1024;
cannon.y = 2680;
+// Create particle system
+particleSystem = game.addChild(new ParticleEffect());
// Create polar bear display
polarBearDisplay = game.addChild(new PolarBearDisplay());
polarBearDisplay.x = 1024;
polarBearDisplay.y = 200;
@@ -150,10 +281,19 @@
};
// Main game update loop
game.update = function () {
var currentTime = LK.ticks * 16.67; // Convert to milliseconds
- // Auto-shoot snowflakes every 2 seconds
- if (currentTime - lastShotTime >= 2000) {
+ // Update combo timer
+ if (comboTimer > 0) {
+ comboTimer--;
+ if (comboTimer <= 0) {
+ combo = 0;
+ comboText.setText('');
+ }
+ }
+ // Auto-shoot snowflakes (faster with rapid fire)
+ var shootInterval = cannon.rapidFireActive ? 500 : 2000;
+ if (currentTime - lastShotTime >= shootInterval) {
var newSnowflake = new Snowflake();
newSnowflake.x = cannon.x;
newSnowflake.y = cannon.y - 50;
newSnowflake.lastY = newSnowflake.y;
@@ -171,10 +311,30 @@
sunrays.push(newSunRay);
game.addChild(newSunRay);
lastSunRaySpawn = currentTime;
// Randomly vary spawn interval
- sunRaySpawnInterval = 2000 + Math.random() * 2000;
+ sunRaySpawnInterval = Math.max(800, 2000 + Math.random() * 2000 - currentLevel * 100);
}
+ // Spawn power-ups
+ if (currentTime - lastPowerUpSpawn >= powerUpSpawnInterval) {
+ var newPowerUp = new PowerUp();
+ newPowerUp.type = Math.random() < 0.5 ? 'shield' : 'rapidfire';
+ newPowerUp.x = Math.random() * (2048 - 200) + 100;
+ newPowerUp.y = -30;
+ powerUps.push(newPowerUp);
+ game.addChild(newPowerUp);
+ lastPowerUpSpawn = currentTime;
+ powerUpSpawnInterval = 12000 + Math.random() * 8000;
+ }
+ // Update power-up status display
+ var statusText = '';
+ if (cannon.hasShield) {
+ statusText += 'SHIELD: ' + Math.ceil(cannon.shieldTime / 60) + 's ';
+ }
+ if (cannon.rapidFireActive) {
+ statusText += 'RAPID FIRE: ' + Math.ceil(cannon.rapidFireTime / 60) + 's';
+ }
+ powerUpText.setText(statusText);
// Update and check snowflakes
for (var i = snowflakes.length - 1; i >= 0; i--) {
var snowflake = snowflakes[i];
// Check if snowflake went off screen
@@ -184,16 +344,45 @@
continue;
}
snowflake.lastY = snowflake.y;
}
+ // Update power-ups
+ for (var p = powerUps.length - 1; p >= 0; p--) {
+ var powerUp = powerUps[p];
+ if (powerUp.y > 2800) {
+ powerUp.destroy();
+ powerUps.splice(p, 1);
+ continue;
+ }
+ // Check collision with cannon
+ if (powerUp.intersects(cannon)) {
+ if (powerUp.type === 'shield') {
+ cannon.activateShield();
+ } else if (powerUp.type === 'rapidfire') {
+ cannon.activateRapidFire();
+ }
+ particleSystem.createExplosion(powerUp.x, powerUp.y, 0x00ffff, 8);
+ powerUp.destroy();
+ powerUps.splice(p, 1);
+ }
+ }
// Update and check sun rays
for (var j = sunrays.length - 1; j >= 0; j--) {
var sunray = sunrays[j];
- // Check if sun ray reached ground (game over condition)
+ // Check if sun ray reached ground
if (sunray.lastY <= 2750 && sunray.y > 2750) {
- LK.effects.flashScreen(0xff0000, 1000);
- LK.showGameOver();
- return;
+ if (!cannon.hasShield) {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ return;
+ } else {
+ // Shield absorbs the hit
+ cannon.hasShield = false;
+ cannon.shieldTime = 0;
+ particleSystem.createExplosion(sunray.x, sunray.y, 0x00ffff, 12);
+ sunray.destroy();
+ sunrays.splice(j, 1);
+ }
}
sunray.lastY = sunray.y;
}
// Check collisions between snowflakes and sun rays
@@ -203,10 +392,19 @@
var sunray = sunrays[r];
if (snowflake.intersects(sunray)) {
// Collision detected
raysDestroyed++;
- scoreText.setText('Rays Destroyed: ' + raysDestroyed);
+ combo++;
+ comboTimer = 180; // 3 seconds at 60fps
+ var points = 10 + (combo - 1) * 5;
+ totalScore += points;
+ scoreText.setText('Score: ' + totalScore);
+ if (combo > 1) {
+ comboText.setText('COMBO x' + combo + ' (+' + points + ')');
+ }
LK.getSound('hit').play();
+ // Create explosion effect
+ particleSystem.createExplosion(sunray.x, sunray.y, 0xffd700, 10);
// Remove both objects
snowflake.destroy();
snowflakes.splice(s, 1);
sunray.destroy();
@@ -220,10 +418,12 @@
// Next level
currentLevel++;
levelText.setText('Level: ' + currentLevel);
raysNeededForLevel += 5;
- sunRaySpawnInterval = Math.max(1000, sunRaySpawnInterval - 200);
gameWon = false;
+ combo = 0;
+ comboTimer = 0;
+ comboText.setText('');
// Reset polar bear display
polarBearDisplay.destroy();
polarBearDisplay = game.addChild(new PolarBearDisplay());
polarBearDisplay.x = 1024;
Snowflake. In-Game asset. 2d. High contrast. No shadows
Sad baby polar bear. In-Game asset. 2d. High contrast. No shadows
Happy baby polar bear. In-Game asset. 2d. High contrast. No shadows
Gigantic ice tundra. In-Game asset. 2d. High contrast. No shadows
Ice cube seen from the front. In-Game asset. 2d. High contrast. No shadows