User prompt
end the game if landscapeTile.checkCollision return true within the tick function
Code edit (22 edits merged)
Please save this source code
User prompt
in the checkCollision function, if the player is within reach of the landscapeTile, iterate through the obstructions and check if the player's hitbox intersects with the obstructions hitbox
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
After moving obstructions, check if their hitbox intersect the player hitbox and show a game over
User prompt
The player also has a 1x1 hitbox centered on the bottom
User prompt
all obstructions have a hitbox graphic, centered on the bottom of the graphic. These hitboxes have a width of the graphics and a height of half the width
User prompt
add black text to the top-right of the screen showing the current velocity as "Speed:"
Code edit (3 edits merged)
Please save this source code
User prompt
spawn a new obstacle below the bottom of the screen, with a random x position, every 100 distance traveled in the y direction
Code edit (1 edits merged)
Please save this source code
User prompt
velocity should scale based on the angle, with vertical being 100%, and horizonal being 0%
User prompt
destroy obstructions whose y position is < -100
User prompt
obstructions should be stored in an obstructions array. Instead of iterating through the children in the tick function, use the obstructions array
User prompt
instead of setting the player position to the position variable, increase the positions of all obstructions by the velocity
User prompt
every tick adjust the position variable by the speed in the direction of angle
User prompt
when spawning obstructions, they should uniformally randomize their scale between 0.9 and 1.1, and have their x scale randomly flipped
Code edit (11 edits merged)
Please save this source code
User prompt
on game start, randomly spawn 10 obstructions within the screen space
User prompt
Add several obstruction classes; LargeTree, SmallTree, Rock, Stump, DeadTree and a function that would randomly spawn one of these obstructions at a given location
Code edit (2 edits merged)
Please save this source code
User prompt
when setting the targetPosition, flip the playerGraphics if the targetPos.x < player.x
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: player is undefined' in this line: 'platform.y = player.y + playerGraphics.height / 2 + platformGraphics.height / 2;' Line Number: 47
===================================================================
--- original.js
+++ change.js
@@ -199,9 +199,11 @@
landscapeTiles.splice(i, 1);
landscapeLookup[landscapeTile.key] = undefined;
} else if (!landscapeTile.active && landscapeTile.x > -tileMargin && landscapeTile.x < stageWidth + tileMargin && landscapeTile.y < stageHeight + tileMargin) {
landscapeTile.activate();
- } else if (landscapeTile.checkCollision(player)) {}
+ } else if (landscapeTile.checkCollision(player)) {
+ LK.showGameOver();
+ }
speedText.setText('Speed: ' + speed);
}
});
function angleClamp(angle) {
Pixel art of a Santa. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a tree stump covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a dead tree covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a christmas tree covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a spruce tree covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a rock covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a christmas present counter. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a christmas present. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a blue christmas present. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art heart icon . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
two vertical lines with a blank background.
pixel art of a large, snow covered rock . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of skiis . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a floating grinch monster . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
single green firework explosion . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a wooden board covered in snow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a wooden pole with snow at it's base. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tileable white water texture pixel art.