User prompt
Cambia el tiempo de persecución a 3 segundos
User prompt
Al entrar en el rango de vista que los guardias persigan por 5 segundos y luego entren en su estado normal ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Que los guardias tengan un alcance de redención más grande
Code edit (1 edits merged)
Please save this source code
User prompt
Moonstone Metamorphosis
Initial prompt
Crear un juego mundo libre donde al inicio somos un niño y luego de ver la luna llena vamos cambiando de faces, al principio nos crece una cola de lobo, luego las orejas, luego las garras, luego las patas, la nariz , y luego el pelaje. Y para cambiar de faces hay que recolectar piedras lunares, y cada vez que cambia de faces desbloqueas abilidades. Y como enemigos tendremos unos guardias que quieren llevarnos a la perrera
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Guard = Container.expand(function () {
var self = Container.call(this);
self.patrolSpeed = 1.5;
self.alertSpeed = 4;
self.detectionRadius = 150;
self.isAlerted = false;
self.patrolDirection = Math.random() * Math.PI * 2;
self.patrolTimer = 0;
var guardGraphics = self.attachAsset('guard', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
self.patrolTimer++;
// Check if player is in detection range and not hiding
var dx = player.x - self.x;
var dy = player.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < self.detectionRadius + player.detectionRadius && !player.isHiding) {
self.isAlerted = true;
guardGraphics.tint = 0xFF4444;
} else {
self.isAlerted = false;
guardGraphics.tint = 0xFFFFFF;
}
if (self.isAlerted) {
// Chase player
var angle = Math.atan2(dy, dx);
self.x += Math.cos(angle) * self.alertSpeed;
self.y += Math.sin(angle) * self.alertSpeed;
} else {
// Patrol behavior
if (self.patrolTimer % 120 == 0) {
self.patrolDirection = Math.random() * Math.PI * 2;
}
self.x += Math.cos(self.patrolDirection) * self.patrolSpeed;
self.y += Math.sin(self.patrolDirection) * self.patrolSpeed;
// Keep guards within bounds
if (self.x < 100) {
self.x = 100;
self.patrolDirection = Math.random() * Math.PI;
}
if (self.x > 1948) {
self.x = 1948;
self.patrolDirection = Math.PI + Math.random() * Math.PI;
}
if (self.y < 100) {
self.y = 100;
self.patrolDirection = Math.PI * 0.5 + Math.random() * Math.PI;
}
if (self.y > 2632) {
self.y = 2632;
self.patrolDirection = Math.PI * 1.5 + Math.random() * Math.PI;
}
}
};
return self;
});
var Moonstone = Container.expand(function () {
var self = Container.call(this);
var moonstoneGraphics = self.attachAsset('moonstone', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Gentle glow animation
moonstoneGraphics.alpha = 0.7 + Math.sin(LK.ticks * 0.1) * 0.3;
moonstoneGraphics.rotation += 0.02;
};
return self;
});
var Obstacle = Container.expand(function (assetType) {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset(assetType, {
anchorX: 0.5,
anchorY: 0.5
});
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
self.transformationLevel = 0;
self.speed = 3;
self.isHiding = false;
self.detectionRadius = 120;
var playerGraphics = self.attachAsset('child', {
anchorX: 0.5,
anchorY: 0.5
});
self.transform = function () {
self.transformationLevel++;
// Update appearance based on transformation level
if (self.transformationLevel >= 7) {
// Full werewolf
self.removeChild(playerGraphics);
playerGraphics = self.attachAsset('werewolf', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 8;
self.detectionRadius = 80;
} else {
// Intermediate transformations - gradually change color and size
var tintValue = 0xFFB366 - self.transformationLevel * 0x1A1A1A;
playerGraphics.tint = tintValue;
var scaleIncrease = 1 + self.transformationLevel * 0.1;
playerGraphics.scaleX = scaleIncrease;
playerGraphics.scaleY = scaleIncrease;
self.speed = 3 + self.transformationLevel * 0.7;
self.detectionRadius = 120 - self.transformationLevel * 5;
}
LK.getSound('transformation').play();
LK.effects.flashObject(self, 0xE6E6FA, 1000);
};
self.checkHiding = function () {
self.isHiding = false;
// Check if player is behind any obstacle
for (var i = 0; i < obstacles.length; i++) {
var obstacle = obstacles[i];
var dx = self.x - obstacle.x;
var dy = self.y - obstacle.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 70) {
self.isHiding = true;
break;
}
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x191970
});
/****
* Game Code
****/
// Game variables
var player;
var moonstones = [];
var guards = [];
var obstacles = [];
var dragNode = null;
var moonstonesCollected = 0;
var totalMoonstones = 7;
// Create UI
var scoreText = new Text2('Moonstones: 0/7', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
var transformationText = new Text2('Human Child', {
size: 50,
fill: 0xE6E6FA
});
transformationText.anchor.set(0.5, 0);
transformationText.y = 80;
LK.gui.top.addChild(transformationText);
// Create player
player = game.addChild(new Player());
player.x = 1024;
player.y = 1366;
// Generate obstacles for hiding
for (var i = 0; i < 15; i++) {
var obstacle = game.addChild(new Obstacle(Math.random() > 0.5 ? 'tree' : 'rock'));
obstacle.x = 200 + Math.random() * 1648;
obstacle.y = 200 + Math.random() * 2332;
obstacles.push(obstacle);
}
// Generate moonstones
for (var i = 0; i < totalMoonstones; i++) {
var moonstone = game.addChild(new Moonstone());
moonstone.x = 150 + Math.random() * 1748;
moonstone.y = 150 + Math.random() * 2432;
moonstones.push(moonstone);
}
// Generate guards
for (var i = 0; i < 4; i++) {
var guard = game.addChild(new Guard());
guard.x = 300 + Math.random() * 1448;
guard.y = 300 + Math.random() * 2132;
guards.push(guard);
}
function updateTransformationUI() {
var transformationNames = ['Human Child', 'Growing Tail', 'Wolf Ears', 'Sharp Claws', 'Wolf Paws', 'Wolf Snout', 'Growing Fur', 'Full Werewolf'];
transformationText.setText(transformationNames[player.transformationLevel] || 'Full Werewolf');
}
function handleMove(x, y, obj) {
if (dragNode) {
dragNode.x = x;
dragNode.y = y;
// Keep player within bounds
if (dragNode.x < 40) dragNode.x = 40;
if (dragNode.x > 2008) dragNode.x = 2008;
if (dragNode.y < 40) dragNode.y = 40;
if (dragNode.y > 2692) dragNode.y = 2692;
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
dragNode = player;
handleMove(x, y, obj);
};
game.up = function (x, y, obj) {
dragNode = null;
};
game.update = function () {
// Update player hiding status
player.checkHiding();
// Check moonstone collection
for (var i = moonstones.length - 1; i >= 0; i--) {
var moonstone = moonstones[i];
if (player.intersects(moonstone)) {
moonstone.destroy();
moonstones.splice(i, 1);
moonstonesCollected++;
LK.getSound('collect').play();
LK.setScore(moonstonesCollected);
scoreText.setText('Moonstones: ' + moonstonesCollected + '/' + totalMoonstones);
// Transform player
player.transform();
updateTransformationUI();
// Check win condition
if (moonstonesCollected >= totalMoonstones) {
LK.showYouWin();
return;
}
// Add more guards as player transforms
if (moonstonesCollected % 2 == 0 && guards.length < 8) {
var newGuard = game.addChild(new Guard());
newGuard.x = 100 + Math.random() * 1848;
newGuard.y = 100 + Math.random() * 2532;
guards.push(newGuard);
}
}
}
// Check guard capture
for (var g = 0; g < guards.length; g++) {
var guard = guards[g];
if (player.intersects(guard)) {
LK.getSound('caught').play();
LK.effects.flashScreen(0xFF0000, 1000);
LK.showGameOver();
return;
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,260 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Guard = Container.expand(function () {
+ var self = Container.call(this);
+ self.patrolSpeed = 1.5;
+ self.alertSpeed = 4;
+ self.detectionRadius = 150;
+ self.isAlerted = false;
+ self.patrolDirection = Math.random() * Math.PI * 2;
+ self.patrolTimer = 0;
+ var guardGraphics = self.attachAsset('guard', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ self.patrolTimer++;
+ // Check if player is in detection range and not hiding
+ var dx = player.x - self.x;
+ var dy = player.y - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance < self.detectionRadius + player.detectionRadius && !player.isHiding) {
+ self.isAlerted = true;
+ guardGraphics.tint = 0xFF4444;
+ } else {
+ self.isAlerted = false;
+ guardGraphics.tint = 0xFFFFFF;
+ }
+ if (self.isAlerted) {
+ // Chase player
+ var angle = Math.atan2(dy, dx);
+ self.x += Math.cos(angle) * self.alertSpeed;
+ self.y += Math.sin(angle) * self.alertSpeed;
+ } else {
+ // Patrol behavior
+ if (self.patrolTimer % 120 == 0) {
+ self.patrolDirection = Math.random() * Math.PI * 2;
+ }
+ self.x += Math.cos(self.patrolDirection) * self.patrolSpeed;
+ self.y += Math.sin(self.patrolDirection) * self.patrolSpeed;
+ // Keep guards within bounds
+ if (self.x < 100) {
+ self.x = 100;
+ self.patrolDirection = Math.random() * Math.PI;
+ }
+ if (self.x > 1948) {
+ self.x = 1948;
+ self.patrolDirection = Math.PI + Math.random() * Math.PI;
+ }
+ if (self.y < 100) {
+ self.y = 100;
+ self.patrolDirection = Math.PI * 0.5 + Math.random() * Math.PI;
+ }
+ if (self.y > 2632) {
+ self.y = 2632;
+ self.patrolDirection = Math.PI * 1.5 + Math.random() * Math.PI;
+ }
+ }
+ };
+ return self;
+});
+var Moonstone = Container.expand(function () {
+ var self = Container.call(this);
+ var moonstoneGraphics = self.attachAsset('moonstone', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // Gentle glow animation
+ moonstoneGraphics.alpha = 0.7 + Math.sin(LK.ticks * 0.1) * 0.3;
+ moonstoneGraphics.rotation += 0.02;
+ };
+ return self;
+});
+var Obstacle = Container.expand(function (assetType) {
+ var self = Container.call(this);
+ var obstacleGraphics = self.attachAsset(assetType, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ return self;
+});
+var Player = Container.expand(function () {
+ var self = Container.call(this);
+ self.transformationLevel = 0;
+ self.speed = 3;
+ self.isHiding = false;
+ self.detectionRadius = 120;
+ var playerGraphics = self.attachAsset('child', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.transform = function () {
+ self.transformationLevel++;
+ // Update appearance based on transformation level
+ if (self.transformationLevel >= 7) {
+ // Full werewolf
+ self.removeChild(playerGraphics);
+ playerGraphics = self.attachAsset('werewolf', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 8;
+ self.detectionRadius = 80;
+ } else {
+ // Intermediate transformations - gradually change color and size
+ var tintValue = 0xFFB366 - self.transformationLevel * 0x1A1A1A;
+ playerGraphics.tint = tintValue;
+ var scaleIncrease = 1 + self.transformationLevel * 0.1;
+ playerGraphics.scaleX = scaleIncrease;
+ playerGraphics.scaleY = scaleIncrease;
+ self.speed = 3 + self.transformationLevel * 0.7;
+ self.detectionRadius = 120 - self.transformationLevel * 5;
+ }
+ LK.getSound('transformation').play();
+ LK.effects.flashObject(self, 0xE6E6FA, 1000);
+ };
+ self.checkHiding = function () {
+ self.isHiding = false;
+ // Check if player is behind any obstacle
+ for (var i = 0; i < obstacles.length; i++) {
+ var obstacle = obstacles[i];
+ var dx = self.x - obstacle.x;
+ var dy = self.y - obstacle.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance < 70) {
+ self.isHiding = true;
+ break;
+ }
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x191970
+});
+
+/****
+* Game Code
+****/
+// Game variables
+var player;
+var moonstones = [];
+var guards = [];
+var obstacles = [];
+var dragNode = null;
+var moonstonesCollected = 0;
+var totalMoonstones = 7;
+// Create UI
+var scoreText = new Text2('Moonstones: 0/7', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+scoreText.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreText);
+var transformationText = new Text2('Human Child', {
+ size: 50,
+ fill: 0xE6E6FA
+});
+transformationText.anchor.set(0.5, 0);
+transformationText.y = 80;
+LK.gui.top.addChild(transformationText);
+// Create player
+player = game.addChild(new Player());
+player.x = 1024;
+player.y = 1366;
+// Generate obstacles for hiding
+for (var i = 0; i < 15; i++) {
+ var obstacle = game.addChild(new Obstacle(Math.random() > 0.5 ? 'tree' : 'rock'));
+ obstacle.x = 200 + Math.random() * 1648;
+ obstacle.y = 200 + Math.random() * 2332;
+ obstacles.push(obstacle);
+}
+// Generate moonstones
+for (var i = 0; i < totalMoonstones; i++) {
+ var moonstone = game.addChild(new Moonstone());
+ moonstone.x = 150 + Math.random() * 1748;
+ moonstone.y = 150 + Math.random() * 2432;
+ moonstones.push(moonstone);
+}
+// Generate guards
+for (var i = 0; i < 4; i++) {
+ var guard = game.addChild(new Guard());
+ guard.x = 300 + Math.random() * 1448;
+ guard.y = 300 + Math.random() * 2132;
+ guards.push(guard);
+}
+function updateTransformationUI() {
+ var transformationNames = ['Human Child', 'Growing Tail', 'Wolf Ears', 'Sharp Claws', 'Wolf Paws', 'Wolf Snout', 'Growing Fur', 'Full Werewolf'];
+ transformationText.setText(transformationNames[player.transformationLevel] || 'Full Werewolf');
+}
+function handleMove(x, y, obj) {
+ if (dragNode) {
+ dragNode.x = x;
+ dragNode.y = y;
+ // Keep player within bounds
+ if (dragNode.x < 40) dragNode.x = 40;
+ if (dragNode.x > 2008) dragNode.x = 2008;
+ if (dragNode.y < 40) dragNode.y = 40;
+ if (dragNode.y > 2692) dragNode.y = 2692;
+ }
+}
+game.move = handleMove;
+game.down = function (x, y, obj) {
+ dragNode = player;
+ handleMove(x, y, obj);
+};
+game.up = function (x, y, obj) {
+ dragNode = null;
+};
+game.update = function () {
+ // Update player hiding status
+ player.checkHiding();
+ // Check moonstone collection
+ for (var i = moonstones.length - 1; i >= 0; i--) {
+ var moonstone = moonstones[i];
+ if (player.intersects(moonstone)) {
+ moonstone.destroy();
+ moonstones.splice(i, 1);
+ moonstonesCollected++;
+ LK.getSound('collect').play();
+ LK.setScore(moonstonesCollected);
+ scoreText.setText('Moonstones: ' + moonstonesCollected + '/' + totalMoonstones);
+ // Transform player
+ player.transform();
+ updateTransformationUI();
+ // Check win condition
+ if (moonstonesCollected >= totalMoonstones) {
+ LK.showYouWin();
+ return;
+ }
+ // Add more guards as player transforms
+ if (moonstonesCollected % 2 == 0 && guards.length < 8) {
+ var newGuard = game.addChild(new Guard());
+ newGuard.x = 100 + Math.random() * 1848;
+ newGuard.y = 100 + Math.random() * 2532;
+ guards.push(newGuard);
+ }
+ }
+ }
+ // Check guard capture
+ for (var g = 0; g < guards.length; g++) {
+ var guard = guards[g];
+ if (player.intersects(guard)) {
+ LK.getSound('caught').play();
+ LK.effects.flashScreen(0xFF0000, 1000);
+ LK.showGameOver();
+ return;
+ }
+ }
+};
\ No newline at end of file
Pixel art de árbol pero de noche. In-Game asset. 2d. High contrast. No shadows
Piedra lunar brillante pixelart. In-Game asset. 2d. High contrast. No shadows
Guardia completamente negro con linterna iluminando con un circulo de aura pixelart. In-Game asset. 2d. High contrast. No shadows
Cesped oscuro de noche pixel art. In-Game asset. 2d. High contrast. No shadows
Niño pero de noche pixelart. In-Game asset. 2d. High contrast. No shadows
Cola de lobo, pixelart
Garras de lobo, pixelart
Nariz de lobo, pixel art
Silueta corriendo
Jaula de metal oscura , pixel art. In-Game asset. 2d. High contrast. No shadows
Transformalo en un gatito
Elimina los cristales y agrega árboles , estilo pixelart
Ahora que el perro esté ladrando
Silueta de perro corriendo
Corriendo
Corriendo pixelart
Gatito corriendo pixelart
Corriendo , pixelart
Corriendo, pixelart
Corriendo, pixelart
Corriendo, pixelart
Quítale la camisa, aslo más grande y peludo, que este en cuatro patas , pixelart