User prompt
Fix Bug: 'TypeError: parent.addChild is not a function' in this line: 'parent.addChild(self);' Line Number: 342
Code edit (4 edits merged)
Please save this source code
User prompt
create a rampList variable, and iterate through each ramp, calling it's update function
Code edit (7 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: graphics is not defined' in this line: 'rampPillar.y = graphics.height;' Line Number: 320
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: playerGraphics is undefined' in this line: 'playerShadow.y = playerGraphics.height * 0.5;' Line Number: 366
User prompt
the player has a `shadow` asset underneath it
User prompt
ramps have a `rampShadow` asset underneath them
User prompt
ramps have a `rampPillar` asset underneath them
User prompt
if a landscape tile fails to create a pickup (in it's activate method), try create a ramp with a 5% chance
User prompt
add a ramp class with an update method that checks for a collision with the player
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Create a particle effect class called DropEffect using the same graphics assets as the pickups (excluding shadows). When colliding with an obstruction, create a DropEffect particle which shoots away in a random direction from the player, spinning and shrinking.
Code edit (12 edits merged)
Please save this source code
User prompt
monsters start with a random x flip
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: jumpSpeed is not defined' in this line: 'jumpVelocityX = Math.cos(angle) * jumpSpeed;' Line Number: 65
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -1,4 +1,25 @@
+var DropEffect = Container.expand(function (parent, x, y, velocityX, velocityY) {
+ var self = Container.call(this);
+ parent.addChild(self);
+ self.x = x;
+ self.y = y;
+ var spinSpeed = Math.random() * 0.2 - 0.1;
+ var scale = 1;
+ var variant = Math.floor(Math.random() * 3);
+ var graphics = self.createAsset('pickup' + variant, 'DropEffect graphics', 0.5, 0.95);
+ self.update = function () {
+ self.x += velocityX;
+ self.y += velocityY;
+ graphics.rotation += spinSpeed;
+ scale *= 0.95;
+ graphics.scale.set(scale, scale);
+ if (scale < 0.1) {
+ return true;
+ }
+ return false;
+ };
+});
var BloodsplatterEffect = Container.expand(function (parent, x, y) {
var self = Container.call(this);
parent.addChild(self);
self.x = x;
@@ -292,8 +313,13 @@
self.deactivate = deactivate;
function deactivate() {
self.active = false;
graphics.alpha = 0.5;
+ var angle = Math.random() * Math.PI * 2;
+ var speed = 5 + Math.random() * 5;
+ var velocityX = Math.cos(angle) * speed;
+ var velocityY = Math.sin(angle) * speed;
+ effects.push(new DropEffect(parent, self.x, self.y, velocityX, velocityY));
}
});
var Player = Container.expand(function (parent, x, y) {
var self = Container.call(this);
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.