User prompt
Add an attack key. Sometimes the game stops and let's attack. But Sans should dodge the attacks, so that he can die after escaping 10 times. Asgore, on the other hand, can block attacks 12 times. After that, it may disappear. Flowey, on the other hand, destroys attacks until he dies by chance and asgo. After Sans and Asgore die, he changes to his strongest form and starts to send 10 İvy, which he destroys attacks 5 times, but dies after that. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Increase the number of gaster blasters to 10
User prompt
Increase the number of spears to 2. Let the number of Ivy be 5 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let it be a gaster blaster. (Sans's) And a white beam will come through it. (there will be a black line around it) damage:12 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Don't let the characters be themselves. Add assets to them
User prompt
There must be people who send them to us. Let there be 3 people 1.Sans 2.asgore 3.flowey Sans side (Bone thrower) asgore in the middle (The owner of the Hoe) Flowey on the other side (Ivy sender) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let the Ivys go from top to bottom of the box ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let the ivy go from the top of the box to the bottom ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
LET THE ANCHOR MOVE LEFT AND RIGHT. LET THE IVY MOVE UP AND DOWN ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let the left move up and down, not the right
User prompt
Do Ivy Let it be like an anchor, but it should bend down from the top of the box (Let it be 800 Height) And let there be 2-3 of them ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let the Ivy come sometimes (Let the Ivy deal 5 damage and slow it down for %25) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Our health is running low on its own. Remove self-reduction
User prompt
Delete yellow thing
User prompt
Delete the heart from moving itself
User prompt
Reduce irradiation of bones by 75%
User prompt
Make our health 92. Let the bones deal 4 damage. Anchor 6 Damage
User prompt
WhReduce the rate of bones coming out a lot, and reduce the bidet speed excessively
User prompt
Bones slow down bones very fast. Get us up to speed. And when we stop touching, let's slow down a little and stop ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When the anchor is orange, we can move, but if we don't move, our health decreases. Blue is the opposite, ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
WHY THE ANCHOR SHOULD BE OUTSIDE THE BOX, IT SHOULD NOT BE OUTSIDE AT ALL ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
The anchor is only the longer the box, that is, the anchor does not go out of the box ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the anchor Height 1200 pixels ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Anchor Let it not be long, but thick. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let the anchor be as long as the box. Don't let it be thick ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Anchor = Container.expand(function () {
var self = Container.call(this);
// Create anchor graphic
var anchorGraphics = self.attachAsset('anchor', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1,
scaleY: 10
});
self.isBlue = true; // true = blue (stop), false = orange (move)
self.damage = 6;
self.lastX = 0;
self.lastY = 0;
self.colorChangeTimer = 0;
self.colorChangeInterval = 180; // Change color every 3 seconds at 60fps
self.speed = 3;
self.movingRight = true;
// Update anchor color
self.updateColor = function () {
if (self.isBlue) {
anchorGraphics.tint = 0x0066ff; // Blue
} else {
anchorGraphics.tint = 0xff6600; // Orange
}
};
self.update = function () {
self.lastX = self.x;
self.lastY = self.y;
// Move horizontally within the box boundaries
var anchorHalfWidth = 60; // Half of 120px anchor width
var minX = boxX + 8 + anchorHalfWidth;
var maxX = boxX + boxWidth - 8 - anchorHalfWidth;
if (self.movingRight) {
self.x += self.speed; // Move right
if (self.x >= maxX) {
self.x = maxX;
self.movingRight = false; // Switch to moving left
}
} else {
self.x -= self.speed; // Move left
if (self.x <= minX) {
self.x = minX;
self.movingRight = true; // Switch to moving right
}
}
// Keep anchor within vertical bounds of the box
var anchorHalfHeight = 600; // Half of 1200px anchor height
var minY = boxY + 8 + anchorHalfHeight;
var maxY = boxY + boxHeight - 8 - anchorHalfHeight;
if (self.y < minY) {
self.y = minY;
}
if (self.y > maxY) {
self.y = maxY;
}
// Change color periodically
self.colorChangeTimer++;
if (self.colorChangeTimer >= self.colorChangeInterval) {
self.isBlue = !self.isBlue;
self.updateColor();
self.colorChangeTimer = 0;
}
};
// Initialize with blue color
self.updateColor();
return self;
});
var Bone = Container.expand(function () {
var self = Container.call(this);
// Create bone graphic
var boneGraphics = self.attachAsset('bone', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 1;
self.currentSpeed = 1;
self.maxSpeed = 4;
self.minSpeed = 0.5;
self.isAccelerating = false;
self.isAttacking = false;
self.lastX = 0;
self.lastY = 0;
self.attackPattern = 0; // 0=direct, 1=zigzag, 2=circle
self.accelerate = function () {
if (self.isAccelerating) return;
self.isAccelerating = true;
// Stop any existing speed tween
tween.stop(self, {
currentSpeed: true
});
// Quickly accelerate to max speed
tween(self, {
currentSpeed: self.maxSpeed
}, {
duration: 200,
easing: tween.easeOut
});
};
self.decelerate = function () {
if (!self.isAccelerating) return;
self.isAccelerating = false;
// Stop any existing speed tween
tween.stop(self, {
currentSpeed: true
});
// Gradually slow down to normal speed
tween(self, {
currentSpeed: self.speed
}, {
duration: 800,
easing: tween.easeOut
});
};
self.startAttack = function (targetX, targetY) {
if (self.isAttacking) return;
self.isAttacking = true;
self.attackPattern = Math.floor(Math.random() * 3);
var duration = Math.random() * 800 + 1200; // 1.2-2.0 seconds
if (self.attackPattern === 0) {
// Direct attack with speed-adjusted duration
var speedMultiplier = self.currentSpeed / self.speed;
var adjustedDuration = duration / speedMultiplier;
tween(self, {
x: targetX,
y: targetY
}, {
duration: adjustedDuration,
easing: tween.easeInOut,
onFinish: function onFinish() {
self.isAttacking = false;
self.isAccelerating = false;
}
});
} else if (self.attackPattern === 1) {
// Zigzag pattern - attack in multiple stages with speed adjustment
var speedMultiplier = self.currentSpeed / self.speed;
var adjustedDuration = duration / speedMultiplier;
var midX = (self.x + targetX) / 2 + (Math.random() - 0.5) * 300;
var midY = (self.y + targetY) / 2 + (Math.random() - 0.5) * 300;
tween(self, {
x: midX,
y: midY
}, {
duration: adjustedDuration / 2,
easing: tween.easeIn,
onFinish: function onFinish() {
var currentSpeedMultiplier = self.currentSpeed / self.speed;
var currentAdjustedDuration = duration / currentSpeedMultiplier;
tween(self, {
x: targetX,
y: targetY
}, {
duration: currentAdjustedDuration / 2,
easing: tween.easeOut,
onFinish: function onFinish() {
self.isAttacking = false;
self.isAccelerating = false;
}
});
}
});
} else {
// Circular approach with speed adjustment
var speedMultiplier = self.currentSpeed / self.speed;
var adjustedDuration = duration / speedMultiplier;
var centerX = (self.x + targetX) / 2;
var centerY = (self.y + targetY) / 2;
var radius = Math.sqrt(Math.pow(targetX - self.x, 2) + Math.pow(targetY - self.y, 2)) / 3;
var angle = Math.atan2(self.y - centerY, self.x - centerX);
var circleX = centerX + Math.cos(angle + Math.PI) * radius;
var circleY = centerY + Math.sin(angle + Math.PI) * radius;
tween(self, {
x: circleX,
y: circleY
}, {
duration: adjustedDuration / 2,
easing: tween.easeInOut,
onFinish: function onFinish() {
var currentSpeedMultiplier = self.currentSpeed / self.speed;
var currentAdjustedDuration = duration / currentSpeedMultiplier;
tween(self, {
x: targetX,
y: targetY
}, {
duration: currentAdjustedDuration / 2,
easing: tween.easeIn,
onFinish: function onFinish() {
self.isAttacking = false;
self.isAccelerating = false;
}
});
}
});
}
};
self.update = function () {
self.lastX = self.x;
self.lastY = self.y;
// Apply speed changes to movement if attacking
if (self.isAttacking) {
// Check if we should accelerate or decelerate based on player control
if (isPlayerControlling && !self.isAccelerating) {
self.accelerate();
} else if (!isPlayerControlling && self.isAccelerating) {
self.decelerate();
}
}
};
return self;
});
var BoxBoundary = Container.expand(function () {
var self = Container.call(this);
// Create four walls for the box
var topWall = self.attachAsset('boxBorder', {
anchorX: 0,
anchorY: 0,
width: 1600,
height: 8
});
var bottomWall = self.attachAsset('boxBorder', {
anchorX: 0,
anchorY: 0,
width: 1600,
height: 8
});
var leftWall = self.attachAsset('boxBorder', {
anchorX: 0,
anchorY: 0,
width: 8,
height: 1200
});
var rightWall = self.attachAsset('boxBorder', {
anchorX: 0,
anchorY: 0,
width: 8,
height: 1200
});
// Position walls
topWall.x = 0;
topWall.y = 0;
bottomWall.x = 0;
bottomWall.y = 1200 - 8;
leftWall.x = 0;
leftWall.y = 0;
rightWall.x = 1600 - 8;
rightWall.y = 0;
return self;
});
var Heart = Container.expand(function () {
var self = Container.call(this);
var heartGraphics = self.attachAsset('heart', {
anchorX: 0.5,
anchorY: 0.5
});
return self;
});
var Ivy = Container.expand(function () {
var self = Container.call(this);
// Create ivy graphic - anchor from top to hang down
var ivyGraphics = self.attachAsset('ivy', {
anchorX: 0.5,
anchorY: 0
});
self.damage = 5;
self.speed = 3;
self.lastX = 0;
self.lastY = 0;
self.movingRight = true;
self.update = function () {
self.lastX = self.x;
self.lastY = self.y;
// Move vertically within the box boundaries
var ivyHalfHeight = 400; // Half of 800px ivy height
var minY = boxY + 8 + ivyHalfHeight;
var maxY = boxY + boxHeight - 8 - ivyHalfHeight;
if (self.movingRight) {
// Using movingRight variable to track upward movement
self.y -= self.speed; // Move up
if (self.y <= minY) {
self.y = minY;
self.movingRight = false; // Switch to moving down
}
} else {
self.y += self.speed; // Move down
if (self.y >= maxY) {
self.y = maxY;
self.movingRight = true; // Switch to moving up
}
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xf0f8ff
});
/****
* Game Code
****/
// Box dimensions
var boxX = 224; // Center the 1600px box in 2048px screen
var boxY = 766; // Center the 1200px box in 2732px screen
var boxWidth = 1600;
var boxHeight = 1200;
// Create box boundary
var boundary = game.addChild(new BoxBoundary());
boundary.x = boxX;
boundary.y = boxY;
// Create heart character
var heart = game.addChild(new Heart());
heart.x = boxX + boxWidth / 2; // Center of box
heart.y = boxY + boxHeight / 2; // Center of box
// Create lives display
var livesTxt = new Text2('Lives: 92', {
size: 80,
fill: 0x000000
});
livesTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(livesTxt);
// Dragging variables
var isDragging = false;
var dragOffsetX = 0;
var dragOffsetY = 0;
// Constraint function to keep heart within boundaries
function constrainHeartPosition() {
var heartRadius = 50; // Half of heart width/height
// Left boundary
if (heart.x - heartRadius < boxX + 8) {
heart.x = boxX + 8 + heartRadius;
}
// Right boundary
if (heart.x + heartRadius > boxX + boxWidth - 8) {
heart.x = boxX + boxWidth - 8 - heartRadius;
}
// Top boundary
if (heart.y - heartRadius < boxY + 8) {
heart.y = boxY + 8 + heartRadius;
}
// Bottom boundary
if (heart.y + heartRadius > boxY + boxHeight - 8) {
heart.y = boxY + boxHeight - 8 - heartRadius;
}
}
// Player control variables
var targetX = 0;
var targetY = 0;
var isPlayerControlling = false;
// Touch/mouse down event
game.down = function (x, y, obj) {
isPlayerControlling = true;
targetX = x;
targetY = y;
};
// Touch/mouse move event
game.move = function (x, y, obj) {
if (isPlayerControlling) {
targetX = x;
targetY = y;
}
};
// Touch/mouse up event
game.up = function (x, y, obj) {
isPlayerControlling = false;
};
// Lives system
var lives = 92;
// Movement variables
var heartSpeed = 8;
var movementDirection = {
x: 1,
y: 0.5
}; // Initial movement direction
var lastDirectionChangeTime = 0;
var directionChangeInterval = 2000; // Change direction every 2 seconds
// Bone enemy system
var bones = [];
var maxBones = 8;
var boneSpawnTimer = 0;
var boneSpawnInterval = 720; // Spawn every 12 seconds at 60fps (75% reduction)
var waveIntensity = 1;
// Anchor system
var anchors = [];
var maxAnchors = 1;
var anchorSpawnTimer = 0;
var anchorSpawnInterval = 240; // Spawn every 4 seconds at 60fps
// Ivy system
var ivies = [];
var maxIvies = 3;
var ivySpawnTimer = 0;
var ivySpawnInterval = 600; // Spawn every 10 seconds at 60fps
// Slow effect system
var isSlowed = false;
var slowEndTime = 0;
var normalHeartSpeed = 8;
// Function to spawn a new bone at random edge position
function spawnBone() {
if (bones.length >= maxBones) return;
var bone = new Bone();
var edge = Math.floor(Math.random() * 4); // 0=top, 1=right, 2=bottom, 3=left
// Position bone at random point on selected edge
switch (edge) {
case 0:
// Top edge
bone.x = boxX + Math.random() * boxWidth;
bone.y = boxY - 50;
break;
case 1:
// Right edge
bone.x = boxX + boxWidth + 50;
bone.y = boxY + Math.random() * boxHeight;
break;
case 2:
// Bottom edge
bone.x = boxX + Math.random() * boxWidth;
bone.y = boxY + boxHeight + 50;
break;
case 3:
// Left edge
bone.x = boxX - 50;
bone.y = boxY + Math.random() * boxHeight;
break;
}
bone.lastX = bone.x;
bone.lastY = bone.y;
bones.push(bone);
game.addChild(bone);
// Start attacking the heart immediately
bone.startAttack(heart.x, heart.y);
}
// Function to spawn a new anchor at random position within the box
function spawnAnchor() {
if (anchors.length >= maxAnchors) return;
var anchor = new Anchor();
// Position anchor within the box boundaries for horizontal movement
var anchorHalfWidth = 60; // Half of 120px anchor width
var startFromLeft = Math.random() < 0.5;
if (startFromLeft) {
anchor.x = boxX + 8 + anchorHalfWidth; // Start from left edge inside box
anchor.movingRight = true; // Moving right
} else {
anchor.x = boxX + boxWidth - 8 - anchorHalfWidth; // Start from right edge inside box
anchor.movingRight = false; // Moving left
}
// Random Y position within the box, constrained to keep full anchor height inside
var anchorHalfHeight = 600; // Half of 1200px anchor height
anchor.y = boxY + anchorHalfHeight + Math.random() * (boxHeight - 2 * anchorHalfHeight);
anchor.lastX = anchor.x;
anchor.lastY = anchor.y;
anchors.push(anchor);
game.addChild(anchor);
}
// Function to spawn a new ivy hanging from top of box like an anchor
function spawnIvy() {
if (ivies.length >= maxIvies) return;
var ivy = new Ivy();
// Position ivy for vertical movement
var ivyHalfHeight = 400; // Half of 800px ivy height
var startFromTop = Math.random() < 0.5;
if (startFromTop) {
ivy.y = boxY + 8 + ivyHalfHeight; // Start from top edge inside box
ivy.movingRight = true; // Using movingRight to track upward movement
} else {
ivy.y = boxY + boxHeight - 8 - ivyHalfHeight; // Start from bottom edge inside box
ivy.movingRight = false; // Using movingRight to track downward movement
}
// Random X position within the box, constrained to keep full ivy width inside
var ivyHalfWidth = 60; // Half of 120px ivy width
ivy.x = boxX + ivyHalfWidth + Math.random() * (boxWidth - 2 * ivyHalfWidth);
ivy.lastX = ivy.x;
ivy.lastY = ivy.y;
ivies.push(ivy);
game.addChild(ivy);
}
// Game update loop
game.update = function () {
// Increase wave intensity over time
if (LK.ticks % 600 === 0) {
// Every 10 seconds
waveIntensity = Math.min(waveIntensity + 0.5, 4);
maxBones = Math.min(Math.floor(4 + waveIntensity * 2), 12);
boneSpawnInterval = Math.max(Math.floor(720 - waveIntensity * 120), 240);
}
// Spawn bones periodically with wave patterns
boneSpawnTimer++;
if (boneSpawnTimer >= boneSpawnInterval) {
// Sometimes spawn multiple bones at once for Undertale feel
var spawnCount = Math.random() < 0.3 ? Math.floor(waveIntensity) : 1;
for (var s = 0; s < spawnCount && bones.length < maxBones; s++) {
spawnBone();
}
boneSpawnTimer = 0;
}
// Spawn anchors periodically
anchorSpawnTimer++;
if (anchorSpawnTimer >= anchorSpawnInterval) {
spawnAnchor();
anchorSpawnTimer = 0;
}
// Spawn ivies periodically
ivySpawnTimer++;
if (ivySpawnTimer >= ivySpawnInterval) {
// Spawn 2-3 ivies at once
var spawnCount = Math.floor(Math.random() * 2) + 2; // 2 or 3 ivies
for (var i = 0; i < spawnCount && ivies.length < maxIvies; i++) {
spawnIvy();
}
ivySpawnTimer = 0;
}
// Handle slow effect expiry
if (isSlowed && LK.ticks >= slowEndTime) {
isSlowed = false;
heartSpeed = normalHeartSpeed;
}
// Update all bones and check for collisions
for (var i = bones.length - 1; i >= 0; i--) {
var bone = bones[i];
// Check if bone hit the heart
if (bone.intersects(heart)) {
// Reduce lives by 4
lives -= 4;
livesTxt.setText('Lives: ' + lives);
// Flash screen red to indicate damage
LK.effects.flashScreen(0xff0000, 500);
// Check for game over
if (lives <= 0) {
LK.showGameOver();
return;
}
// Remove the bone that hit us
bone.destroy();
bones.splice(i, 1);
continue;
}
// Remove bones that are too far from the play area
var distanceFromCenter = Math.sqrt(Math.pow(bone.x - (boxX + boxWidth / 2), 2) + Math.pow(bone.y - (boxY + boxHeight / 2), 2));
if (distanceFromCenter > 2000) {
bone.destroy();
bones.splice(i, 1);
continue;
}
// Retarget bones that aren't currently attacking
if (!bone.isAttacking && Math.random() < 0.01) {
// 1% chance per frame
bone.startAttack(heart.x, heart.y);
}
}
// Update all anchors and check for collisions
for (var j = anchors.length - 1; j >= 0; j--) {
var anchor = anchors[j];
// Removed health decrease timer initialization
// Removed anchor-based health decrease mechanic
// Check if anchor hit the heart
if (anchor.intersects(heart)) {
var shouldTakeDamage = false;
// Blue anchor: damage if player is moving
if (anchor.isBlue && isPlayerControlling) {
shouldTakeDamage = true;
}
// Orange anchor: damage if player is not moving
else if (!anchor.isBlue && !isPlayerControlling) {
shouldTakeDamage = true;
}
if (shouldTakeDamage) {
// Reduce lives by anchor damage (2)
lives -= anchor.damage;
livesTxt.setText('Lives: ' + lives);
// Flash screen purple to indicate anchor damage
LK.effects.flashScreen(0x8800ff, 700);
// Check for game over
if (lives <= 0) {
LK.showGameOver();
return;
}
}
// Remove the anchor that hit us
anchor.destroy();
anchors.splice(j, 1);
continue;
}
// Anchors now stay within box bounds, so no need to remove them for going off screen
// They will only be removed when hitting the heart
}
// Update all ivies and check for collisions
for (var k = ivies.length - 1; k >= 0; k--) {
var ivy = ivies[k];
// Check if ivy hit the heart
if (ivy.intersects(heart)) {
// Reduce lives by 5
lives -= ivy.damage;
livesTxt.setText('Lives: ' + lives);
// Apply slow effect (25% speed reduction)
isSlowed = true;
heartSpeed = normalHeartSpeed * 0.75;
slowEndTime = LK.ticks + 300; // Slow for 5 seconds at 60fps
// Flash screen green to indicate ivy damage and slow
LK.effects.flashScreen(0x00ff00, 600);
// Check for game over
if (lives <= 0) {
LK.showGameOver();
return;
}
// Remove the ivy that hit us
ivy.destroy();
ivies.splice(k, 1);
continue;
}
// Ivies now stay within box bounds like anchors, so no need to remove them for going off screen
// They will only be removed when hitting the heart
}
if (isPlayerControlling) {
// Calculate direction toward target
var deltaX = targetX - heart.x;
var deltaY = targetY - heart.y;
var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
// Move toward target if not already there
if (distance > 5) {
// Normalize direction and apply speed
movementDirection.x = deltaX / distance;
movementDirection.y = deltaY / distance;
heart.x += movementDirection.x * heartSpeed;
heart.y += movementDirection.y * heartSpeed;
}
}
// Ensure heart stays within bounds each frame
constrainHeartPosition();
}; ===================================================================
--- original.js
+++ change.js
@@ -33,35 +33,34 @@
};
self.update = function () {
self.lastX = self.x;
self.lastY = self.y;
- // Move vertically within the box boundaries
- var anchorHalfHeight = 600; // Half of 1200px anchor height
- var minY = boxY + 8 + anchorHalfHeight;
- var maxY = boxY + boxHeight - 8 - anchorHalfHeight;
+ // Move horizontally within the box boundaries
+ var anchorHalfWidth = 60; // Half of 120px anchor width
+ var minX = boxX + 8 + anchorHalfWidth;
+ var maxX = boxX + boxWidth - 8 - anchorHalfWidth;
if (self.movingRight) {
- // Using movingRight variable to track upward movement
- self.y -= self.speed; // Move up
- if (self.y <= minY) {
- self.y = minY;
- self.movingRight = false; // Switch to moving down
+ self.x += self.speed; // Move right
+ if (self.x >= maxX) {
+ self.x = maxX;
+ self.movingRight = false; // Switch to moving left
}
} else {
- self.y += self.speed; // Move down
- if (self.y >= maxY) {
- self.y = maxY;
- self.movingRight = true; // Switch to moving up
+ self.x -= self.speed; // Move left
+ if (self.x <= minX) {
+ self.x = minX;
+ self.movingRight = true; // Switch to moving right
}
}
- // Keep anchor within horizontal bounds of the box
- var anchorHalfWidth = 60; // Half of 120px anchor width
- var minX = boxX + 8 + anchorHalfWidth;
- var maxX = boxX + boxWidth - 8 - anchorHalfWidth;
- if (self.x < minX) {
- self.x = minX;
+ // Keep anchor within vertical bounds of the box
+ var anchorHalfHeight = 600; // Half of 1200px anchor height
+ var minY = boxY + 8 + anchorHalfHeight;
+ var maxY = boxY + boxHeight - 8 - anchorHalfHeight;
+ if (self.y < minY) {
+ self.y = minY;
}
- if (self.x > maxX) {
- self.x = maxX;
+ if (self.y > maxY) {
+ self.y = maxY;
}
// Change color periodically
self.colorChangeTimer++;
if (self.colorChangeTimer >= self.colorChangeInterval) {
@@ -277,23 +276,24 @@
self.movingRight = true;
self.update = function () {
self.lastX = self.x;
self.lastY = self.y;
- // Move horizontally within the box boundaries like an anchor
- var ivyHalfWidth = 60; // Half of 120px ivy width
- var minX = boxX + 8 + ivyHalfWidth;
- var maxX = boxX + boxWidth - 8 - ivyHalfWidth;
+ // Move vertically within the box boundaries
+ var ivyHalfHeight = 400; // Half of 800px ivy height
+ var minY = boxY + 8 + ivyHalfHeight;
+ var maxY = boxY + boxHeight - 8 - ivyHalfHeight;
if (self.movingRight) {
- self.x += self.speed;
- if (self.x >= maxX) {
- self.x = maxX;
- self.movingRight = false;
+ // Using movingRight variable to track upward movement
+ self.y -= self.speed; // Move up
+ if (self.y <= minY) {
+ self.y = minY;
+ self.movingRight = false; // Switch to moving down
}
} else {
- self.x -= self.speed;
- if (self.x <= minX) {
- self.x = minX;
- self.movingRight = true;
+ self.y += self.speed; // Move down
+ if (self.y >= maxY) {
+ self.y = maxY;
+ self.movingRight = true; // Switch to moving up
}
}
};
return self;
@@ -442,21 +442,21 @@
// Function to spawn a new anchor at random position within the box
function spawnAnchor() {
if (anchors.length >= maxAnchors) return;
var anchor = new Anchor();
- // Position anchor within the box boundaries for vertical movement
- var anchorHalfHeight = 600; // Half of 1200px anchor height
- var startFromTop = Math.random() < 0.5;
- if (startFromTop) {
- anchor.y = boxY + 8 + anchorHalfHeight; // Start from top edge inside box
- anchor.movingRight = true; // Using movingRight to track upward movement
+ // Position anchor within the box boundaries for horizontal movement
+ var anchorHalfWidth = 60; // Half of 120px anchor width
+ var startFromLeft = Math.random() < 0.5;
+ if (startFromLeft) {
+ anchor.x = boxX + 8 + anchorHalfWidth; // Start from left edge inside box
+ anchor.movingRight = true; // Moving right
} else {
- anchor.y = boxY + boxHeight - 8 - anchorHalfHeight; // Start from bottom edge inside box
- anchor.movingRight = false; // Using movingRight to track downward movement
+ anchor.x = boxX + boxWidth - 8 - anchorHalfWidth; // Start from right edge inside box
+ anchor.movingRight = false; // Moving left
}
- // Random X position within the box, constrained to keep full anchor width inside
- var anchorHalfWidth = 60; // Half of 120px anchor width
- anchor.x = boxX + anchorHalfWidth + Math.random() * (boxWidth - 2 * anchorHalfWidth);
+ // Random Y position within the box, constrained to keep full anchor height inside
+ var anchorHalfHeight = 600; // Half of 1200px anchor height
+ anchor.y = boxY + anchorHalfHeight + Math.random() * (boxHeight - 2 * anchorHalfHeight);
anchor.lastX = anchor.x;
anchor.lastY = anchor.y;
anchors.push(anchor);
game.addChild(anchor);
@@ -464,20 +464,21 @@
// Function to spawn a new ivy hanging from top of box like an anchor
function spawnIvy() {
if (ivies.length >= maxIvies) return;
var ivy = new Ivy();
- // Position ivy to hang from top of box
- var ivyHalfWidth = 60; // Half of 120px ivy width
- var startFromLeft = Math.random() < 0.5;
- if (startFromLeft) {
- ivy.x = boxX + 8 + ivyHalfWidth; // Start from left edge inside box
- ivy.movingRight = true;
+ // Position ivy for vertical movement
+ var ivyHalfHeight = 400; // Half of 800px ivy height
+ var startFromTop = Math.random() < 0.5;
+ if (startFromTop) {
+ ivy.y = boxY + 8 + ivyHalfHeight; // Start from top edge inside box
+ ivy.movingRight = true; // Using movingRight to track upward movement
} else {
- ivy.x = boxX + boxWidth - 8 - ivyHalfWidth; // Start from right edge inside box
- ivy.movingRight = false;
+ ivy.y = boxY + boxHeight - 8 - ivyHalfHeight; // Start from bottom edge inside box
+ ivy.movingRight = false; // Using movingRight to track downward movement
}
- // Position at top of box to hang down (anchor from top)
- ivy.y = boxY + 8; // Just inside the top wall
+ // Random X position within the box, constrained to keep full ivy width inside
+ var ivyHalfWidth = 60; // Half of 120px ivy width
+ ivy.x = boxX + ivyHalfWidth + Math.random() * (boxWidth - 2 * ivyHalfWidth);
ivy.lastX = ivy.x;
ivy.lastY = ivy.y;
ivies.push(ivy);
game.addChild(ivy);
Undertale Heart. In-Game asset. 2d. High contrast. No shadows
Undertale bone with black outline. In-Game asset. 2d. High contrast. No shadows
Undertale asgore spear. In-Game asset. 2d. High contrast. No shadows
Ivy. In-Game asset. 2d. High contrast. No shadows
Sans Undertale. In-Game asset. 2d. High contrast. No shadows
Asgore Undertale. In-Game asset. 2d. High contrast. No shadows
Flowey Undertale but with 6 souls (Orange,Green,Yellow,blue,Purple, Light Blue). In-Game asset. 2d. High contrast. No shadows
Flat staring gaster blaster Undertale. In-Game asset. 2d. High contrast. No shadows
Undertale heart but blue. In-Game asset. 2d. High contrast. No shadows
Green Heart Undertale. In-Game asset. 2d. High contrast. No shadows
Yellow heart Undertale. In-Game asset. 2d. High contrast. No shadows