User prompt
add a hitbox asset to the box class that, the player should check the hitbox instead of the box for intersections
User prompt
Add a floor image that is the full width of the game
User prompt
if the player collides with a box it's game over
User prompt
Fix Bug: 'TypeError: event.data is undefined' in this line: 'var currentTouchX = event.data.global.x;' Line Number: 27
User prompt
Fix Bug: 'TypeError: event.data is undefined' in this line: 'lastTouchX = event.data.global.x;' Line Number: 22
User prompt
instead of the player moving with the mouse, the player should move on swipe left or right
User prompt
divide the stage width equally into 16 columns, and align both the player and the boxes to the columns
User prompt
Fix Bug: 'TypeError: boxes[a] is undefined' in this line: 'boxes[a].move();' Line Number: 37
User prompt
Fix Bug: 'TypeError: player.update is not a function' in this line: 'player.update();' Line Number: 32
Initial prompt
Christmas Corporation
===================================================================
--- original.js
+++ change.js
@@ -6,8 +6,10 @@
});
var Box = Container.expand(function () {
var self = Container.call(this);
var boxGraphics = self.createAsset('box', 'Falling box', .5, .5);
+ var hitboxGraphics = self.createAsset('hitbox', 'Box hitbox', .5, .5);
+ self.hitbox = hitboxGraphics;
self.speed = 5;
self.move = function () {
self.y += self.speed;
};
@@ -68,9 +70,9 @@
boxes[a].move();
if (boxes[a].y > 2732) {
boxes[a].destroy();
boxes.splice(a, 1);
- } else if (player.intersects(boxes[a])) {
+ } else if (player.intersects(boxes[a].hitbox)) {
isGameOver = true;
}
}
if (tickOffset++ % 30 == 0) {
Pixel art, side view of a concrete factory floor . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art, square with cute eyes . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art, square with the texture of a tnt . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a crate, side view . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a crate, flat side view . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a crate, flat side view . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of a golden christmas present. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of a green christmas present with red ribbons. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of an elaborate green christmas present with red ribbons. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a metal background.
pixel art of a crate made of stone with a label of coal on the side, flat side view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a square tnt explosion. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.