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
User prompt
the dustparticle effect should be a small aprticle explosion looking like dust that rises from the ground on jump takeoff and landing
User prompt
make a dustparticle effect when player jumps and lands
Code edit (1 edits merged)
Please save this source code
User prompt
every five seconds, spawn a spiketrap off the right side of the screen, at groundY and bring it onto the screen at gamespeed + boostspeed
===================================================================
--- original.js
+++ change.js
@@ -2,10 +2,8 @@
* Classes
****/
/***
TODO:
- - Add game logo in right corner for game/brand awareness building.
- - Add dust from walking.
- Music
- Sound effects
- Title, description, hashtags, icon and banner image. Måske Endless Dwarven Run i stedet for Viking.
*/
@@ -85,8 +83,26 @@
self.destroy();
}
};
});
+var GameLogo = Container.expand(function () {
+ var self = Container.call(this);
+ var b = self.attachAsset('gameLogo', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 1.1,
+ scaleY: 1.1,
+ tint: '#000000',
+ alpha: 0.5
+ });
+ var t = self.attachAsset('gameLogo', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.x = 2048 / 2;
+ self.y = 2732 / 2;
+ self.update = function () {};
+});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('spikeTrap', {
anchorX: 0.5,
@@ -219,8 +235,19 @@
if (!self.jumping && !self.dashing && !self.ducking) {
// Bobbing and bumping animation
self.y += Math.sin(LK.ticks / 3) * 2;
self.rotation = Math.sin(LK.ticks / 20) * 0.1;
+ if (LK.ticks % 10 == 0) {
+ 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);
+ dustParticle.alpha = 0.8;
+ dustParticle.spreadY = Math.random() * -3;
+ dustParticle.spreadX = Math.random() * -5;
+ game.addChild(dustParticle);
+ }
+ }
}
}
};
self.jump = function () {
@@ -350,8 +377,9 @@
var gamePaused = false;
var obstacles = [];
var colectibles = [];
var gameSpeed = 20;
+var baseGameSpeed = gameSpeed;
var gameSpeedBoost = 0;
var defaultBoostAmount = 10;
var touchStartX = 0;
var touchStartY = 0;
@@ -419,8 +447,16 @@
//player.y = 2732 - 510;
player.y = groundY; //2732 - 510;
player.scale.x = player.scale.y = 1.2;
game.addChild(player);
+var cover = game.attachAsset('cover', {});
+cover.alpha = 0.4;
+cover.x = 0; //2048 / 2;
+cover.y = 0; //2732 / 2;
+var logo = new GameLogo();
+logo.x = 2048 / 2;
+logo.y = 2732 / 2;
+game.addChild(logo);
function gameOverAnimation() {
if (!gameOver) {
gameOver = true;
}
@@ -448,15 +484,21 @@
} else if (type == 3) {
label.setText('SWIPE DOWN\nTO DUCK THE ARROWS');
}
game.addChild(label);
+ //}, 1000 * (gameSpeed / baseGameSpeed));
}, 1000);
}
;
// Handle touch events for player movement
game.down = function (x, y, obj) {
if (!gameStarted) {
gameStarted = true;
+ cover.destroy();
+ logo.x = 1800;
+ logo.y = 250;
+ logo.width = 400;
+ logo.height = 400;
}
//player.velocityY = 50;
touchStartX = x;
touchStartY = y;
@@ -595,9 +637,9 @@
// Spawn new obstacles
if (LK.ticks % 300 == 0) {
// 5 seconds at 60 FPS
var ran = Math.random();
- if (ran < 0.33) {
+ if (ran < 0.33 || !SPIKETRAP_SEEN) {
var spikeTrap = new SpikeTrap();
spikeTrap.x = 2048 + spikeTrap.width;
spikeTrap.y = groundY;
game.addChild(spikeTrap);
@@ -606,9 +648,9 @@
// plan delay to show swipe movement
pauseAndShowInstructions(1);
SPIKETRAP_SEEN = true;
}
- } else if (ran < 0.66) {
+ } else if (ran < 0.66 || !PALLISADES_SEEN) {
var barricade = new TallBarricade();
barricade.x = 2048 + barricade.width;
barricade.y = groundY - barricade.height / 2 + 450;
game.addChild(barricade);
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.