Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
make this line work: ballGraphics.texture = LK.getAsset('newDeathSpriteId', {}).texture;
User prompt
Fix Bug: 'TypeError: ballGraphics.setTextureFromAsset is not a function' in or related to this line: '_iterator.f();' Line Number: 429
User prompt
Fix Bug: 'TypeError: ballGraphics.setTexture is not a function' in or related to this line: '_iterator.f();' Line Number: 429
User prompt
in the deathanim function, ball sprite should change to another one.
Code edit (10 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: '_iterator.f();' Line Number: 466
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: '_iterator.f();' Line Number: 466
Code edit (1 edits merged)
Please save this source code
User prompt
Every time the player gets points, they should be multiplied by the variable (multiplier-1).
User prompt
Every time the player gets points, they should be multiplied by the variable (multiplier-1).
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'toString')' in or related to this line: 'mulText.setText('x' + newVal.toString());' Line Number: 176
User prompt
Fix Bug: 'ReferenceError: valText is not defined' in or related to this line: 'valText.anchor.set(0.5, 0.5);' Line Number: 173
Code edit (3 edits merged)
Please save this source code
User prompt
scorelabels should fly off in a random upwards direction instead of just up.
Code edit (1 edits merged)
Please save this source code
User prompt
add all created scorelabels to the scoreLabels array on creation.
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'self.scoreLabel.update();' Line Number: 323
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'self.scoreLabel.update();' Line Number: 323
Code edit (1 edits merged)
Please save this source code
User prompt
call the scorelabel's update method in the on tick loop, or in ball update
===================================================================
--- original.js
+++ change.js
@@ -3,22 +3,24 @@
****/
var ScoreLabel = Container.expand(function (scoreValue, posX, posY) {
var self = Container.call(this);
var scoreText = new Text2(scoreValue.toString(), {
- size: 75,
+ size: 150,
fill: "#ffffff"
});
scoreText.anchor.set(0.5, 0.5);
self.addChild(scoreText);
self.x = posX;
self.y = posY;
+ var angle = Math.random() * Math.PI; // Random angle in radians
+ self.dx = Math.cos(angle) * 4; // Horizontal drift
+ self.dy = Math.sin(angle) * 8; // Vertical drift
// Animation for the score label to drift upwards and fade out
var driftFrames = 60;
self.update = function () {
if (driftFrames > 0) {
- var angle = Math.random() * Math.PI; // Random angle in radians
- self.x += Math.cos(angle) * 4; // Horizontal drift
- self.y -= Math.sin(angle) * 8; // Vertical drift
+ self.x += self.dx;
+ self.y -= self.dy;
scoreText.alpha -= 0.005;
driftFrames--;
} else {
self.destroy();
@@ -37,21 +39,20 @@
or jump height/logic.
The platforms array grows in length over time. Try to remove deleted elements from it, but make backup first,
because this is where the AI started optimizing to make the game page freeze last time.
Maybe remove the immunity from normal powerups, it's confusing.
-Show points when player hits platform or gets powerup.
---------------------
Interface/graphics:
Show instructions on screen at start.
Maybe tint platforms based on their overall depth.
-Consider a background graphic or color.
Consider smileyfaces on the platforms - angry ones on the red ones.
When player dies, maybe make them fall out of screen, facing player, screaming, waving hands, like in the old
Rick Dangerous games for Amiga.
--------------
Powerup ideas:
-A powerup that removes all nearby platforms and give score for them
-Maybe make a disco powerup that changes light, colors or visuals somehow
+A powerup that permanently increments the score for hitting a standard platform by 1.
+A powerup that removes all nearby platforms and give score for them.
+Maybe make a disco powerup that changes light, colors or visuals somehow.
Consider a score multiplier powerup - either where player's score is instantly doubled,
or where score for each following platform hit is doubled.
Consider platforms that increase or decrease the size/weight of the character.
Like a powerup platform that turns the player into a squirrel, no bouncing, just running and falling off platforms,
@@ -148,8 +149,36 @@
self.velocityBoost = 50;
self.immunityBoost = 10;
self.scoreBoost = 10;
});
+var PowerupMultiply = Container.expand(function () {
+ var self = Container.call(this);
+ var powerupMultiplyGraphics = self.attachAsset('powerupMultiply', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.col = 0;
+ self.row = 0;
+ self.toxic = false;
+ self.powerup = true;
+ self.powerupType = "Multiply";
+ self.collidable = true;
+ self.velocityBoost = 50;
+ self.immunityBoost = 0;
+ self.scoreBoost = 10;
+ var mulText = new Text2('x2', {
+ size: 50,
+ fill: "#ffffff",
+ outline: true
+ });
+ mulText.anchor.set(0.5, 0.5);
+ self.addChild(mulText);
+ self.updateLabel = function (newVal) {
+ mulText.setText('x' + newVal.toString());
+ //self.scoreBoost = newVal;
+ };
+ self.updateLabel(game.multiplier);
+});
var PowerupFollow = Container.expand(function () {
var self = Container.call(this);
var powerupFollowGraphics = self.attachAsset('powerupFollow', {
anchorX: 0.5,
@@ -391,8 +420,11 @@
var scoreLabel = new ScoreLabel(platform.scoreBoost, self.x, self.y);
scoreLabel.updateScore(platform.scoreBoost);
scoreLabels.push(scoreLabel);
game.addChild(scoreLabel);
+ if (platform.powerupType == "Multiply") {
+ multiplier++;
+ }
if (platform.powerupType != "Follow") {
platform.destroy();
} else {
self.followers += 1;
@@ -542,8 +574,9 @@
var moveLeftFrames = 0;
var moveRightFrames = 0;
var rowAmount = 13;
var maxDepth = 0;
+var multiplier = 1;
// Create player score label
var playerScoreLabel = new PlayerScoreLabel();
LK.gui.top.addChild(playerScoreLabel);
var maxDepthLabel = new DepthLabel();
@@ -678,8 +711,14 @@
t.updateLabel(t.scoreVal);
platforms.push(t);
game.addChild(t);
} else if (Math.random() < 0.1) {
+ var t = new PowerupMultiply();
+ t.x = platform.x;
+ t.y = platform.y - t.height;
+ platforms.push(t);
+ game.addChild(t);
+ } else if (Math.random() < 0.1) {
if (maxDepth < 30) {
var t = new PowerupFollow();
} else if (maxDepth < 100) {
if (Math.random() < 0.5) {
A happy blue elephant.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
erase.
Make the bird sit inside a birdcage.
Three green arrows pointing down.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A sad little bluebird sitting down.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A happy little bluebird flying.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A happy little green bird flying.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A lush jungle scenery with huge old trees covered in vines and overwrowth, blue sky and forested mountains in the background.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A dark wooden message board with vines and jungle moss growing on top.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A happy little blue elephant, looking scared, facing the viewer, legs flailing as it falls through the air.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A delicious peanut.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
delete