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
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
===================================================================
--- original.js
+++ change.js
@@ -1,24 +1,29 @@
-var DropEffect = Container.expand(function (parent, x, y, velocityX, velocityY) {
+var DropEffect = Container.expand(function (parent, x, y) {
var self = Container.call(this);
parent.addChild(self);
self.x = x;
self.y = y;
+ 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;
var spinSpeed = Math.random() * 0.2 - 0.1;
var scale = 1;
+ var scaleDecrement = 1 / 60;
var variant = Math.floor(Math.random() * 3);
- var graphics = self.createAsset('pickup' + variant, 'DropEffect graphics', 0.5, 0.95);
- self.update = function () {
+ var graphics = self.createAsset('pickup' + variant, 'Drop graphics', 0.5, 0.95);
+ graphics.rotation = Math.random() * Math.PI * 2;
+ self.update = update;
+ function update(velocityX, velocityY) {
self.x += velocityX;
self.y += velocityY;
+ scale -= 0.05;
graphics.rotation += spinSpeed;
- scale *= 0.95;
- graphics.scale.set(scale, scale);
- if (scale < 0.1) {
- return true;
- }
- return false;
- };
+ graphics.scale.set(scale);
+ return scale <= 0;
+ }
+ ;
});
var BloodsplatterEffect = Container.expand(function (parent, x, y) {
var self = Container.call(this);
parent.addChild(self);
@@ -313,13 +318,8 @@
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);
@@ -515,8 +515,9 @@
} else if (!landscapeTile.active && landscapeTile.x > -tileMargin && landscapeTile.x < stageWidth + tileMargin && landscapeTile.y < stageHeight + tileMargin) {
landscapeTile.activate();
} else if (landscapeTile.checkCollision(player)) {
interface.changeScore(-1);
+ effects.push(new DropEffect(self, player.x, player.y));
if (!player.invulnerable) {
player.invulnerable = true;
player.invulnerableTimer = player.invulnerableTime;
}
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.