User prompt
blocks which are caught are placed beneath the hero
User prompt
blocks are placed right beneath the hero
User prompt
Pieces should stick on top of the character
User prompt
Make pieces stick to character upon collision
User prompt
Pieces should pile up on top of hero character
User prompt
Pieces should stack on top of the hero character on collision
User prompt
pieces should fall automatically
User prompt
make the interval 1second
User prompt
Make the pieces spawn in a random location at a 0.5s interval
User prompt
Make it so that the mouse movement moves the hero character
User prompt
Fix Bug: 'ReferenceError: hero is not defined' in this line: 'if (self.y >= hero.y) {' Line Number: 10
User prompt
make the pieces fall on top of the hero character
User prompt
Create a physics based game where the hero character has to catch falling blocks and balance them so they don't fall
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'move')' in this line: 'enemies[b].move();' Line Number: 47
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'move')' in this line: 'pizzas[a].move();' Line Number: 40
Initial prompt
Stacker
===================================================================
--- original.js
+++ change.js
@@ -11,9 +11,9 @@
self.falling = true;
hero.balance(self);
}
} else {
- self.y = hero.y - self.height;
+ self.y = hero.y + hero.height;
self.x = hero.x;
}
};
});
@@ -32,9 +32,9 @@
self.x += dx * self.speed;
self.y += dy * self.speed;
};
self.balance = function (block) {
- block.y = self.y - block.height;
+ block.y = self.y + self.height;
block.x = self.x;
block.speed = 0;
self.addChild(block);
block.falling = false;
@@ -55,10 +55,10 @@
hero.y = 2732 / 2;
var blocks = [];
var spawnBlocks = function () {
var block = new Block();
- block.x = hero.x;
- block.y = hero.y + hero.height;
+ block.x = Math.random() * 2048;
+ block.y = 0;
self.addChild(block);
blocks.push(block);
};
LK.setInterval(spawnBlocks, 1000);