User prompt
Make the maze a lot easier, please!
User prompt
The problem isn't fixed!
User prompt
for some reason every second or every run after the first one the characters are just in the walls and you can't hardly see them so can you fix that problem please?
User prompt
make a victory screen and the victory screen is a picture of the guy like the player with a torch and the monster with a hammer in his in his head and blood everywhere
User prompt
The player appear in every game, because sometimes it just disappears, the player.
User prompt
The players disappeared can you just change like the size of the maze just back to it was at the start
User prompt
Make it a little bit bigger so you can see everything.
User prompt
Get rid of that code about it being bigger.
User prompt
Please fix the bug: 'game.sortChildren is not a function' in or related to this line: 'game.sortChildren();' Line Number: 284
User prompt
Players disappeared make the whole maze up up here. Not like just some of the maze
User prompt
and change to make everything, like, bigger. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
The jump scare like the monster comes up to your face and then a creepy sound comes up and then it restarts ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
jump-scare when the monster attacks you and when it touches you at the end. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
it wears the sound like i can't hear it like when it's pretty close to you it makes like a creepy noise
User prompt
Gregor sound when the monster's like close here like a sound
User prompt
You know what, get rid of the code about it not being able to pass through the wall, just get rid of that code that I just said before.
User prompt
skeleton in the wall like I mean like it can't pass through walls it can still walk through the maze but it can't pass through the walls and has to stay in like the wall lines
User prompt
Skeleton have to stick with like the laws too, and it can't go out of the wall, it has to stay in the wall.
User prompt
I'll add an end to the maze like every time you die it like resets the maze but like every time there's a different end to the maze so it's all different every time
User prompt
you know what just get rid of that that completely just get rid of the joystick and just let it like wherever you click on on the maze you move into it moves the character there
User prompt
it's still doing the same thing like it only moves up like but let it move down as well and like sideways in every way and then all and then that's really it and then i'll let you on
User prompt
can still only move it up like you can't move it down the joystick you can only just move it up and it only puts the character like up so let the joystick move down as well and then like that moves the character down and also still it doesn't it doesn't like it still lets you leave the
User prompt
For some reason you can only move it up, you can move it like any direction like so you can move the joystick in any direction and then it moves it there and also make the player faster
User prompt
you can't move the joystick like you need to like move it around so you're like um like when you touch it and then move in the direction it moves in that direction
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var localPos = self.toLocal(obj.parent.toGlobal(obj.position));' Line Number: 78
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Exit = Container.expand(function () { var self = Container.call(this); var exitGraphics = self.attachAsset('exit', { anchorX: 0.5, anchorY: 0.5 }); // Pulsing effect self.pulseDirection = 1; self.update = function () { exitGraphics.alpha += self.pulseDirection * 0.02; if (exitGraphics.alpha >= 1) { self.pulseDirection = -1; } else if (exitGraphics.alpha <= 0.3) { self.pulseDirection = 1; } }; return self; }); var Floor = Container.expand(function () { var self = Container.call(this); var floorGraphics = self.attachAsset('floor', { anchorX: 0, anchorY: 0 }); return self; }); var Player = Container.expand(function () { var self = Container.call(this); self.speed = 8; self.targetX = 0; self.targetY = 0; self.isMoving = false; self.setTarget = function (x, y) { self.targetX = x; self.targetY = y; self.isMoving = true; }; self.update = function () { if (self.isMoving) { var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.speed) { var moveX = dx / distance * self.speed; var moveY = dy / distance * self.speed; var newX = self.x + moveX; var newY = self.y + moveY; // Calculate maze boundaries with padding for player size var mazeLeft = offsetX + 30; var mazeRight = offsetX + mazeLayout[0].length * cellSize - 30; var mazeTop = offsetY + 30; var mazeBottom = offsetY + mazeLayout.length * cellSize - 30; // Check boundaries and wall collisions for X movement if (newX >= mazeLeft && newX <= mazeRight && !checkWallCollision(newX, self.y)) { self.x = newX; } // Check boundaries and wall collisions for Y movement if (newY >= mazeTop && newY <= mazeBottom && !checkWallCollision(self.x, newY)) { self.y = newY; } // Play footstep sound occasionally while moving if (Math.random() < 0.05) { LK.getSound('footstep').play(); } } else { self.isMoving = false; } } }; var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Skeleton = Container.expand(function () { var self = Container.call(this); self.update = function () { if (player) { var dx = player.x - self.x; var dy = player.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { var speed = 2.5; self.x += dx / distance * speed; self.y += dy / distance * speed; } // Random roar sound if (Math.random() < 0.002) { LK.getSound('skeleton_roar').play(); } } }; var skeletonGraphics = self.attachAsset('skeleton', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Wall = Container.expand(function () { var self = Container.call(this); var wallGraphics = self.attachAsset('wall', { anchorX: 0, anchorY: 0 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a1a }); /**** * Game Code ****/ // Game variables var player; var skeleton; var walls = []; var floors = []; var exit; var gameStarted = false; var lastPlayerX = 0; var lastPlayerY = 0; var lastSkeletonDistance = Infinity; // Create maze layout var mazeLayout = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]; var cellSize = 100; var offsetX = (2048 - mazeLayout[0].length * cellSize) / 2; var offsetY = 200; // Create maze for (var row = 0; row < mazeLayout.length; row++) { for (var col = 0; col < mazeLayout[row].length; col++) { var x = offsetX + col * cellSize; var y = offsetY + row * cellSize; if (mazeLayout[row][col] === 1) { var wall = new Wall(); wall.x = x; wall.y = y; walls.push(wall); game.addChild(wall); } else { var floor = new Floor(); floor.x = x; floor.y = y; floors.push(floor); game.addChild(floor); } } } // Create player at starting position player = new Player(); player.x = offsetX + 1.5 * cellSize; player.y = offsetY + 1.5 * cellSize; lastPlayerX = player.x; lastPlayerY = player.y; game.addChild(player); // Create skeleton at bottom of maze skeleton = new Skeleton(); skeleton.x = offsetX + 18.5 * cellSize; skeleton.y = offsetY + 13.5 * cellSize; game.addChild(skeleton); // Create exit at top right exit = new Exit(); exit.x = offsetX + 18.5 * cellSize; exit.y = offsetY + 1.5 * cellSize; game.addChild(exit); // UI elements var instructionText = new Text2('Click to move. Escape the mine!', { size: 60, fill: 0xFFFFFF }); instructionText.anchor.set(0.5, 0); LK.gui.top.addChild(instructionText); instructionText.y = 100; var distanceText = new Text2('', { size: 50, fill: 0xFF4444 }); distanceText.anchor.set(0.5, 0); LK.gui.top.addChild(distanceText); distanceText.y = 180; function checkWallCollision(x, y) { var col = Math.floor((x - offsetX) / cellSize); var row = Math.floor((y - offsetY) / cellSize); if (row < 0 || row >= mazeLayout.length || col < 0 || col >= mazeLayout[0].length) { return true; } return mazeLayout[row][col] === 1; } game.update = function () { // Check if player reached exit if (player.intersects(exit)) { LK.getSound('escape').play(); LK.showYouWin(); return; } // Check if skeleton caught player var skeletonDistance = Math.sqrt(Math.pow(player.x - skeleton.x, 2) + Math.pow(player.y - skeleton.y, 2)); if (!lastSkeletonDistance) lastSkeletonDistance = skeletonDistance; if (lastSkeletonDistance > 80 && skeletonDistance <= 80) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } lastSkeletonDistance = skeletonDistance; // Update distance display var distanceToExit = Math.sqrt(Math.pow(player.x - exit.x, 2) + Math.pow(player.y - exit.y, 2)); distanceText.setText('Skeleton Distance: ' + Math.floor(skeletonDistance)); // Create tension effect when skeleton is close if (skeletonDistance < 200) { var intensity = (200 - skeletonDistance) / 200; game.setBackgroundColor(Math.floor(0x1a * (1 + intensity)) << 16 | Math.floor(0x1a * (1 - intensity * 0.5)) << 8 | Math.floor(0x1a * (1 - intensity * 0.5))); } else { game.setBackgroundColor(0x1a1a1a); } }; // Click to move handler game.down = function (x, y, obj) { if (player) { player.setTarget(x, y); } }; // Start ambient music LK.playMusic('horror_ambient'); ;
===================================================================
--- original.js
+++ change.js
@@ -31,81 +31,51 @@
anchorY: 0
});
return self;
});
-var Joystick = Container.expand(function () {
+var Player = Container.expand(function () {
var self = Container.call(this);
- var baseGraphics = self.attachAsset('joystick_base', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- baseGraphics.alpha = 0.6;
- var knobGraphics = self.attachAsset('joystick_knob', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- knobGraphics.alpha = 0.8;
- self.isDragging = false;
- self.maxDistance = 60;
- self.inputX = 0;
- self.inputY = 0;
- self.down = function (x, y, obj) {
- self.isDragging = true;
+ self.speed = 8;
+ self.targetX = 0;
+ self.targetY = 0;
+ self.isMoving = false;
+ self.setTarget = function (x, y) {
+ self.targetX = x;
+ self.targetY = y;
+ self.isMoving = true;
};
- self.up = function (x, y, obj) {
- self.isDragging = false;
- knobGraphics.x = 0;
- knobGraphics.y = 0;
- self.inputX = 0;
- self.inputY = 0;
- };
- self.move = function (x, y, obj) {
- if (self.isDragging) {
- // Convert screen coordinates to local joystick coordinates
- var localPos = {
- x: x - self.x,
- y: y - self.y
- };
- var distance = Math.sqrt(localPos.x * localPos.x + localPos.y * localPos.y);
- if (distance <= self.maxDistance) {
- knobGraphics.x = localPos.x;
- knobGraphics.y = localPos.y;
+ self.update = function () {
+ if (self.isMoving) {
+ var dx = self.targetX - self.x;
+ var dy = self.targetY - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance > self.speed) {
+ var moveX = dx / distance * self.speed;
+ var moveY = dy / distance * self.speed;
+ var newX = self.x + moveX;
+ var newY = self.y + moveY;
+ // Calculate maze boundaries with padding for player size
+ var mazeLeft = offsetX + 30;
+ var mazeRight = offsetX + mazeLayout[0].length * cellSize - 30;
+ var mazeTop = offsetY + 30;
+ var mazeBottom = offsetY + mazeLayout.length * cellSize - 30;
+ // Check boundaries and wall collisions for X movement
+ if (newX >= mazeLeft && newX <= mazeRight && !checkWallCollision(newX, self.y)) {
+ self.x = newX;
+ }
+ // Check boundaries and wall collisions for Y movement
+ if (newY >= mazeTop && newY <= mazeBottom && !checkWallCollision(self.x, newY)) {
+ self.y = newY;
+ }
+ // Play footstep sound occasionally while moving
+ if (Math.random() < 0.05) {
+ LK.getSound('footstep').play();
+ }
} else {
- knobGraphics.x = localPos.x / distance * self.maxDistance;
- knobGraphics.y = localPos.y / distance * self.maxDistance;
+ self.isMoving = false;
}
- self.inputX = knobGraphics.x / self.maxDistance;
- self.inputY = knobGraphics.y / self.maxDistance;
}
};
- return self;
-});
-var Player = Container.expand(function () {
- var self = Container.call(this);
- self.speed = 12;
- self.update = function () {
- if (joystick && (joystick.inputX !== 0 || joystick.inputY !== 0)) {
- var newX = self.x + joystick.inputX * self.speed;
- var newY = self.y + joystick.inputY * self.speed;
- // Calculate maze boundaries with padding for player size
- var mazeLeft = offsetX + 30;
- var mazeRight = offsetX + mazeLayout[0].length * cellSize - 30;
- var mazeTop = offsetY + 30;
- var mazeBottom = offsetY + mazeLayout.length * cellSize - 30;
- // Check boundaries and wall collisions for X movement
- if (newX >= mazeLeft && newX <= mazeRight && !checkWallCollision(newX, self.y)) {
- self.x = newX;
- }
- // Check boundaries and wall collisions for Y movement
- if (newY >= mazeTop && newY <= mazeBottom && !checkWallCollision(self.x, newY)) {
- self.y = newY;
- }
- // Play footstep sound occasionally while moving
- if (Math.random() < 0.05) {
- LK.getSound('footstep').play();
- }
- }
- };
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
@@ -159,9 +129,8 @@
var skeleton;
var walls = [];
var floors = [];
var exit;
-var joystick;
var gameStarted = false;
var lastPlayerX = 0;
var lastPlayerY = 0;
var lastSkeletonDistance = Infinity;
@@ -206,15 +175,10 @@
exit = new Exit();
exit.x = offsetX + 18.5 * cellSize;
exit.y = offsetY + 1.5 * cellSize;
game.addChild(exit);
-// Create joystick
-joystick = new Joystick();
-joystick.x = 200;
-joystick.y = 2732 - 200;
-game.addChild(joystick);
// UI elements
-var instructionText = new Text2('Use joystick to move. Escape the mine!', {
+var instructionText = new Text2('Click to move. Escape the mine!', {
size: 60,
fill: 0xFFFFFF
});
instructionText.anchor.set(0.5, 0);
@@ -261,12 +225,12 @@
} else {
game.setBackgroundColor(0x1a1a1a);
}
};
-// Global move handler to support joystick dragging
-game.move = function (x, y, obj) {
- if (joystick && joystick.isDragging) {
- joystick.move(x, y, obj);
+// Click to move handler
+game.down = function (x, y, obj) {
+ if (player) {
+ player.setTarget(x, y);
}
};
// Start ambient music
LK.playMusic('horror_ambient');
A guy with a bag over his head with a cross on it. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
The player with a torch in his hand and the monster skeleton dead on the floor with a knife in his head and blood everywhere. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat