Code edit (12 edits merged)
Please save this source code
User prompt
pease write a function that can be called to determine if two objects are colliding more than the value of a parameter passed to the function.
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: groundLevel is not defined' in or related to this line: 't.y = groundLevel + 20;' Line Number: 739
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'barricade.x = 2048 + spikeTrap.width;' Line Number: 454
Code edit (1 edits merged)
Please save this source code
User prompt
give all text a black outline
User prompt
the +10 signs should fly off to the left side of the screen and be destroyed after a few seconds
User prompt
show a +10 sign and play a sound effect when player picks up a collectible
User prompt
Increase score by 10 when player picks up a collectible
User prompt
add a scorelabel top center of the scree
Code edit (12 edits merged)
Please save this source code
User prompt
make a class for the dustparticle and use its update method instead of running the spread and alpha in an interval
User prompt
the dust particles should spread and go transparent before they disappear
User prompt
use a separate dustparticle asset for the dustparticles
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'destroy')' in or related to this line: 'particle.destroy();' Line Number: 169
===================================================================
--- original.js
+++ change.js
@@ -191,9 +191,11 @@
game.addChild(dustParticle);
}
}
} else if (self.dashing) {
- self.actionTimer++;
+ if (!gamePaused) {
+ self.actionTimer++;
+ }
for (var i = 0; i < 2; i++) {
var dustParticle = new DustParticle();
dustParticle.x = self.x - self.width / 4 + (Math.random() * 300 - 150);
dustParticle.y = self.y + self.playerWalkGraphics.height / 2 + 30 + (Math.random() * 20 - 10);
@@ -211,9 +213,11 @@
self.actionTimer = 0;
gameSpeedBoost = 0;
}
} else if (self.ducking) {
- self.actionTimer++;
+ if (!gamePaused) {
+ self.actionTimer++;
+ }
for (var i = 0; i < 2; i++) {
var dustParticle = new DustParticle();
dustParticle.x = self.x - self.width / 4 + (Math.random() * 300 - 150);
dustParticle.y = self.y + self.playerWalkGraphics.height / 2 + 30 + (Math.random() * 20 - 10);
@@ -247,8 +251,14 @@
dustParticle.spreadX = Math.random() * -5;
game.addChild(dustParticle);
}
}
+ if (LK.ticks % 20 == 0) {
+ //LK.getSound('footStep').play();
+ if (!LK.getSound('footStepCycle').playing()) {
+ LK.getSound('footStepCycle').play();
+ }
+ }
}
}
};
self.jump = function () {
@@ -361,9 +371,19 @@
});
self.scoreVal = 3000;
self.speed = 0;
self.update = function () {
- // Collectible update logic if needed
+ self.x -= gameSpeed + gameSpeedBoost;
+ if (self.intersects(player)) {
+ self.destroy();
+ LK.setScore(LK.getScore() + self.scoreVal);
+ scoreLabel.setText('' + LK.getScore());
+ // Show +10 sign
+ var scoreSign = new ScoreSign(self.scoreVal);
+ scoreSign.x = player.x;
+ scoreSign.y = player.y - 100;
+ game.addChild(scoreSign);
+ }
};
});
/****
@@ -396,8 +416,9 @@
var defaultBoostAmount = 10;
var touchStartX = 0;
var touchStartY = 0;
var groundY = 2200; //1810; //2732 - 510;
+var unpausedClicks = 1;
var ARROWS_SEEN = false;
var PALLISADES_SEEN = false;
var SPIKETRAP_SEEN = false;
var instructionsLabel = new Text2('', {
@@ -549,8 +570,9 @@
if (gameOver == true) {
player.update();
}
if (gameStarted && !gameOver) {
+ unpausedClicks++;
// Update player
player.update();
// Update score label text
scoreLabel.setText('' + LK.getScore());
@@ -647,9 +669,9 @@
obstacles.splice(i, 1);
}
}
// Spawn new obstacles
- if (LK.ticks % 300 == 0) {
+ if (unpausedClicks % 300 == 0) {
// 5 seconds at 60 FPS
var ran = Math.random();
if (ran < 0.33 || !SPIKETRAP_SEEN) {
var spikeTrap = new SpikeTrap();
@@ -686,22 +708,22 @@
}
}
}
// Spawn new collectible every 30 ticks
- if (LK.ticks % 40 == 0) {
+ if (unpausedClicks % 40 == 0) {
var collectible = new Collectible();
collectible.x = 2048 + collectible.width;
//collectible.y = 300 + Math.random() * (2032 - collectible.height);
collectible.y = 2250 - collectible.rand * 300; // + Math.random() * (2032 - collectible.height);
game.addChild(collectible);
}
- if (LK.ticks % 600 == 0) {
+ if (unpausedClicks % 600 == 0) {
gameSpeed += 2;
}
- if (LK.ticks % 120 == 0) {
+ if (unpausedClicks % 1650 == 0) {
var t = new TreasureChest();
t.x = 2048 + t.width;
- t.y = groundY + 20;
+ t.y = groundY + 60;
game.addChild(t);
}
} // endif gameStarted
};
\ No newline at end of file
A background illstration for a game, rich in style, medieval fantasy themed, of a landscape seen from a great distance, like froma mountain ridge with mountains and forests and lakes and lots of features.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A spritesheet with various poses for a heavily armored little dwarven warrior with an axe in various poses for use in an endless runner game. Te poses should include walking, eating, jumping, ducking low, and chargingforward. Sprites should be laid out in a rectangular grid wih blank space between them. Style should be medieval fantasy.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A game logo for a game called 'Endless Viking Run' using norse font on a background of a viking shield and crossed axes. Muted colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.