Code edit (1 edits merged)
Please save this source code
User prompt
make sure to spawn the badelves at available locations only in this code script if (Math.random() < 0.1) { for (var i = 0; i < 3; i++) { var extraBadElf = new BadElf(availablelocation.x, availablelocation.y, self); self.addChildAt(extraBadElf, self.getChildIndex(boxBackground) + 1); self.activeBadElves++; } } if (Math.random() < 0.2) { var extraBadElf1 = new BadElf(location.x, location.y, self); self.addChildAt(extraBadElf1, self.getChildIndex(boxBackground) + 1); self.activeBadElves++; var extraBadElf2 = new BadElf(location.x, location.y, self); self.addChildAt(extraBadElf2, self.getChildIndex(boxBackground) + 1); self.activeBadElves++; } if (Math.random() < 0.35) { var extraBadElf = new BadElf(location.x, location.y, self); self.addChildAt(extraBadElf, self.getChildIndex(boxBackground) + 1); self.activeBadElves++; }
Code edit (18 edits merged)
Please save this source code
User prompt
the additional badelf instances should not overlap each other, they should spawn at the other available spawn locations
User prompt
Introduce 10% chance to spawn three additional BadElf when spawning a BadElf.
User prompt
Introduce 20% chance to spawn two additional BadElf when spawning a BadElf.
User prompt
there should be a 35% chance two badelves spawn simultanously
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
each time the score increases by 50, spawning badelves should become 10% faster
Code edit (6 edits merged)
Please save this source code
User prompt
Fix Bug: 'timeout callback must be a function' in this line: 'LK.setInterval(Math.random() * (5000 - 2500));' Line Number: 381
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
if (LK.getScore() < 50) { LK.setInterval(self.spawnBadElf, Math.random() * (5000 - 3000));
Code edit (6 edits merged)
Please save this source code
User prompt
if score is less than 50 LK.setInterval(self.spawnBadElf, Math.random() * (6000 - 3000) + 3000);
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
if score is equal or lower than 50 set self.activeBadElves < 2 if score is equal or higher than 125 set self.activeBadElves < 3 if score is equal or higher than 175 set self.activeBadElves < 4 if score is equal or higher than 250 set self.activeBadElves < 5 if score is equal or higher than 300 set self.activeBadElves < 6
Code edit (8 edits merged)
Please save this source code
User prompt
if score is equal or lower than 50 self.activeBadElves < 2 if score is equal or lower than 125 self.activeBadElves < 3 if score is equal or lower than 175 self.activeBadElves < 4 if score is equal or lower than 250 self.activeBadElves < 5 if score is equal or higherthan 300 self.activeBadElves < 6
Code edit (5 edits merged)
Please save this source code
User prompt
box layer should be below badelf
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -101,11 +101,9 @@
} else {
LK.clearInterval(fadeOutInterval);
self.gameInstance.activeBadElves--;
self.destroy();
- LK.setTimeout(function () {
- self.gameInstance.spawnBadElf();
- }, 2000);
+ LK.setTimeout(function () {}, 2000);
}
};
LK.clearInterval(self.magicShootingInterval);
fadeOutInterval = LK.setInterval(fadeOut, 60);
@@ -263,11 +261,8 @@
self.y = -crosshairGraphics.height / 2;
});
var Game = Container.expand(function () {
var self = Container.call(this);
- LK.setInterval(function () {
- self.spawnBadElf();
- }, Math.random() * (5000 - 2500) + 2500);
this.barnMovedDown = false;
this.triggerGameOver = function () {
this.isGameOver = true;
LK.showGameOver();
@@ -373,23 +368,19 @@
self.scoreText.setText(self.score.toString());
LK.setScore(self.score);
var scoreIncrease = self.score - previousScore;
if (scoreIncrease >= 20) {
- var newInterval = self.badElfSpawnInterval * 1.5;
+ var newInterval = self.badElfSpawnInterval / 1.2;
self.badElfSpawnInterval = Math.max(newInterval, self.minimumSpawnInterval);
LK.clearInterval(self.badElfSpawnTimer);
self.badElfSpawnTimer = LK.setInterval(self.spawnBadElf, self.badElfSpawnInterval);
}
};
- self.badElfSpawnInterval = 6000;
- self.minimumSpawnInterval = 500;
+ self.badElfSpawnInterval = 5000;
+ self.minimumSpawnInterval = 1000;
self.badElfSpawnTimer = LK.setInterval(self.spawnBadElf, self.badElfSpawnInterval);
}
}, fadeOutDuration * fadeOutStep);
- if (LK.getScore() < 50) {
- self.spawnBadElf();
- LK.setInterval(self.spawnBadElf, Math.random() * (5000 - 3000) + 1000);
- }
self.generateMistletoes = function () {
LK.setTimeout(function () {
var newMistletoe = new Mistletoe();
var boundaryOffset = 100;
@@ -545,8 +536,13 @@
var scaleModifier = Math.random() * 0.25 + 0.75;
badElf.scale.set(scaleModifier, scaleModifier);
self.addChildAt(badElf, self.getChildIndex(boxBackground) + 1);
self.activeBadElves++;
+ if (Math.random() < 0.35) {
+ var extraBadElf = new BadElf(location.x, location.y, self);
+ self.addChildAt(extraBadElf, self.getChildIndex(boxBackground) + 1);
+ self.activeBadElves++;
+ }
}
};
var muzzleFlash = new MuzzleFlash();
muzzleFlash.x = santa.x - santa.santaGraphics.width + 400;
over the shoulder santa firing a revolver Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d transparent christmas crosshair Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d 3rd person front view of a christmas town square with a starry sky Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Christmas sparkles png Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
circular christmas golden star pattern transparent png Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas brick wall Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d opened christmas crate Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d diagonal christmas car or truck in snow Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a christmas poster showcasing miss santa clause Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a single white snowflake Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d stacked christmas winter tire Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d stacked christmas winter tire Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas magical mistletoe Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas 357 Magnum bullets Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d silhouette of a flying reindeer with a red glowy nose Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas dark sparkles Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas evil robot elf with a gun Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d pile of gray and red nuts and bolts Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
transparent snow sphere. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
snd_pistol
Sound effect
snd_enemyshot
Sound effect
snd_obstacle
Sound effect
snd_messages
Sound effect
snd_ricochet
Sound effect
snd_reindeer
Sound effect
snd_mistletoe
Sound effect
snd_reindeershot
Sound effect
snd_mistletoeshot
Sound effect
snd_christmasmusic
Music
snd_reload
Sound effect
snd_blastwave
Sound effect