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
/**** * 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 }); /**** * Game Code ****/ // Main floor (covers the whole map) // Expand the map: create a large school with multiple areas 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 = LK.getAsset('profesor', { x: 1600, y: 2732 / 2, anchorX: 0.5, anchorY: 0.5 }); 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(); // 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
@@ -42,10 +42,10 @@
/****
* Game Code
****/
-// Expand the map: create a large school with multiple areas
// Main floor (covers the whole map)
+// Expand the map: create a large school with multiple areas
var floor = LK.getAsset('floor', {
anchorX: 0,
anchorY: 0,
x: 0,
@@ -194,13 +194,28 @@
// Camera follow logic
game.update = function () {
// Update student
if (student.update) student.update();
- // Camera follows student (3rd person)
- var targetCamX = Math.max(0, Math.min(student.x - cameraOffsetX, 2048 - 2048));
- var targetCamY = Math.max(0, Math.min(student.y - cameraOffsetY, 2732 - 2732));
- game.x = -targetCamX;
- game.y = -targetCamY;
+ // 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)
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