User prompt
elimizde silah olsun ve mermisi düzgün gitsin ve claim zoneleri 2 kere sıkınca bizim olabilsin uzaktan sıkabilelim mermi sonsuza kadar gitsin sağ altta mermisi yazsın 7 şarjörü olsun köpek öldürünce 2 şarjör çıksın
User prompt
köpek bizi takip etmiyor düz gidip duruyor bizi full takip etsin kovalasın ve bizi yakalayınca 3 saniye gerisayım başlasın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
köpekte her 10 saniyede bir gelsin ve bizden hızlı gitsin
User prompt
0.5 saniyede bir sarı şeyden çıksın o power up 10 saniyede bir çıksın ve hızlandırması 5 saniye sürsün veuzaktan karakterimizin uzağında doğan köpek çıksın 1 tane her 35 saniyede o köpek karakterimize saldırsın ve saldırınca karakterimiz hemewn ölmesin bir sahne çıksın ekrana hızlıca dokun desin dokununca bizi bıraksın sanki kolumuzdan tutmuşta elimizi sallıyormusuz gibi ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
you win final score değilde record = saniyesi yazsın yukarıda territory : yazan yerde territory = 15 WİN yazsın ve herşeyin hitboxu büyüsün
User prompt
o sarı şeyden claim yazan şeyden her 3 saniyede bir çıksın
User prompt
power uplar en fazla 2 tane çıksın ve claim yazan sarı daireler alınca gitsin o seffaklık kalmasın ve ondan en fazla 5 tane çıksın ve oyunda süre olsun kronometre yukarda olsun ve oyun bitince rekorunun süresi yazsın ve o sarı şeyden 15 tane alınca bitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
o power up tan yavaş yavaş her 5 saniyede 1 tane çıksın
User prompt
fikrimi değiştirdim o araba değil power up olsun hız versin deyince ve alınca gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
1 tane araba doğsun rastgele bir yerde o arabaya binince hızımız artsın
User prompt
claim olan yuvarlaklar az sayıda oluşsun
Code edit (1 edits merged)
Please save this source code
User prompt
biraz daha büyüsün ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
claim yazıları okunacak gibi olsun büyüsün ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Initial prompt
Please save this source code
/**** * Classes ****/ var Character = Container.expand(function () { var self = Container.call(this); var characterGraphics = self.attachAsset('character', { anchorX: 0.5, anchorY: 0.5 }); self.targetX = 0; self.targetY = 0; self.moveSpeed = 8; self.update = function () { var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 5) { var moveX = dx / distance * self.moveSpeed; var moveY = dy / distance * self.moveSpeed; var newX = self.x + moveX; var newY = self.y + moveY; // Keep character within bounds (accounting for character size) if (newX >= 90 && newX <= 1958 && newY >= 90 && newY <= 2642) { self.x = newX; self.y = newY; } } }; self.setTarget = function (x, y) { self.targetX = x; self.targetY = y; }; return self; }); var ClaimZone = Container.expand(function () { var self = Container.call(this); var zoneGraphics = self.attachAsset('claimZone', { anchorX: 0.5, anchorY: 0.5 }); var claimText = new Text2('CLAIM', { size: 24, fill: '#FFFFFF' }); claimText.anchor.set(0.5, 1); claimText.y = -40; self.addChild(claimText); self.isClaimed = false; self.claim = function () { if (!self.isClaimed) { self.isClaimed = true; self.removeChild(zoneGraphics); self.removeChild(claimText); var claimedGraphics = self.attachAsset('claimedZone', { anchorX: 0.5, anchorY: 0.5 }); var claimedText = new Text2('CLAIMED', { size: 20, fill: '#FFFFFF' }); claimedText.anchor.set(0.5, 1); claimedText.y = -40; self.addChild(claimedText); return true; } return false; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2E8B57 }); /**** * Game Code ****/ var character = new Character(); character.x = 1024; character.y = 1366; game.addChild(character); var claimZones = []; var totalZones = 15; // Create walls around the perimeter var walls = []; // Top wall for (var i = 0; i < 42; i++) { var topWall = LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, x: i * 50 + 25, y: 25 }); game.addChild(topWall); walls.push(topWall); } // Bottom wall for (var i = 0; i < 42; i++) { var bottomWall = LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, x: i * 50 + 25, y: 2707 }); game.addChild(bottomWall); walls.push(bottomWall); } // Left wall for (var i = 1; i < 54; i++) { var leftWall = LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, x: 25, y: i * 50 + 25 }); game.addChild(leftWall); walls.push(leftWall); } // Right wall for (var i = 1; i < 54; i++) { var rightWall = LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, x: 2023, y: i * 50 + 25 }); game.addChild(rightWall); walls.push(rightWall); } // Create initial claim zones function createClaimZone() { var zone = new ClaimZone(); var validPosition = false; var attempts = 0; while (!validPosition && attempts < 50) { zone.x = 150 + Math.random() * 1748; zone.y = 150 + Math.random() * 2432; // Check distance from character var dx = zone.x - character.x; var dy = zone.y - character.y; var distanceFromCharacter = Math.sqrt(dx * dx + dy * dy); // Check distance from other zones var tooClose = false; for (var i = 0; i < claimZones.length; i++) { var otherZone = claimZones[i]; var zdx = zone.x - otherZone.x; var zdy = zone.y - otherZone.y; var distanceFromZone = Math.sqrt(zdx * zdx + zdy * zdy); if (distanceFromZone < 200) { tooClose = true; break; } } if (distanceFromCharacter > 150 && !tooClose) { validPosition = true; } attempts++; } return zone; } // Generate initial claim zones for (var i = 0; i < totalZones; i++) { var zone = createClaimZone(); claimZones.push(zone); game.addChild(zone); } // Score display var scoreTxt = new Text2('Territory: 0', { size: 60, fill: '#FFFFFF' }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Mouse/touch controls game.move = function (x, y, obj) { character.setTarget(x, y); }; game.down = function (x, y, obj) { character.setTarget(x, y); }; // Main game loop game.update = function () { // Check for zone claims for (var i = claimZones.length - 1; i >= 0; i--) { var zone = claimZones[i]; if (!zone.isClaimed) { var dx = character.x - zone.x; var dy = character.y - zone.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < 50) { if (zone.claim()) { LK.setScore(LK.getScore() + 1); scoreTxt.setText('Territory: ' + LK.getScore()); LK.getSound('claim').play(); // Create new zone to replace claimed one var newZone = createClaimZone(); claimZones.push(newZone); game.addChild(newZone); // Check win condition if (LK.getScore() >= 25) { LK.showYouWin(); } } } } } };
/****
* Classes
****/
var Character = Container.expand(function () {
var self = Container.call(this);
var characterGraphics = self.attachAsset('character', {
anchorX: 0.5,
anchorY: 0.5
});
self.targetX = 0;
self.targetY = 0;
self.moveSpeed = 8;
self.update = function () {
var dx = self.targetX - self.x;
var dy = self.targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 5) {
var moveX = dx / distance * self.moveSpeed;
var moveY = dy / distance * self.moveSpeed;
var newX = self.x + moveX;
var newY = self.y + moveY;
// Keep character within bounds (accounting for character size)
if (newX >= 90 && newX <= 1958 && newY >= 90 && newY <= 2642) {
self.x = newX;
self.y = newY;
}
}
};
self.setTarget = function (x, y) {
self.targetX = x;
self.targetY = y;
};
return self;
});
var ClaimZone = Container.expand(function () {
var self = Container.call(this);
var zoneGraphics = self.attachAsset('claimZone', {
anchorX: 0.5,
anchorY: 0.5
});
var claimText = new Text2('CLAIM', {
size: 24,
fill: '#FFFFFF'
});
claimText.anchor.set(0.5, 1);
claimText.y = -40;
self.addChild(claimText);
self.isClaimed = false;
self.claim = function () {
if (!self.isClaimed) {
self.isClaimed = true;
self.removeChild(zoneGraphics);
self.removeChild(claimText);
var claimedGraphics = self.attachAsset('claimedZone', {
anchorX: 0.5,
anchorY: 0.5
});
var claimedText = new Text2('CLAIMED', {
size: 20,
fill: '#FFFFFF'
});
claimedText.anchor.set(0.5, 1);
claimedText.y = -40;
self.addChild(claimedText);
return true;
}
return false;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2E8B57
});
/****
* Game Code
****/
var character = new Character();
character.x = 1024;
character.y = 1366;
game.addChild(character);
var claimZones = [];
var totalZones = 15;
// Create walls around the perimeter
var walls = [];
// Top wall
for (var i = 0; i < 42; i++) {
var topWall = LK.getAsset('wall', {
anchorX: 0.5,
anchorY: 0.5,
x: i * 50 + 25,
y: 25
});
game.addChild(topWall);
walls.push(topWall);
}
// Bottom wall
for (var i = 0; i < 42; i++) {
var bottomWall = LK.getAsset('wall', {
anchorX: 0.5,
anchorY: 0.5,
x: i * 50 + 25,
y: 2707
});
game.addChild(bottomWall);
walls.push(bottomWall);
}
// Left wall
for (var i = 1; i < 54; i++) {
var leftWall = LK.getAsset('wall', {
anchorX: 0.5,
anchorY: 0.5,
x: 25,
y: i * 50 + 25
});
game.addChild(leftWall);
walls.push(leftWall);
}
// Right wall
for (var i = 1; i < 54; i++) {
var rightWall = LK.getAsset('wall', {
anchorX: 0.5,
anchorY: 0.5,
x: 2023,
y: i * 50 + 25
});
game.addChild(rightWall);
walls.push(rightWall);
}
// Create initial claim zones
function createClaimZone() {
var zone = new ClaimZone();
var validPosition = false;
var attempts = 0;
while (!validPosition && attempts < 50) {
zone.x = 150 + Math.random() * 1748;
zone.y = 150 + Math.random() * 2432;
// Check distance from character
var dx = zone.x - character.x;
var dy = zone.y - character.y;
var distanceFromCharacter = Math.sqrt(dx * dx + dy * dy);
// Check distance from other zones
var tooClose = false;
for (var i = 0; i < claimZones.length; i++) {
var otherZone = claimZones[i];
var zdx = zone.x - otherZone.x;
var zdy = zone.y - otherZone.y;
var distanceFromZone = Math.sqrt(zdx * zdx + zdy * zdy);
if (distanceFromZone < 200) {
tooClose = true;
break;
}
}
if (distanceFromCharacter > 150 && !tooClose) {
validPosition = true;
}
attempts++;
}
return zone;
}
// Generate initial claim zones
for (var i = 0; i < totalZones; i++) {
var zone = createClaimZone();
claimZones.push(zone);
game.addChild(zone);
}
// Score display
var scoreTxt = new Text2('Territory: 0', {
size: 60,
fill: '#FFFFFF'
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Mouse/touch controls
game.move = function (x, y, obj) {
character.setTarget(x, y);
};
game.down = function (x, y, obj) {
character.setTarget(x, y);
};
// Main game loop
game.update = function () {
// Check for zone claims
for (var i = claimZones.length - 1; i >= 0; i--) {
var zone = claimZones[i];
if (!zone.isClaimed) {
var dx = character.x - zone.x;
var dy = character.y - zone.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 50) {
if (zone.claim()) {
LK.setScore(LK.getScore() + 1);
scoreTxt.setText('Territory: ' + LK.getScore());
LK.getSound('claim').play();
// Create new zone to replace claimed one
var newZone = createClaimZone();
claimZones.push(newZone);
game.addChild(newZone);
// Check win condition
if (LK.getScore() >= 25) {
LK.showYouWin();
}
}
}
}
}
};