Code edit (1 edits merged)
Please save this source code
User prompt
Add an effects array to the game class, and add a BloodsplatterEffect class, which lasts for 1s, growing larger and more transparent, and is also affected by the player velocity. When a monster is destroyed after taking a player life, create a BloodsplatterEffect
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
Add a hitbox to the monster. After updating a monster, check if its hitbox intersects the player's hitbox, causing the player to lose a life
User prompt
The changeScore function should additionally call the LK.setScore function after adjusting the score
User prompt
ensure the score cannot go below zero
User prompt
instead of losing a life when colliding with an obstacle, reduce the score by 1, but keep the invulnerability system
User prompt
instead of losing a life when colliding with an obstacle, reduce the score by 1
Code edit (8 edits merged)
Please save this source code
User prompt
pickups should also have a shadow
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
the monsters have shadow assets underneath them
Code edit (5 edits merged)
Please save this source code
User prompt
after traveling 10000 distance, spawn a new Monster class at the bottom of the screen that heads towards the player, but is also affected by the VelocityX and VelocityY in it's update function
User prompt
add a monsters array variable to the game class
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: removedElement is null' in this line: 'removedElement.destroy();' Line Number: 249
Code edit (8 edits merged)
Please save this source code
User prompt
the new trailelement should be scaled and rotated to match the velocity
User prompt
Add an update function that takes in a velocityX and velocityY to the Trail class. The update function creates a `blank` asset and adds it to a list, if the list has more than 60 elements the first element is removed. All elements have their x and y adjusted by the velocityX and velocityY
User prompt
Create a Trail class that takes a `parent`, `x`, and `y` parameters
User prompt
Create a Trail class that takes a `parent`, `x`, `y`, and `args` parameters.
===================================================================
--- original.js
+++ change.js
@@ -73,9 +73,9 @@
function activate() {
if (!self.active) {
self.active = true;
var densityChance = Math.pow(1 + density, 3) / 100;
- var obstructionTypes = ['largeTree', 'smallTree', 'deadTree', 'rock', 'stump'];
+ var obstructionTypes = ['largeTree', 'smallTree', 'smallTree', 'deadTree', 'smallRock', 'smallRock', 'largeRock', 'stump'];
var clearanceDist = 150;
var clearanceDistSqr = clearanceDist * clearanceDist;
var spawnBorder = 25;
var cellSize = 150;
@@ -188,9 +188,9 @@
self.invulnerable = false;
self.invulnerableTime = 3 * 60;
self.invulnerableTimer = 0;
var invulnerableReduction = 0.75;
- var platformGraphics = self.createAsset('platform', 'Platform image', 0.5, 0.5);
+ var platformGraphics = self.createAsset('platform', 'Platform image', 0.5, 0.6);
var playerGraphics = self.createAsset('player', 'Player character', 0.575, 1);
var hitbox = self.createAsset('hitbox', 'Player Hitbox', 0.5, 0.5);
hitbox.width = 25;
hitbox.height = 25;
@@ -213,9 +213,9 @@
var velocityX = Math.cos(angle) * speed * reduction;
var velocityY = Math.sin(angle) * speed * reduction;
var facingSide = targetPosition.x < self.x ? -1 : 1;
platformGraphics.rotation = angle + Math.PI / 2;
- playerGraphics.rotation = speed / 60 * (Math.PI / 2) * facingSide;
+ playerGraphics.rotation = speed * reduction / 100 * (Math.PI / 2) * facingSide;
playerGraphics.scale.x = facingSide;
return {
velocityX,
velocityY
@@ -230,9 +230,9 @@
parent.addChild(self);
self.x = x;
self.y = y;
var trailLength = 60;
- var trailAlpha = 0.6;
+ var trailAlpha = 0.4;
var trailElements = [];
self.update = update;
function update(velocityX, velocityY) {
var trailElement = null;
@@ -310,17 +310,18 @@
var stageHeight = 2732;
var tileSize = 512;
var playerPosX = stageWidth / 2;
var playerPosY = stageWidth / 4;
- var tileMargin = tileSize / 2 + 100;
+ var tileMargin = tileSize;
var background = self.createAsset('background', 'Fullscreen background', 0, 0);
var landscapeLookup = {};
var landscapeTiles = [];
var pickups = [];
+ var monsters = [];
var speed = 0;
background.width = stageWidth;
background.height = stageHeight;
- var interface = new Interface(self, 0, 20);
+ var interface = new Interface(self, 0, 10);
LK.gui.topCenter.addChild(interface);
var trail = new Trail(self, playerPosX, playerPosY);
var player = new Player(self, playerPosX, playerPosY);
landscapeTiles.push(landscapeLookup['0:0'] = new LandscapeTile(self, player.x, player.y, {
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.