Code edit (8 edits merged)
Please save this source code
User prompt
There's a problem for decorations, they sometimes appear with a big size, not respecting the height dependency on progress. can you find why ?
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
add a global nbDecorations
Code edit (5 edits merged)
Please save this source code
User prompt
in Decoration update, also log y
Code edit (4 edits merged)
Please save this source code
User prompt
in decoration class reset(), log assetIndex and size
User prompt
pass i index to Decoration constructor and store it in an index property
User prompt
add a global array for decorations
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: mainGraphics is undefined' in or related to this line: 'mainGraphics.width = startSize;' Line Number: 200
User prompt
Please fix the bug: 'TypeError: mainGraphics is undefined' in or related to this line: 'mainGraphics.width = startSize;' Line Number: 200
User prompt
Please fix the bug: 'TypeError: mainGraphics is undefined' in or related to this line: 'mainGraphics.width = startSize;' Line Number: 200
User prompt
Please fix the bug: 'ReferenceError: mainGraphics is not defined' in or related to this line: 'mainGraphics.width = startSize;' Line Number: 199
User prompt
Please fix the bug: 'ReferenceError: rand is not defined' in or related to this line: 'var leftStartX = baseLeftStartX - rand * xOffset / 2;' Line Number: 180
User prompt
ok apply this
User prompt
Please fix the bug: 'ReferenceError: mainGraphics is not defined' in or related to this line: 'mainGraphics.texture = LK.getAsset(randomAsset, {}).texture;' Line Number: 170
User prompt
I think calling self.attachAsset at each reset may not be performant, there should be a better way
Code edit (1 edits merged)
Please save this source code
User prompt
add a drop shadow to score text
Code edit (9 edits merged)
Please save this source code
User prompt
stop stipes update when isKilled
User prompt
when level == 1; make lampPost not visible
===================================================================
--- original.js
+++ change.js
@@ -141,16 +141,16 @@
});
var speed = 5;
var startY = roadTop + 50;
var endY = startY + roadHeight;
- var xOffset = 2048;
+ var xOffset = 1024;
var baseLeftStartX = 780;
var rand = Math.random();
var leftStartX = baseLeftStartX - rand * xOffset / 2;
- var leftEndX = leftStartX - xOffset * (1 + rand);
+ var leftEndX = leftStartX - xOffset * (1.5 + rand);
var baseRightStartX = 1280;
var rightStartX = baseRightStartX + rand * xOffset / 2;
- var rightEndX = rightStartX + xOffset * (1 + rand);
+ var rightEndX = rightStartX + xOffset * (1.5 + rand);
self.assetWidthRatios = [100 / 300, 1];
self.endSizes = [600, 400];
var startSize = 1;
self.assetIndex = Math.floor(Math.random() * self.assets.length);
@@ -183,9 +183,9 @@
//mainGraphics = self.assets[self.assetIndex];
mainGraphics.height = startSize + (self.endSizes[self.assetIndex] - startSize) * self.progress;
mainGraphics.width = mainGraphics.height * self.assetWidthRatios[self.assetIndex];
if (self.index == 0) {
- console.log("Decoration " + self.index + " update - assetIndex:", self.assetIndex, "width:", mainGraphics.width, "y:", self.y);
+ console.log("Decoration " + self.index + " update - assetIndex:", self.assetIndex, "width:", mainGraphics.width, "x:", Math.round(self.x), "y:", Math.round(self.y));
}
};
self.reset = function () {
self.y = startY;
@@ -201,11 +201,11 @@
if (self.index == 0) {
console.log("=== Decoration " + self.index + " reset - assetIndex:", self.assetIndex, "width:", mainGraphics.width, "y:", self.y, " ===");
}
leftStartX = baseLeftStartX - rand * xOffset / 2;
- leftEndX = leftStartX - xOffset * (1 + rand);
+ leftEndX = leftStartX - xOffset * (1.5 + rand);
rightStartX = baseRightStartX + rand * xOffset / 2;
- rightEndX = rightStartX + xOffset * (1 + rand);
+ rightEndX = rightStartX + xOffset * (1.5 + rand);
self.pathIndex = Math.floor(rand * 2);
if (self.pathIndex === 0) {
self.x = leftStartX;
} else {
@@ -866,9 +866,9 @@
}
return n;
}
var stripes = [];
-var nbDecorations = 1;
+var nbDecorations = 2;
var decorations = [];
// Initialize arrays and variables
var currentLevel = 1;
var isPlaying = false;
Directly overhead, plumb view of a beggar heading top (we see his back).. Zenith view, directly overhead, plumb view. NOT PERSPECTIVE! Fantasy theme. Pixel art
a traffic cone. video game sprite
face view of a big start button in the shape of a dollar bill. video game style
a tree. video game style
a black garbage bag. video game style
Dollar bill. Perspective. video game sprite
perspective of a simple snake rolled up on itself.. video game sprite
Ball of dry desert bushes. video game sprite
tractor. high definition video game sprite
street ad billboard with 1 or 2 posts with "Get rich!" on it. high definition video game sprite
a dog sleeping on a street. video game sprite
desert bush. video game sprite
profile view of an empty motorcycle helmet. black with a white vertical central band and another thiner orange band on the center. NOT PERSPECTIVE!. Pixel art high definition
simple red and white magnet. video game style
gold sign with a "X" and a "2". video game style
bgMusic
Music
coin_1
Sound effect
hit_1
Sound effect
hit_2
Sound effect
hit_3
Sound effect
levelWin_1
Sound effect
car_1
Sound effect
police_1
Sound effect
ambulance_1
Sound effect
accident_1
Sound effect
killed_1
Sound effect
jump_1
Sound effect
rip_1
Sound effect
bonus_take
Sound effect
bonus_approaching
Sound effect