User prompt
Add a Main Menu with scene when human jump into river and transform in Canadian Geese with Human Types and Canadian Geese super abilities! (and geese scenes with geese and 2D assets of humans and geese in Dialogs! ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fix all!
User prompt
Add a special fast geese mode and fix all errors! ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Error detected!
Code edit (1 edits merged)
Please save this source code
User prompt
Goose Invasion: The Great Migration
Initial prompt
Make a game with Canadian Geese as player (this is a infection game, goose infect humans into geese by Infected bite and Canadian Geese Transform (in start player is human)
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Goose = Container.expand(function () {
var self = Container.call(this);
var gooseGraphics = self.attachAsset('goose', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 3;
self.targetX = self.x;
self.targetY = self.y;
self.isLeader = false;
self.followTarget = null;
self.followDistance = 80;
self.update = function () {
if (self.isLeader) {
// Leader follows mouse/touch position
var dx = self.targetX - self.x;
var dy = self.targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 5) {
self.x += dx / distance * self.speed;
self.y += dy / distance * self.speed;
}
} else if (self.followTarget) {
// Follower geese maintain formation
var dx = self.followTarget.x - self.x;
var dy = self.followTarget.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > self.followDistance) {
self.x += dx / distance * self.speed;
self.y += dy / distance * self.speed;
}
}
};
return self;
});
var Human = Container.expand(function () {
var self = Container.call(this);
var humanGraphics = self.attachAsset('human', {
anchorX: 0.5,
anchorY: 0.5
});
self.isConverted = false;
self.wanderTimer = 0;
self.wanderDirection = Math.random() * Math.PI * 2;
self.speed = 1;
self.update = function () {
if (!self.isConverted) {
// Random wandering behavior
self.wanderTimer++;
if (self.wanderTimer > 120) {
// Change direction every 2 seconds
self.wanderDirection = Math.random() * Math.PI * 2;
self.wanderTimer = 0;
}
self.x += Math.cos(self.wanderDirection) * self.speed;
self.y += Math.sin(self.wanderDirection) * self.speed;
// Keep humans within bounds
if (self.x < 100) self.x = 100;
if (self.x > 1948) self.x = 1948;
if (self.y < 100) self.y = 100;
if (self.y > 2632) self.y = 2632;
}
};
self.convert = function () {
if (!self.isConverted) {
self.isConverted = true;
humanGraphics.tint = 0x808080; // Gray out converted human
tween(humanGraphics, {
alpha: 0
}, {
duration: 500
});
LK.getSound('convert').play();
return true;
}
return false;
};
return self;
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x4a5d23
});
/****
* Game Code
****/
var geese = [];
var humans = [];
var obstacles = [];
var leaderGoose = null;
var conversionRadius = 70;
var totalHumans = 20;
var convertedCount = 0;
// Create score display
var scoreText = new Text2('Flock Size: 1', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
// Create leader goose
leaderGoose = game.addChild(new Goose());
leaderGoose.x = 1024;
leaderGoose.y = 1366;
leaderGoose.isLeader = true;
geese.push(leaderGoose);
// Create humans scattered around the map
for (var i = 0; i < totalHumans; i++) {
var human = game.addChild(new Human());
human.x = 200 + Math.random() * 1648;
human.y = 200 + Math.random() * 2332;
humans.push(human);
}
;
// Create some obstacles
for (var i = 0; i < 8; i++) {
var obstacle = game.addChild(new Obstacle());
obstacle.x = 300 + Math.random() * 1448;
obstacle.y = 300 + Math.random() * 2132;
obstacles.push(obstacle);
}
function updateFlockFormation() {
// Update follower positions to maintain formation
for (var i = 1; i < geese.length; i++) {
var goose = geese[i];
var targetGoose = geese[i - 1];
goose.followTarget = targetGoose;
goose.followDistance = 60 + i * 10; // Increasing distance for formation
}
}
function checkConversions() {
for (var i = humans.length - 1; i >= 0; i--) {
var human = humans[i];
if (human.isConverted) continue;
// Check distance to any goose in the flock
for (var j = 0; j < geese.length; j++) {
var goose = geese[j];
var dx = human.x - goose.x;
var dy = human.y - goose.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < conversionRadius) {
if (human.convert()) {
convertedCount++;
// Create new goose at human position
var newGoose = game.addChild(new Goose());
newGoose.x = human.x;
newGoose.y = human.y;
geese.push(newGoose);
updateFlockFormation();
// Update score
scoreText.setText('Flock Size: ' + geese.length);
// Increase conversion radius slightly with flock size
conversionRadius = 70 + geese.length * 2;
// Play honk sound occasionally
if (Math.random() < 0.3) {
LK.getSound('honk').play();
}
// Check win condition
if (convertedCount >= totalHumans) {
LK.setTimeout(function () {
LK.showYouWin();
}, 1000);
}
break;
}
}
}
}
}
// Touch/mouse controls
game.move = function (x, y, obj) {
if (leaderGoose) {
leaderGoose.targetX = x;
leaderGoose.targetY = y;
}
};
game.down = function (x, y, obj) {
if (leaderGoose) {
leaderGoose.targetX = x;
leaderGoose.targetY = y;
}
};
game.update = function () {
checkConversions();
// Clean up fully faded humans
for (var i = humans.length - 1; i >= 0; i--) {
var human = humans[i];
if (human.isConverted && human.alpha <= 0) {
human.destroy();
humans.splice(i, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -130,8 +130,9 @@
human.x = 200 + Math.random() * 1648;
human.y = 200 + Math.random() * 2332;
humans.push(human);
}
+;
// Create some obstacles
for (var i = 0; i < 8; i++) {
var obstacle = game.addChild(new Obstacle());
obstacle.x = 300 + Math.random() * 1448;
a Canadian Goose no text on image!
water texture in full image. In-Game asset. 2d. High contrast. No shadows
Box. In-Game asset. 2d. High contrast. No shadows
Canadian Geese Style Menu button. In-Game asset. 2d. High contrast. No shadows no text on image!. In-Game asset. 2d. High contrast. No shadows
dialog box button with canadian geese style no text on image!. In-Game asset. 2d. High contrast. No shadows
human. In-Game asset. 2d. High contrast. No shadows