User prompt
Bu kutular kare olsun ve onların görüntüsü ayı kapanına benzesin
User prompt
Etrafta rastgele 5 adet gri kutu koy. Eyer karakterimiz onun üzerine gelirse oyun bitsin
User prompt
Oyunda oyunu bilmeyenler için üzerinde soru işareti olan bir simge olsun (Bu simge sadece oyun başlamadan önce gözükür oyna tuşuna bastıktan sonra kaybolur). Açılan yerde bir bilgilendirici metin yazsın. Metin şu: Oyunda bir kurabiye fabrikasının bahçesindesin. Bahçede canlı olan kurabiyeleri yakala ve kazan. Dikkat! Tuzaklara yakalanma.
User prompt
Oyuna başlarken kurabiye toplama yerine "Kurabiye Hırsızı" yazsın
User prompt
Oyuna başlamadan önce bir başlangıç ekranı olsun. Orada "Oyna" isimli tuşa basarak oyunumuz başlasın
User prompt
Topladığımız bu kurabiyeler daha çok sağ veya solda doğsun. Ayrıca kurabiyeler çok düşük bir hızla karakterimizden kaçsınlar
User prompt
Etrafta 10 adet kurabiye olsun bunları topladığımızda oyunu kazanalım ve oyun bitsin
User prompt
Arka plan açık yeşil renkli olsun
User prompt
Bana arka plana dik ve ortalanmış bir yol çiz
Code edit (2 edits merged)
Please save this source code
User prompt
Arka plana şehir yolları ekle
User prompt
Kutunun hareket hızını düşür
User prompt
Bana sadece bir hiçlikte faremiz ile hareket eden bir kutu yap
Code edit (1 edits merged)
Please save this source code
User prompt
Kutu Kaçışı
Initial prompt
Bana w, a, s ve d tuşlarıyla haraket eden bir kutu oyunu yap
/**** * Classes ****/ // Cookie collectible var Cookie = Container.expand(function () { var self = Container.call(this); var cookieAsset = self.attachAsset('cookie', { anchorX: 0.5, anchorY: 0.5 }); // Track last intersecting state for collision detection self.lastWasIntersecting = false; return self; }); // Player-controlled box var PlayerBox = Container.expand(function () { var self = Container.call(this); var box = self.attachAsset('playerBox', { anchorX: 0.5, anchorY: 0.5 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xc8f7c5 }); /**** * Game Code ****/ // --- START SCREEN LOGIC --- var gameStarted = false; var startScreen = new Container(); var startBg = LK.getAsset('verticalRoad', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, width: 2048, height: 2732 }); startBg.alpha = 0.12; startScreen.addChild(startBg); var titleText = new Text2("Kurabiye Hırsızı", { size: 120, fill: 0x2D2D2D }); titleText.anchor.set(0.5, 0.5); titleText.x = 2048 / 2; titleText.y = 900; startScreen.addChild(titleText); var playButton = new Container(); var btnBg = LK.getAsset('verticalRoad', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 500, height: 180 }); btnBg.tint = 0x83de44; playButton.addChild(btnBg); var btnText = new Text2("Oyna", { size: 90, fill: 0xFFFFFF }); btnText.anchor.set(0.5, 0.5); btnText.x = 0; btnText.y = 0; playButton.addChild(btnText); playButton.x = 2048 / 2; playButton.y = 1400; startScreen.addChild(playButton); // --- HELP ICON AND POPUP --- var helpIcon = new Container(); var helpBg = LK.getAsset('verticalRoad', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 120, height: 120 }); helpBg.tint = 0x83de44; helpIcon.addChild(helpBg); var helpText = new Text2("?", { size: 90, fill: 0xffffff }); helpText.anchor.set(0.5, 0.5); helpText.x = 0; helpText.y = 0; helpIcon.addChild(helpText); helpIcon.x = 2048 - 120 - 40; // Top right, with margin helpIcon.y = 120 + 40; helpIcon.interactive = true; startScreen.addChild(helpIcon); // Help popup (hidden by default) var helpPopup = new Container(); var popupBg = LK.getAsset('verticalRoad', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 1200, height: 600 }); popupBg.tint = 0xffffff; popupBg.alpha = 0.98; helpPopup.addChild(popupBg); var popupText = new Text2("Oyunda bir kurabiye fabrikasının bahçesindesin. Bahçede canlı olan kurabiyeleri yakala ve kazan. Dikkat! Tuzaklara yakalanma.", { size: 60, fill: 0x2D2D2D, align: "center", wordWrap: true, wordWrapWidth: 1100 }); popupText.anchor.set(0.5, 0.5); popupText.x = 0; popupText.y = -40; helpPopup.addChild(popupText); // Close button var closeBtn = new Container(); var closeBg = LK.getAsset('verticalRoad', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 200, height: 90 }); closeBg.tint = 0x83de44; closeBtn.addChild(closeBg); var closeTxt = new Text2("Kapat", { size: 50, fill: 0xffffff }); closeTxt.anchor.set(0.5, 0.5); closeTxt.x = 0; closeTxt.y = 0; closeBtn.addChild(closeTxt); closeBtn.x = 0; closeBtn.y = 220; closeBtn.interactive = true; helpPopup.addChild(closeBtn); helpPopup.x = 2048 / 2; helpPopup.y = 2732 / 2; helpPopup.visible = false; startScreen.addChild(helpPopup); // Show popup on help icon tap helpIcon.down = function (x, y, obj) { helpPopup.visible = true; helpIcon.visible = false; }; // Hide popup on close closeBtn.down = function (x, y, obj) { helpPopup.visible = false; helpIcon.visible = true; }; game.addChild(startScreen); // Only allow game logic after start function startGame() { if (gameStarted) return; gameStarted = true; // Hide help icon and popup if present if (typeof helpIcon !== "undefined") helpIcon.visible = false; if (typeof helpPopup !== "undefined") helpPopup.visible = false; startScreen.destroy(); // Now run the rest of the game setup setupGame(); } // Touch/click on play button playButton.down = function (x, y, obj) { startGame(); }; playButton.interactive = true; // --- GAME LOGIC MOVED TO FUNCTION --- function setupGame() { // Add a centered, vertical road as background var roadWidth = 500; var roadHeight = 2732; var verticalRoadBg = LK.getAsset('verticalRoad', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(verticalRoadBg); // Player box player = new PlayerBox(); game.addChild(player); // Center player in the middle of the screen player.x = 2048 / 2; player.y = 2732 / 2; // Add 10 cookies at random positions (not overlapping player or outside road) cookies = []; var cookieCount = 10; for (var i = 0; i < cookieCount; i++) { var cookie = new Cookie(); // Place cookies within the road area, not overlapping player var placed = false; while (!placed) { // Road is centered, width = 500, height = 2732 var minX = 2048 / 2 - 250 + cookie.width / 2 + 20; var maxX = 2048 / 2 + 250 - cookie.width / 2 - 20; var minY = cookie.height / 2 + 40; var maxY = 2732 - cookie.height / 2 - 40; // Bias: 70% chance to spawn near left or right edge, 30% random var edgeBias = Math.random(); if (edgeBias < 0.35) { // Left edge: 0-20% of road width var edgeMinX = minX; var edgeMaxX = minX + (maxX - minX) * 0.2; cookie.x = Math.floor(Math.random() * (edgeMaxX - edgeMinX)) + edgeMinX; } else if (edgeBias < 0.7) { // Right edge: 80-100% of road width var edgeMinX = maxX - (maxX - minX) * 0.2; var edgeMaxX = maxX; cookie.x = Math.floor(Math.random() * (edgeMaxX - edgeMinX)) + edgeMinX; } else { // Anywhere on the road cookie.x = Math.floor(Math.random() * (maxX - minX)) + minX; } cookie.y = Math.floor(Math.random() * (maxY - minY)) + minY; // Avoid placing on player var dx = cookie.x - player.x; var dy = cookie.y - player.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist > 200) { placed = true; } } cookies.push(cookie); game.addChild(cookie); } } // Dragging logic var dragNode = null; var offsetX = 0; var offsetY = 0; // Helper: clamp value between min and max function clamp(val, min, max) { if (val < min) { return min; } if (val > max) { return max; } return val; } // Touch/mouse down: start dragging if on player game.down = function (x, y, obj) { if (!gameStarted) return; // Check if touch is inside player box var dx = x - player.x; var dy = y - player.y; var halfW = player.children[0].width / 2; var halfH = player.children[0].height / 2; if (dx >= -halfW && dx <= halfW && dy >= -halfH && dy <= halfH) { dragNode = player; offsetX = player.x - x; offsetY = player.y - y; } }; // Touch/mouse up: stop dragging game.up = function (x, y, obj) { if (!gameStarted) return; dragNode = null; }; // Touch/mouse move: move player if dragging game.move = function (x, y, obj) { if (!gameStarted) return; if (dragNode === player) { // Clamp player inside game area (leave 10px margin) var halfW = player.children[0].width / 2; var halfH = player.children[0].height / 2; var targetX = clamp(x + offsetX, halfW + 10, 2048 - halfW - 10); var targetY = clamp(y + offsetY, halfH + 10, 2732 - halfH - 10); // Move slowly towards the target position (lower lerp factor = slower) var lerpFactor = 0.15; player.x = player.x + (targetX - player.x) * lerpFactor; player.y = player.y + (targetY - player.y) * lerpFactor; } }; // Main game update loop game.update = function () { if (!gameStarted) return; // Check for cookie collection var collected = 0; for (var i = cookies.length - 1; i >= 0; i--) { var cookie = cookies[i]; // Only check if not already collected (cookie still in game) if (cookie.parent && !cookie.collected) { // Cookie movement: move slowly away from player var dx = cookie.x - player.x; var dy = cookie.y - player.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist > 1) { // Normalize direction var moveSpeed = 1.2; // very slow var moveX = dx / dist * moveSpeed; var moveY = dy / dist * moveSpeed; cookie.x += moveX; cookie.y += moveY; // Clamp inside road area var minX = 2048 / 2 - 250 + cookie.width / 2 + 20; var maxX = 2048 / 2 + 250 - cookie.width / 2 - 20; var minY = cookie.height / 2 + 40; var maxY = 2732 - cookie.height / 2 - 40; cookie.x = clamp(cookie.x, minX, maxX); cookie.y = clamp(cookie.y, minY, maxY); } var isIntersecting = player.intersects(cookie); if (!cookie.lastWasIntersecting && isIntersecting) { // Collect cookie cookie.collected = true; cookie.destroy(); cookies.splice(i, 1); } cookie.lastWasIntersecting = isIntersecting; } } // Win if all cookies collected if (cookies.length === 0) { LK.showYouWin(); } };
===================================================================
--- original.js
+++ change.js
@@ -74,13 +74,102 @@
playButton.addChild(btnText);
playButton.x = 2048 / 2;
playButton.y = 1400;
startScreen.addChild(playButton);
+// --- HELP ICON AND POPUP ---
+var helpIcon = new Container();
+var helpBg = LK.getAsset('verticalRoad', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 0,
+ y: 0,
+ width: 120,
+ height: 120
+});
+helpBg.tint = 0x83de44;
+helpIcon.addChild(helpBg);
+var helpText = new Text2("?", {
+ size: 90,
+ fill: 0xffffff
+});
+helpText.anchor.set(0.5, 0.5);
+helpText.x = 0;
+helpText.y = 0;
+helpIcon.addChild(helpText);
+helpIcon.x = 2048 - 120 - 40; // Top right, with margin
+helpIcon.y = 120 + 40;
+helpIcon.interactive = true;
+startScreen.addChild(helpIcon);
+// Help popup (hidden by default)
+var helpPopup = new Container();
+var popupBg = LK.getAsset('verticalRoad', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 0,
+ y: 0,
+ width: 1200,
+ height: 600
+});
+popupBg.tint = 0xffffff;
+popupBg.alpha = 0.98;
+helpPopup.addChild(popupBg);
+var popupText = new Text2("Oyunda bir kurabiye fabrikasının bahçesindesin. Bahçede canlı olan kurabiyeleri yakala ve kazan. Dikkat! Tuzaklara yakalanma.", {
+ size: 60,
+ fill: 0x2D2D2D,
+ align: "center",
+ wordWrap: true,
+ wordWrapWidth: 1100
+});
+popupText.anchor.set(0.5, 0.5);
+popupText.x = 0;
+popupText.y = -40;
+helpPopup.addChild(popupText);
+// Close button
+var closeBtn = new Container();
+var closeBg = LK.getAsset('verticalRoad', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 0,
+ y: 0,
+ width: 200,
+ height: 90
+});
+closeBg.tint = 0x83de44;
+closeBtn.addChild(closeBg);
+var closeTxt = new Text2("Kapat", {
+ size: 50,
+ fill: 0xffffff
+});
+closeTxt.anchor.set(0.5, 0.5);
+closeTxt.x = 0;
+closeTxt.y = 0;
+closeBtn.addChild(closeTxt);
+closeBtn.x = 0;
+closeBtn.y = 220;
+closeBtn.interactive = true;
+helpPopup.addChild(closeBtn);
+helpPopup.x = 2048 / 2;
+helpPopup.y = 2732 / 2;
+helpPopup.visible = false;
+startScreen.addChild(helpPopup);
+// Show popup on help icon tap
+helpIcon.down = function (x, y, obj) {
+ helpPopup.visible = true;
+ helpIcon.visible = false;
+};
+// Hide popup on close
+closeBtn.down = function (x, y, obj) {
+ helpPopup.visible = false;
+ helpIcon.visible = true;
+};
game.addChild(startScreen);
// Only allow game logic after start
function startGame() {
if (gameStarted) return;
gameStarted = true;
+ // Hide help icon and popup if present
+ if (typeof helpIcon !== "undefined") helpIcon.visible = false;
+ if (typeof helpPopup !== "undefined") helpPopup.visible = false;
startScreen.destroy();
// Now run the rest of the game setup
setupGame();
}
Bana biraz sinsi gülüş atan, siyah şapkası ve giysisi olan bir kurabiye çiz (Asil dursun) .. In-Game asset. 2d. High contrast. No shadows
Bana tatlı üzerinde bir yüz olan kurabiye çiz. In-Game asset. 2d. High contrast. No shadows
Bana demirden yapılmış paslı bir ayı kapanı yap . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat