User prompt
Que el profesor sea lento
User prompt
Elimina los muebles
User prompt
Que el jugador se mueva
User prompt
que los muebles tengan colision
User prompt
Que en la puerta haiga una pregunta con varias obsiones la pregunta es 7×2 cuanto es obciones 13 obcion 2 14 obsion correcta 2
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'var dx = student.x - self.x;' Line Number: 32
User prompt
Que el profesor bregue matar al alumno
User prompt
Please fix the bug: 'Student is not defined' in or related to this line: 'var student = new Student();' Line Number: 154
User prompt
Que el profesor brege matar a el alumno
User prompt
Please fix the bug: 'Student is not defined' in or related to this line: 'var student = new Student();' Line Number: 154
User prompt
Please fix the bug: 'Student is not defined' in or related to this line: 'var student = new Student();' Line Number: 154
User prompt
que el profesor brege matar a el jugador
User prompt
Que por cuarto haiga una puerta
User prompt
Que haiga un colegio como el de baldi
User prompt
Que la camara este atras del personaje
User prompt
Que el mapa sea de un colegio que sea muy grande cancha y de todo
User prompt
Pero has un juego en 3 persona
User prompt
Please fix the bug: 'Maximum call stack size exceeded' in or related to this line: 'return {' Line Number: 76
User prompt
Please fix the bug: 'Maximum call stack size exceeded' in or related to this line: 'return {' Line Number: 75
User prompt
Please fix the bug: 'RangeError: Maximum call stack size exceeded' in or related to this line: 'return {' Line Number: 155
Code edit (1 edits merged)
Please save this source code
User prompt
San Luis: El Monstruo del Colegio
User prompt
Juego de un colegio escondite de un profesor monstruoso y que este basado en el sanluis yarumal
User prompt
Basado en el colegio sanluis de yarumal
User prompt
Un juego de supervivencia esconderse de un monstruo en un colegio
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Expand the map: create a large school with multiple areas // Main floor (covers the whole map) var floor = LK.getAsset('floor', { anchorX: 0, anchorY: 0, x: 0, y: 0 }); game.addChild(floor); // Top and bottom walls (main corridor) var wallTop = LK.getAsset('wall', { x: 0, y: 0, anchorX: 0, anchorY: 0 }); var wallBottom = LK.getAsset('wall', { x: 0, y: 2732 - 40, anchorX: 0, anchorY: 0 }); game.addChild(wallTop); game.addChild(wallBottom); // Left and right walls (vertical boundaries) var wallLeft = LK.getAsset('wall', { width: 40, height: 2732, x: 0, y: 0, anchorX: 0, anchorY: 0 }); var wallRight = LK.getAsset('wall', { width: 40, height: 2732, x: 2048 - 40, y: 0, anchorX: 0, anchorY: 0 }); game.addChild(wallLeft); game.addChild(wallRight); // Classrooms (rectangular furniture blocks) var classroom1 = LK.getAsset('furniture', { x: 300, y: 400, anchorX: 0.5, anchorY: 0.5 }); var classroom2 = LK.getAsset('furniture', { x: 300, y: 900, anchorX: 0.5, anchorY: 0.5 }); var classroom3 = LK.getAsset('furniture', { x: 300, y: 1400, anchorX: 0.5, anchorY: 0.5 }); var classroom4 = LK.getAsset('furniture', { x: 300, y: 2000, anchorX: 0.5, anchorY: 0.5 }); game.addChild(classroom1); game.addChild(classroom2); game.addChild(classroom3); game.addChild(classroom4); // Library (bigger furniture block) var library = LK.getAsset('furniture', { x: 800, y: 400, width: 400, height: 200, anchorX: 0.5, anchorY: 0.5 }); game.addChild(library); // Chapel (bigger furniture block) var chapel = LK.getAsset('furniture', { x: 1700, y: 400, width: 300, height: 200, anchorX: 0.5, anchorY: 0.5 }); game.addChild(chapel); // Sports field (large open area, visually represented by a big furniture block) var cancha = LK.getAsset('furniture', { x: 1200, y: 2000, width: 700, height: 400, anchorX: 0.5, anchorY: 0.5 }); game.addChild(cancha); // More hiding furniture (lockers, benches, etc.) var furniture3 = LK.getAsset('furniture', { x: 600, y: 1200, anchorX: 0.5, anchorY: 0.5 }); var furniture4 = LK.getAsset('furniture', { x: 1800, y: 1800, anchorX: 0.5, anchorY: 0.5 }); var furniture5 = LK.getAsset('furniture', { x: 1000, y: 2500, anchorX: 0.5, anchorY: 0.5 }); game.addChild(furniture3); game.addChild(furniture4); game.addChild(furniture5); // Add door (exit) at far right, near the sports field var door = LK.getAsset('door', { x: 2048 - 200, y: 2200, anchorX: 0, anchorY: 0 }); game.addChild(door); // Add student (player) and center camera on them var student = new Student(); student.x = 300; student.y = 2732 / 2; game.addChild(student); // Add profesor (monster) var profesor = new ProfesorMonster(); profesor.x = 1600; profesor.y = 2732 / 2; game.addChild(profesor); // Camera offset for 3rd person (centered on student) var cameraOffsetX = 1024; // half width var cameraOffsetY = 1366; // half height // Camera follow logic game.update = function () { // Update student if (student.update) student.update(); // Update profesor monster if (profesor.update) profesor.update(); // Check for kill: profesor touches student if (profesor.lastWasIntersecting === false && profesor.intersects(student)) { // Profesor kills the player LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } profesor.lastWasIntersecting = profesor.intersects(student); // Camera follows student from behind (3rd person, offset behind student direction) var dx = student.targetX - student.x; var dy = student.targetY - student.y; var dist = Math.sqrt(dx * dx + dy * dy); var camBehindDist = 350; // Distance behind the student var camX, camY; if (dist > 10) { // Camera is offset behind the student, in the opposite direction of movement camX = student.x - dx / dist * camBehindDist; camY = student.y - dy / dist * camBehindDist; } else { // If not moving, camera stays slightly above/behind camX = student.x - camBehindDist; camY = student.y; } // Clamp camera to map bounds camX = Math.max(0, Math.min(camX, 2048 - 2048)); camY = Math.max(0, Math.min(camY, 2732 - 2732)); game.x = -camX; game.y = -camY; }; // Drag-to-move logic (touch/mouse) game.down = function (x, y, obj) { // Move student to touch position (convert to game coordinates) student.targetX = x; student.targetY = y; }; game.move = function (x, y, obj) { student.targetX = x; student.targetY = y; }; game.up = function (x, y, obj) { // No-op for now };
===================================================================
--- original.js
+++ change.js
@@ -1,40 +1,5 @@
/****
-* Classes
-****/
-// Student class (player character)
-var Student = Container.expand(function () {
- var self = Container.call(this);
- var studentSprite = self.attachAsset('student', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 18;
- self.targetX = self.x;
- self.targetY = self.y;
- self.lastX = self.x;
- self.lastY = self.y;
- // Move student towards target position (for drag/touch movement)
- self.update = function () {
- // Smooth follow to target
- var dx = self.targetX - self.x;
- var dy = self.targetY - self.y;
- var dist = Math.sqrt(dx * dx + dy * dy);
- if (dist > self.speed) {
- self.x += dx / dist * self.speed;
- self.y += dy / dist * self.speed;
- } else {
- self.x = self.targetX;
- self.y = self.targetY;
- }
- // Update lastX/lastY for event triggers
- self.lastX = self.x;
- self.lastY = self.y;
- };
- return self;
-});
-
-/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
@@ -42,159 +7,136 @@
/****
* Game Code
****/
+// Expand the map: create a large school with multiple areas
// Main floor (covers the whole map)
var floor = LK.getAsset('floor', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0
});
game.addChild(floor);
-// Baldi's-style school: long corridors, grid of classrooms, and doors
-// Main horizontal corridor
-var mainCorridorY = 1200;
-var corridorHeight = 120;
-var corridor = LK.getAsset('wall', {
- width: 2048,
- height: corridorHeight,
+// Top and bottom walls (main corridor)
+var wallTop = LK.getAsset('wall', {
x: 0,
- y: mainCorridorY,
+ y: 0,
anchorX: 0,
anchorY: 0
});
-game.addChild(corridor);
-// Vertical walls at corridor ends
-var corridorWallLeft = LK.getAsset('wall', {
+var wallBottom = LK.getAsset('wall', {
+ x: 0,
+ y: 2732 - 40,
+ anchorX: 0,
+ anchorY: 0
+});
+game.addChild(wallTop);
+game.addChild(wallBottom);
+// Left and right walls (vertical boundaries)
+var wallLeft = LK.getAsset('wall', {
width: 40,
height: 2732,
x: 0,
y: 0,
anchorX: 0,
anchorY: 0
});
-var corridorWallRight = LK.getAsset('wall', {
+var wallRight = LK.getAsset('wall', {
width: 40,
height: 2732,
x: 2048 - 40,
y: 0,
anchorX: 0,
anchorY: 0
});
-game.addChild(corridorWallLeft);
-game.addChild(corridorWallRight);
-// Top and bottom boundaries
-var wallTop = LK.getAsset('wall', {
- x: 0,
- y: 0,
- anchorX: 0,
- anchorY: 0
+game.addChild(wallLeft);
+game.addChild(wallRight);
+// Classrooms (rectangular furniture blocks)
+var classroom1 = LK.getAsset('furniture', {
+ x: 300,
+ y: 400,
+ anchorX: 0.5,
+ anchorY: 0.5
});
-var wallBottom = LK.getAsset('wall', {
- x: 0,
- y: 2732 - 40,
- anchorX: 0,
- anchorY: 0
+var classroom2 = LK.getAsset('furniture', {
+ x: 300,
+ y: 900,
+ anchorX: 0.5,
+ anchorY: 0.5
});
-game.addChild(wallTop);
-game.addChild(wallBottom);
-// Classrooms grid (Baldi's style: left and right of corridor)
-var classroomWidth = 320;
-var classroomHeight = 400;
-var classroomSpacingY = 500;
-var classroomStartY = 300;
-var classroomRows = 4;
-var classrooms = [];
-for (var i = 0; i < classroomRows; i++) {
- // Left side
- var leftClass = LK.getAsset('furniture', {
- x: 200,
- y: classroomStartY + i * classroomSpacingY,
- width: classroomWidth,
- height: classroomHeight,
- anchorX: 0.5,
- anchorY: 0.5
- });
- game.addChild(leftClass);
- classrooms.push(leftClass);
- // Add a door to the left classroom (on the corridor side)
- var doorLeftCorridor = LK.getAsset('door', {
- x: 200 + classroomWidth,
- y: classroomStartY + i * classroomSpacingY + classroomHeight / 2 - 100,
- anchorX: 0,
- anchorY: 0
- });
- game.addChild(doorLeftCorridor);
- // Add a door inside the left classroom (opposite wall)
- var doorLeftInside = LK.getAsset('door', {
- x: 200,
- y: classroomStartY + i * classroomSpacingY + classroomHeight / 2 - 100,
- anchorX: 0,
- anchorY: 0
- });
- game.addChild(doorLeftInside);
- // Right side
- var rightClass = LK.getAsset('furniture', {
- x: 2048 - 200 - classroomWidth,
- y: classroomStartY + i * classroomSpacingY,
- width: classroomWidth,
- height: classroomHeight,
- anchorX: 0.5,
- anchorY: 0.5
- });
- game.addChild(rightClass);
- classrooms.push(rightClass);
- // Add a door to the right classroom (on the corridor side)
- var doorRightCorridor = LK.getAsset('door', {
- x: 2048 - 200 - classroomWidth - 60,
- y: classroomStartY + i * classroomSpacingY + classroomHeight / 2 - 100,
- anchorX: 0,
- anchorY: 0
- });
- game.addChild(doorRightCorridor);
- // Add a door inside the right classroom (opposite wall)
- var doorRightInside = LK.getAsset('door', {
- x: 2048 - 200 - classroomWidth + classroomWidth - 60,
- y: classroomStartY + i * classroomSpacingY + classroomHeight / 2 - 100,
- anchorX: 0,
- anchorY: 0
- });
- game.addChild(doorRightInside);
-}
-// Add a long sports field at the far end (top)
-var cancha = LK.getAsset('furniture', {
- x: 2048 / 2,
- y: 200,
- width: 1200,
- height: 300,
+var classroom3 = LK.getAsset('furniture', {
+ x: 300,
+ y: 1400,
anchorX: 0.5,
anchorY: 0.5
});
-game.addChild(cancha);
-// Add library and chapel at the bottom
+var classroom4 = LK.getAsset('furniture', {
+ x: 300,
+ y: 2000,
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+game.addChild(classroom1);
+game.addChild(classroom2);
+game.addChild(classroom3);
+game.addChild(classroom4);
+// Library (bigger furniture block)
var library = LK.getAsset('furniture', {
- x: 500,
- y: 2400,
+ x: 800,
+ y: 400,
width: 400,
height: 200,
anchorX: 0.5,
anchorY: 0.5
});
+game.addChild(library);
+// Chapel (bigger furniture block)
var chapel = LK.getAsset('furniture', {
- x: 2048 - 500,
- y: 2400,
- width: 400,
+ x: 1700,
+ y: 400,
+ width: 300,
height: 200,
anchorX: 0.5,
anchorY: 0.5
});
-game.addChild(library);
game.addChild(chapel);
-// Add main exit door at the far right of the corridor
+// Sports field (large open area, visually represented by a big furniture block)
+var cancha = LK.getAsset('furniture', {
+ x: 1200,
+ y: 2000,
+ width: 700,
+ height: 400,
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+game.addChild(cancha);
+// More hiding furniture (lockers, benches, etc.)
+var furniture3 = LK.getAsset('furniture', {
+ x: 600,
+ y: 1200,
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+var furniture4 = LK.getAsset('furniture', {
+ x: 1800,
+ y: 1800,
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+var furniture5 = LK.getAsset('furniture', {
+ x: 1000,
+ y: 2500,
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+game.addChild(furniture3);
+game.addChild(furniture4);
+game.addChild(furniture5);
+// Add door (exit) at far right, near the sports field
var door = LK.getAsset('door', {
x: 2048 - 200,
- y: mainCorridorY + corridorHeight / 2 - 100,
+ y: 2200,
anchorX: 0,
anchorY: 0
});
game.addChild(door);
@@ -203,22 +145,28 @@
student.x = 300;
student.y = 2732 / 2;
game.addChild(student);
// Add profesor (monster)
-var profesor = LK.getAsset('profesor', {
- x: 1600,
- y: 2732 / 2,
- anchorX: 0.5,
- anchorY: 0.5
-});
+var profesor = new ProfesorMonster();
+profesor.x = 1600;
+profesor.y = 2732 / 2;
game.addChild(profesor);
// Camera offset for 3rd person (centered on student)
var cameraOffsetX = 1024; // half width
var cameraOffsetY = 1366; // half height
// Camera follow logic
game.update = function () {
// Update student
if (student.update) student.update();
+ // Update profesor monster
+ if (profesor.update) profesor.update();
+ // Check for kill: profesor touches student
+ if (profesor.lastWasIntersecting === false && profesor.intersects(student)) {
+ // Profesor kills the player
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
+ profesor.lastWasIntersecting = profesor.intersects(student);
// Camera follows student from behind (3rd person, offset behind student direction)
var dx = student.targetX - student.x;
var dy = student.targetY - student.y;
var dist = Math.sqrt(dx * dx + dy * dy);
Modern App Store icon, high definition, square with rounded corners, for a game titled "San Luis: El Monstruo del Colegio" and with the description "Juego de escondite en el colegio San Luis de Yarumal, donde debes evitar a un profesor monstruoso y escapar del colegio.". No text on icon!
Puerta. In-Game asset. 2d. High contrast. No shadows
Piso liso. In-Game asset. 2d. High contrast. No shadows
Un solo pupitre. In-Game asset. 2d. High contrast. No shadows
Niño pequeño con uniforme blanco y sudadera azul. In-Game asset. 2d. High contrast. No shadows
Suelo de concreto. In-Game asset. 2d. High contrast. No shadows