Code edit (2 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
change deadbody meterbar to -300 y position
User prompt
change y position of deadbody meterbar to -100
User prompt
change y position of deadbody meterbar to -300
User prompt
Add a meterbar to the dead body
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scale')' in this line: 'self.meterBar.scale.x = Math.min(2, self.timeSpentNearDeadBody / timeNeededNearDeadBody);' Line Number: 130
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scale')' in this line: 'self.meterBar.scale.x = Math.min(2, self.timeSpentNearDeadBody / timeNeededNearDeadBody);' Line Number: 128
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in this line: 'if (!self.meterBar.parent && self.parent) {' Line Number: 122
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in this line: 'if (!self.meterBar.parent && self.parent) {' Line Number: 122
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in this line: 'if (!self.meterBar.parent && self.parent) {' Line Number: 122
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.parent.addChild(minionCreationVFX);' Line Number: 107
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.parent.addChild(minionCreationVFX);' Line Number: 107
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in this line: 'if (!self.meterBar.parent) {' Line Number: 120
User prompt
Call update on the deadbody every frame
User prompt
In the dead body class update, only increase timeSpentNearDeadBody when the player is near to it
User prompt
Move the player's meter bar to the dead body class
User prompt
Move the logic of creating a minion from the player class to the dead body class
User prompt
Move the logic for timeSpentNearDeadBody from the player class to the dead body class
Code edit (1 edits merged)
Please save this source code
User prompt
Change the enemy spawn time to every 5 seconds
User prompt
Enemies that are created on the left and right side of the screen cannot have a Y position of less than 1200
User prompt
Enemies cannot be created on the top edge of the scren
User prompt
Enemies can only be created from the edges of the screen
===================================================================
--- original.js
+++ change.js
@@ -105,10 +105,15 @@
minionCreationVFX.x = newMinion.x;
minionCreationVFX.y = newMinion.y;
self.parent.addChild(minionCreationVFX);
};
- self.update = function () {
- self.timeSpentNearDeadBody += 1 / 60;
+ self.update = function (player) {
+ var dx = player.x - self.x;
+ var dy = player.y - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance <= 150) {
+ self.timeSpentNearDeadBody += 1 / 60;
+ }
if (self.timeSpentNearDeadBody >= timeNeededNearDeadBody) {
self.createMinion();
self.timeSpentNearDeadBody = 0;
}
A pixel art sprite in a Super Nintendo, Super Castlevania style where it looks a little gothic/vampire hunter like Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A pixel art large background in a Super Nintendo, Super Castlevania style with an open world like cemetery, 3/4 viewpoint Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. A pixel art sprite in a Super Nintendo, Super Castlevania style that looks like a small pile of bones
Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. A pixel art sprite in a Super Nintendo, Super Castlevania style that looks like a skeleton zombie that is haunched over
Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Pixel art in a SNES style that looks like something from castlevania. A ground explosion effect like something is coming out of the ground
Pixel art in SNES Castlevania style. Red goblin Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Pixel art in SNES Castlevania style. Red goblin