User prompt
Move market close button 10 pixels up
User prompt
market ekranındaki market ismi textini %10 büyüt ve 30 pixel yukarı al, marketin kapatma butonunu da 20 pixel yukarı al
User prompt
bu göstergeyi sayısıyla birlikte 2 kat büyüt
User prompt
tamam %100 büyütmeyi dene sadece sayının boyutunu ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
gold text büyümedi 60 pixel sağa götür ve %70 büyüt ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
altın sayımızı da 30 pixel sola 15 pixel aşşağı getir ve %75 büyüt ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
40 pixel sağa getir altın göstergesini ve %70 büyüt ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
altın göstergesi ekle üst sol kısma birazcık ortaya yakın sol.gold texturesi yanında kalan altınımız yazsın oyun 100 altınla başlar
User prompt
Sacred Grove (map 11) den Coastal Cliffs (map 9) e geçerken ışınlanma hedef noktasını en yakın 3. yol noktası olsun
User prompt
sen coastal cliffs den sacred coastal cliffs ge geçişi değiştirdin onu eski haline getir ve sacred grove den corastal cliffs e geçince ki ısınlanma target ı biraz daha şehirden ve geçitten uzakta bi noktaya koy
User prompt
sacred grove den corastal cliffs e geçince ki ısınlanma target ı biraz daha şehirden ve geçitten uzakta bi noktaya koy
User prompt
olmadı 100 pixel daha sağa kaydır
User prompt
şimdide aynı noktayı 30 pixel sağa kaydır
User prompt
sacred grove den corastal cliffs e geçince ki ısınlanna şehre çok yakın olmuş o noktayı 40 pixel yukarı al
User prompt
market ui açıkken hareket edemeyiz
User prompt
aynı geçidi 15 pixel daha aşşağı getir
User prompt
mountain pass daki sağdaki geçidin yerini 5 pixel sola ve 45 pixel aşşağı getir
User prompt
mountain pass daki sağdaki kapıyı 5 pixel sağa ve 45 pixel aşşağı kaydır
User prompt
market uı larındaki yazıları %20 küçült ve 30 pixel yukarı taşı
User prompt
butonla market ui ı 400 pixel yukarı taşı
Code edit (1 edits merged)
Please save this source code
User prompt
x butonunu 500 pixel aşşağı 200 pixel sağa getir
User prompt
market uı ı 1000 pixel sola ve 1000 pixel yukarı taşı
User prompt
citytrade ve xbuton texturlerini market uı a ata ve texture boyutlarını dikkate alarak ekranın ortasına yerleştir market uı ı
User prompt
şehirlere geldiğimde açılacak büyük bir şehir pazarı ekranı açılsın istiyorum sol üst köşesinde kapatma butonu olacak. ama şehre bi kere değdiğimde bi daha açılmasın tekrar şehirden biraz uzaklaşıp tekrar şehre geldiğimde açılsın ekran yoksa bug olabilir. şidilik sadece üst ortada şehrin adı yazsın şehir kimlikleme önemli
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var CenterMarker = Container.expand(function () { var self = Container.call(this); var markerGraphics = self.attachAsset('centerMarker', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Character = Container.expand(function () { var self = Container.call(this); var characterGraphics = self.attachAsset('character', { anchorX: 0.5, anchorY: 0.5 }); self.isMoving = false; self.targetX = 0; self.targetY = 0; self.speed = 3; self.lastX = 0; // Track last X position for direction detection self.moveTo = function (x, y) { self.targetX = x; self.targetY = y; self.isMoving = true; }; self.update = function () { if (self.isMoving) { var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < self.speed) { self.x = self.targetX; self.y = self.targetY; self.isMoving = false; } else { // Store current X before updating var currentX = self.x; self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; // Check direction change and flip character accordingly if (self.x > currentX) { // Moving right - face right (normal) characterGraphics.scale.x = Math.abs(characterGraphics.scale.x); } else if (self.x < currentX) { // Moving left - face left (flipped) characterGraphics.scale.x = -Math.abs(characterGraphics.scale.x); } } } }; return self; }); var City = Container.expand(function () { var self = Container.call(this); var cityGraphics = self.attachAsset('city', { anchorX: 0.5, anchorY: 0.5 }); cityGraphics.y = -60; // Move graphics up by 60 pixels return self; }); var Mountain = Container.expand(function () { var self = Container.call(this); var mountainGraphics = self.attachAsset('mountain', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Passage = Container.expand(function () { var self = Container.call(this); var passageGraphics = self.attachAsset('passage', { anchorX: 0.5, anchorY: 0.5 }); self.targetMap = 0; self.targetX = 0; self.targetY = 0; return self; }); var Road = Container.expand(function () { var self = Container.call(this); var roadGraphics = self.attachAsset('road', { anchorX: 0.5, anchorY: 0.5 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x228b22 }); /**** * Game Code ****/ var currentMap = storage.currentMap || 0; var character = game.addChild(new Character()); var roads = []; var mountains = []; var passages = []; var centerMarker = null; var city = null; // Gold system variables var playerGold = storage.playerGold || 100; var goldIcon = null; var goldText = null; // Map data - 12 interconnected maps var mapData = [ // Map 0 { roads: [{ x: 200, y: 400 }, { x: 300, y: 400 }, { x: 400, y: 400 }, { x: 500, y: 400 }, { x: 600, y: 400 }, { x: 700, y: 400 }, { x: 800, y: 500 }, { x: 900, y: 600 }, { x: 1000, y: 700 }, { x: 1100, y: 800 }, { x: 1200, y: 900 }, { x: 1300, y: 1000 }, { x: 1400, y: 1100 }, { x: 1500, y: 1200 }, { x: 1600, y: 1300 }, { x: 1700, y: 1400 }, { x: 1800, y: 1500 }, { x: 1900, y: 1500 }, { x: 2000, y: 1500 }, { x: 1800, y: 1600 }, { x: 1800, y: 1700 }, { x: 1800, y: 1800 }, { x: 1800, y: 1900 }, { x: 1800, y: 2000 }, { x: 1800, y: 2100 }, { x: 1800, y: 2200 }, { x: 1800, y: 2300 }, { x: 1800, y: 2400 }, { x: 1800, y: 2500 }, { x: 1800, y: 2600 }, { x: 1800, y: 2700 }], mountains: [{ x: 150, y: 200 }, { x: 250, y: 150 }, { x: 350, y: 180 }, { x: 450, y: 220 }, { x: 550, y: 180 }, { x: 650, y: 200 }, { x: 750, y: 250 }, { x: 850, y: 300 }, { x: 950, y: 350 }, { x: 1050, y: 400 }, { x: 1150, y: 450 }, { x: 1250, y: 500 }, { x: 1350, y: 550 }, { x: 1450, y: 600 }, { x: 1550, y: 650 }, { x: 1650, y: 700 }], passages: [{ x: 2000, y: 1500, targetMap: 1, targetX: 100, targetY: 1500 }, { x: 1800, y: 2700, targetMap: 3, targetX: 1800, targetY: 100 }], startX: 200, startY: 400 }, // Map 1 { roads: [{ x: 100, y: 1500 }, { x: 200, y: 1500 }, { x: 300, y: 1500 }, { x: 400, y: 1400 }, { x: 500, y: 1300 }, { x: 600, y: 1200 }, { x: 700, y: 1100 }, { x: 800, y: 1000 }, { x: 900, y: 900 }, { x: 1000, y: 800 }, { x: 1100, y: 700 }, { x: 1200, y: 600 }, { x: 1300, y: 500 }, { x: 1400, y: 400 }, { x: 1500, y: 300 }, { x: 1600, y: 200 }, { x: 48, y: 1500 }, { x: 1600, y: 150 }, { x: 1600, y: 100 }, { x: 1600, y: 48 }], mountains: [{ x: 200, y: 1700 }, { x: 300, y: 1800 }, { x: 400, y: 1700 }, { x: 500, y: 1600 }, { x: 600, y: 1500 }, { x: 700, y: 1400 }, { x: 800, y: 1300 }, { x: 900, y: 1200 }, { x: 1000, y: 1100 }, { x: 1100, y: 1000 }, { x: 1200, y: 900 }, { x: 1300, y: 800 }], passages: [{ x: 100, y: 1500, targetMap: 0, targetX: 2000, targetY: 1500 }, { x: 1600, y: 100, targetMap: 2, targetX: 1600, targetY: 2700 }], startX: 100, startY: 1500 }, // Map 2 { roads: [{ x: 1600, y: 2700 }, { x: 1600, y: 2600 }, { x: 1600, y: 2500 }, { x: 1600, y: 2400 }, { x: 1600, y: 2300 }, { x: 1600, y: 2200 }, { x: 1600, y: 2100 }, { x: 1600, y: 2000 }, { x: 1600, y: 1900 }, { x: 1600, y: 1800 }, { x: 1600, y: 1700 }, { x: 1600, y: 1600 }, { x: 1600, y: 1500 }, { x: 1600, y: 1400 }, { x: 1600, y: 1300 }, { x: 1600, y: 1200 }], mountains: [{ x: 1400, y: 2600 }, { x: 1500, y: 2500 }, { x: 1700, y: 2500 }, { x: 1800, y: 2600 }, { x: 1400, y: 2400 }, { x: 1800, y: 2400 }, { x: 1400, y: 2200 }, { x: 1800, y: 2200 }, { x: 1400, y: 2000 }, { x: 1800, y: 2000 }, { x: 1400, y: 1800 }, { x: 1800, y: 1800 }], passages: [{ x: 1600, y: 2700, targetMap: 1, targetX: 1600, targetY: 100 }, { x: 1600, y: 1200, targetMap: 4, targetX: 1600, targetY: 2350 }], startX: 1600, startY: 2700 }, // Map 3 { roads: [{ x: 1800, y: 100 }, { x: 1700, y: 200 }, { x: 1600, y: 300 }, { x: 1500, y: 400 }, { x: 1400, y: 500 }, { x: 1300, y: 600 }, { x: 1200, y: 700 }, { x: 1100, y: 800 }, { x: 1000, y: 900 }, { x: 900, y: 1000 }, { x: 800, y: 1100 }, { x: 700, y: 1200 }, { x: 600, y: 1300 }, { x: 500, y: 1400 }, { x: 400, y: 1500 }, { x: 300, y: 1600 }, { x: 1800, y: 48 }, { x: 250, y: 1600 }, { x: 200, y: 1600 }], mountains: [{ x: 1900, y: 200 }, { x: 1800, y: 300 }, { x: 1700, y: 400 }, { x: 1600, y: 500 }, { x: 1500, y: 600 }, { x: 1400, y: 700 }, { x: 1300, y: 800 }, { x: 1200, y: 900 }, { x: 1100, y: 1000 }, { x: 1000, y: 1100 }, { x: 900, y: 1200 }, { x: 800, y: 1300 }], passages: [{ x: 1800, y: 100, targetMap: 0, targetX: 1800, targetY: 2700 }, { x: 200, y: 1600, targetMap: 5, targetX: 1900, targetY: 1600 }], startX: 1800, startY: 100 }, // Map 4 { roads: [{ x: 1600, y: 2350 }, { x: 1500, y: 2250 }, { x: 1400, y: 2150 }, { x: 1300, y: 2050 }, { x: 1200, y: 1950 }, { x: 1100, y: 1850 }, { x: 1000, y: 1750 }, { x: 900, y: 1650 }, { x: 800, y: 1550 }, { x: 700, y: 1450 }, { x: 600, y: 1350 }, { x: 500, y: 1250 }], mountains: [{ x: 1700, y: 2700 }, { x: 1600, y: 2800 }, { x: 1500, y: 2700 }, { x: 1400, y: 2600 }, { x: 1300, y: 2500 }, { x: 1200, y: 2400 }, { x: 1100, y: 2300 }, { x: 1000, y: 2200 }], passages: [{ x: 1600, y: 2350, targetMap: 2, targetX: 1600, targetY: 1200 }, { x: 500, y: 1250, targetMap: 6, targetX: 1800, targetY: 1500 }], startX: 1600, startY: 2350 }, // Map 5 { roads: [{ x: 1900, y: 1600 }, { x: 1800, y: 1600 }, { x: 1700, y: 1600 }, { x: 1600, y: 1600 }, { x: 1500, y: 1600 }, { x: 1400, y: 1600 }, { x: 1300, y: 1600 }, { x: 1200, y: 1600 }, { x: 1100, y: 1600 }, { x: 1000, y: 1600 }, { x: 900, y: 1600 }, { x: 800, y: 1600 }, { x: 750, y: 1600 }, { x: 700, y: 1600 }, { x: 1950, y: 1600 }, { x: 2000, y: 1600 }], mountains: [{ x: 1900, y: 1400 }, { x: 1800, y: 1400 }, { x: 1900, y: 1800 }, { x: 1800, y: 1800 }, { x: 1700, y: 1400 }, { x: 1600, y: 1400 }, { x: 1700, y: 1800 }, { x: 1600, y: 1800 }], passages: [{ x: 2000, y: 1600, targetMap: 3, targetX: 200, targetY: 1600 }, { x: 700, y: 1600, targetMap: 7, targetX: 1400, targetY: 1600 }], startX: 1900, startY: 1600 }, // Map 6 { roads: [{ x: 1800, y: 1500 }, { x: 1700, y: 1400 }, { x: 1600, y: 1300 }, { x: 1500, y: 1200 }, { x: 1400, y: 1100 }, { x: 1300, y: 1000 }, { x: 1200, y: 900 }, { x: 1100, y: 800 }, { x: 1000, y: 700 }, { x: 900, y: 600 }, { x: 800, y: 500 }, { x: 700, y: 400 }, { x: 1850, y: 1500 }, { x: 1900, y: 1500 }, { x: 1950, y: 1500 }, { x: 2000, y: 1500 }, { x: 650, y: 400 }, { x: 600, y: 400 }], mountains: [{ x: 1900, y: 1600 }, { x: 1800, y: 1700 }, { x: 1700, y: 1600 }, { x: 1600, y: 1500 }, { x: 1500, y: 1400 }, { x: 1400, y: 1300 }, { x: 1300, y: 1200 }, { x: 1200, y: 1100 }], passages: [{ x: 2000, y: 1500, targetMap: 4, targetX: 500, targetY: 1250 }, { x: 600, y: 400, targetMap: 8, targetX: 1500, targetY: 2300 }], startX: 1800, startY: 1500 }, // Map 7 { roads: [{ x: 1400, y: 1600 }, { x: 1300, y: 1500 }, { x: 1200, y: 1400 }, { x: 1100, y: 1300 }, { x: 1000, y: 1200 }, { x: 900, y: 1100 }, { x: 800, y: 1000 }, { x: 700, y: 900 }, { x: 600, y: 800 }, { x: 500, y: 700 }, { x: 400, y: 600 }, { x: 300, y: 500 }, { x: 1450, y: 1600 }, { x: 1500, y: 1600 }, { x: 250, y: 500 }, { x: 200, y: 500 }], mountains: [{ x: 1500, y: 1700 }, { x: 1400, y: 1800 }, { x: 1300, y: 1700 }, { x: 1200, y: 1600 }, { x: 1100, y: 1500 }, { x: 1000, y: 1400 }, { x: 900, y: 1300 }, { x: 800, y: 1200 }], passages: [{ x: 1500, y: 1600, targetMap: 5, targetX: 700, targetY: 1600 }, { x: 200, y: 500, targetMap: 9, targetX: 1800, targetY: 500 }], startX: 1400, startY: 1600 }, // Map 8 { roads: [{ x: 1500, y: 2300 }, { x: 1400, y: 2200 }, { x: 1300, y: 2100 }, { x: 1200, y: 2000 }, { x: 1100, y: 1900 }, { x: 1000, y: 1800 }, { x: 900, y: 1700 }, { x: 800, y: 1600 }, { x: 700, y: 1500 }, { x: 600, y: 1400 }, { x: 500, y: 1300 }, { x: 400, y: 1200 }, { x: 1500, y: 2400 }, { x: 1500, y: 2500 }, { x: 1500, y: 2600 }, { x: 1500, y: 2700 }, { x: 1500, y: 2732 }, { x: 350, y: 1200 }, { x: 300, y: 1200 }], mountains: [{ x: 1600, y: 2400 }, { x: 1500, y: 2500 }, { x: 1400, y: 2400 }, { x: 1300, y: 2300 }, { x: 1200, y: 2200 }, { x: 1100, y: 2100 }, { x: 1000, y: 2000 }, { x: 900, y: 1900 }], passages: [{ x: 1500, y: 2700, targetMap: 6, targetX: 600, targetY: 400 }, { x: 300, y: 1200, targetMap: 10, targetX: 1700, targetY: 1200 }], startX: 1500, startY: 2300 }, // Map 9 { roads: [{ x: 1800, y: 500 }, { x: 1700, y: 600 }, { x: 1600, y: 700 }, { x: 1500, y: 800 }, { x: 1400, y: 900 }, { x: 1300, y: 1000 }, { x: 1200, y: 1100 }, { x: 1100, y: 1200 }, { x: 1000, y: 1300 }, { x: 900, y: 1400 }, { x: 800, y: 1500 }, { x: 700, y: 1600 }, { x: 1850, y: 500 }, { x: 1900, y: 500 }, { x: 1950, y: 500 }, { x: 2000, y: 500 }, { x: 900, y: 1300 }, { x: 800, y: 1300 }, { x: 700, y: 1300 }, { x: 600, y: 1300 }, { x: 550, y: 1300 }, { x: 500, y: 1300 }], mountains: [{ x: 1900, y: 400 }, { x: 1800, y: 300 }, { x: 1700, y: 400 }, { x: 1600, y: 500 }, { x: 1500, y: 600 }, { x: 1400, y: 700 }, { x: 1300, y: 800 }, { x: 1200, y: 900 }], passages: [{ x: 2000, y: 500, targetMap: 7, targetX: 200, targetY: 500 }, { x: 500, y: 1300, targetMap: 11, targetX: 1500, targetY: 800 }], startX: 1800, startY: 500 }, // Map 10 { roads: [{ x: 1700, y: 1200 }, { x: 1600, y: 1100 }, { x: 1500, y: 1000 }, { x: 1400, y: 900 }, { x: 1300, y: 800 }, { x: 1200, y: 700 }, { x: 1100, y: 600 }, { x: 1000, y: 500 }, { x: 900, y: 400 }, { x: 800, y: 300 }, { x: 700, y: 200 }, { x: 600, y: 100 }, { x: 1750, y: 1200 }, { x: 1800, y: 1200 }, { x: 600, y: 75 }, { x: 600, y: 48 }], mountains: [{ x: 1800, y: 1300 }, { x: 1700, y: 1400 }, { x: 1600, y: 1300 }, { x: 1500, y: 1200 }, { x: 1400, y: 1100 }, { x: 1300, y: 1000 }, { x: 1200, y: 900 }, { x: 1100, y: 800 }], passages: [{ x: 1795, y: 1260, targetMap: 8, targetX: 300, targetY: 1200 }, { x: 600, y: 100, targetMap: 11, targetX: 600, targetY: 2700 }], startX: 1700, startY: 1200 }, // Map 11 { roads: [{ x: 1500, y: 800 }, { x: 1400, y: 900 }, { x: 1300, y: 1000 }, { x: 1200, y: 1100 }, { x: 1100, y: 1200 }, { x: 1000, y: 1300 }, { x: 900, y: 1400 }, { x: 800, y: 1500 }, { x: 700, y: 1600 }, { x: 600, y: 1700 }, { x: 600, y: 1800 }, { x: 600, y: 1900 }, { x: 600, y: 2000 }, { x: 600, y: 2100 }, { x: 600, y: 2200 }, { x: 600, y: 2300 }, { x: 600, y: 2400 }, { x: 600, y: 2500 }, { x: 600, y: 2600 }, { x: 1500, y: 750 }, { x: 1500, y: 700 }, { x: 600, y: 2650 }, { x: 600, y: 2700 }, { x: 600, y: 2732 }], mountains: [{ x: 1600, y: 700 }, { x: 1500, y: 600 }, { x: 1400, y: 700 }, { x: 1300, y: 800 }, { x: 1200, y: 900 }, { x: 1100, y: 1000 }, { x: 1000, y: 1100 }, { x: 900, y: 1200 }, { x: 500, y: 1700 }, { x: 700, y: 1700 }, { x: 500, y: 1900 }, { x: 700, y: 1900 }], passages: [{ x: 1500, y: 700, targetMap: 9, targetX: 600, targetY: 1600 }, { x: 600, y: 2700, targetMap: 10, targetX: 600, targetY: 100 }], startX: 1500, startY: 800 }]; var arBackground = null; function loadMap(mapIndex) { // Clear existing elements for (var i = 0; i < roads.length; i++) { roads[i].destroy(); } // Mountain cleanup removed for (var i = 0; i < passages.length; i++) { passages[i].destroy(); } // Clean up existing center marker if (centerMarker) { centerMarker.destroy(); centerMarker = null; } // Clean up existing city marker if (city) { city.destroy(); city = null; } // Clean up existing AR background if (arBackground) { arBackground.destroy(); arBackground = null; } roads = []; mountains = []; passages = []; var map = mapData[mapIndex]; // Add AR background only for Ancient Ruins (map 6) if (mapIndex === 6) { arBackground = game.addChild(LK.getAsset('AR', { anchorX: 0.5, anchorY: 0.5, scaleX: 1, scaleY: 1, x: 1024, y: 1366 })); } // Add CP background only for Central Plains (map 4) if (mapIndex === 4) { arBackground = game.addChild(LK.getAsset('CP', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2, x: 1024, y: 1366 })); } // Add SR background only for Southern Ridge (map 2) if (mapIndex === 2) { arBackground = game.addChild(LK.getAsset('Sr', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2, x: 1024, y: 1366 })); } // Add EV background only for Eastern Valleys (map 1) if (mapIndex === 1) { arBackground = game.addChild(LK.getAsset('Ev', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 7, x: 1024, y: 1366 })); } // Add NH background only for Northern Highlands (map 0) if (mapIndex === 0) { arBackground = game.addChild(LK.getAsset('Nh', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 7, x: 1024, y: 1366 })); } // Add WP background only for Western Peaks (map 3) if (mapIndex === 3) { arBackground = game.addChild(LK.getAsset('wp', { anchorX: 0.5, anchorY: 0.5, scaleX: 7, scaleY: 9, x: 1024, y: 1366 })); } // Add MW background only for Mystic Woods (map 5) if (mapIndex === 5) { arBackground = game.addChild(LK.getAsset('mw', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 7, x: 1024, y: 1366 })); } // Add DS background only for Desert Sands (map 7) if (mapIndex === 7) { arBackground = game.addChild(LK.getAsset('ds', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 7, x: 1024, y: 1366 })); } // Add CC background only for Coastal Cliffs (map 9) if (mapIndex === 9) { arBackground = game.addChild(LK.getAsset('cc', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 5, x: 1024, y: 1366 })); } // Add SG background only for Sacred Grove (map 11) if (mapIndex === 11) { arBackground = game.addChild(LK.getAsset('sg', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 7, x: 1024, y: 1366 })); } // Add MP background only for Mountain Pass (map 10) if (mapIndex === 10) { arBackground = game.addChild(LK.getAsset('mp', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 5, x: 1024, y: 1366 })); } // Add FW background only for Frozen Wastes (map 8) if (mapIndex === 8) { arBackground = game.addChild(LK.getAsset('fw', { anchorX: 0.5, anchorY: 0.5, scaleX: 5, scaleY: 5, x: 1024, y: 1366 })); } // Create roads for (var i = 0; i < map.roads.length; i++) { var road = game.addChild(new Road()); road.x = map.roads[i].x; road.y = map.roads[i].y; roads.push(road); } // Mountains removed from display // Create passages for (var i = 0; i < map.passages.length; i++) { var passage = game.addChild(new Passage()); passage.x = map.passages[i].x; passage.y = map.passages[i].y; passage.targetMap = map.passages[i].targetMap; passage.targetX = map.passages[i].targetX; passage.targetY = map.passages[i].targetY; passages.push(passage); } // Set character position if (character.x === 0 && character.y === 0) { character.x = map.startX; character.y = map.startY; } // Find and mark the center road point var centerRoad = findCenterRoad(); if (centerRoad) { centerMarker = game.addChild(new CenterMarker()); centerMarker.x = centerRoad.x; centerMarker.y = centerRoad.y; } // Add city marker at calculated position var cityPosition = findCityPosition(); city = game.addChild(new City()); city.x = cityPosition.x; city.y = cityPosition.y; // Create connecting road between center marker and city if (centerMarker && city) { var connectionRoads = createConnectionRoad(centerMarker.x, centerMarker.y, city.x, city.y); for (var i = 0; i < connectionRoads.length; i++) { roads.push(connectionRoads[i]); } } // Bring city to front so it appears above roads if (city) { game.removeChild(city); game.addChild(city); } // Bring character to front so it appears above roads game.removeChild(character); game.addChild(character); // Reset city visit tracking for new map hasVisitedCity = false; lastCityDistance = Infinity; if (isMarketOpen) { closeMarketScreen(); } } function findNearestRoad(x, y) { var nearestRoad = null; var minDistance = Infinity; for (var i = 0; i < roads.length; i++) { var road = roads[i]; var dx = x - road.x; var dy = y - road.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < minDistance) { minDistance = distance; nearestRoad = road; } } return nearestRoad; } function findCityPosition() { var centerX = 1024; // Screen center X var centerY = 1366; // Screen center Y var mirrorPoints = []; var map = mapData[currentMap]; // Calculate mirror coordinates for each passage for (var i = 0; i < map.passages.length; i++) { var passage = map.passages[i]; var mirrorX = 2 * centerX - passage.x; var mirrorY = 2 * centerY - passage.y; mirrorPoints.push({ x: mirrorX, y: mirrorY }); } // Find the center of all mirror points if (mirrorPoints.length === 0) { return { x: centerX, y: centerY }; // Default to screen center if no passages } var totalX = 0; var totalY = 0; for (var i = 0; i < mirrorPoints.length; i++) { totalX += mirrorPoints[i].x; totalY += mirrorPoints[i].y; } return { x: totalX / mirrorPoints.length, y: totalY / mirrorPoints.length }; } function createConnectionRoad(startX, startY, endX, endY) { var connectionRoads = []; var dx = endX - startX; var dy = endY - startY; var distance = Math.sqrt(dx * dx + dy * dy); var steps = Math.floor(distance / 100); // Create road points every 100 pixels for (var i = 1; i <= steps; i++) { var progress = i / (steps + 1); var roadX = startX + dx * progress; var roadY = startY + dy * progress; var road = game.addChild(new Road()); road.x = roadX; road.y = roadY; connectionRoads.push(road); } return connectionRoads; } function findCenterRoad() { var centerX = 1024; // Screen center X var centerY = 1366; // Screen center Y var centerRoad = null; var minDistance = Infinity; for (var i = 0; i < roads.length; i++) { var road = roads[i]; var dx = centerX - road.x; var dy = centerY - road.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < minDistance) { minDistance = distance; centerRoad = road; } } return centerRoad; } function checkPassageCollision() { for (var i = 0; i < passages.length; i++) { var passage = passages[i]; var dx = character.x - passage.x; var dy = character.y - passage.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < 80) { currentMap = passage.targetMap; storage.currentMap = currentMap; loadMap(currentMap); // Find the 4th nearest road point to the target passage var targetPassageX = passage.targetX; var targetPassageY = passage.targetY; var roadDistances = []; // Calculate distances from target passage to all roads for (var j = 0; j < roads.length; j++) { var road = roads[j]; var rdx = targetPassageX - road.x; var rdy = targetPassageY - road.y; var roadDistance = Math.sqrt(rdx * rdx + rdy * rdy); roadDistances.push({ road: road, distance: roadDistance }); } // Sort roads by distance roadDistances.sort(function (a, b) { return a.distance - b.distance; }); // Get the 4th nearest road (index 3), or closest available if less than 4 roads var targetRoadIndex = Math.min(3, roadDistances.length - 1); // Special case for Western Peaks left passage teleportation - use 5th nearest road for better positioning if (currentMap === 5 && passage.targetX === 1900 && passage.targetY === 1600) { targetRoadIndex = Math.min(4, roadDistances.length - 1); } // Special case for Sacred Grove to Coastal Cliffs teleportation - use 3rd nearest road if (currentMap === 9 && passage.targetX === 600 && passage.targetY === 1600) { targetRoadIndex = Math.min(2, roadDistances.length - 1); } var targetRoad = roadDistances[targetRoadIndex].road; character.x = targetRoad.x; character.y = targetRoad.y; character.isMoving = false; break; } } } // Initialize first map loadMap(currentMap); // Bring character to front so it appears above roads game.removeChild(character); game.addChild(character); // Region names for each map var regionNames = ['Northern Highlands', 'Eastern Valleys', 'Southern Ridge', 'Western Peaks', 'Central Plains', 'Mystic Woods', 'Ancient Ruins', 'Desert Sands', 'Frozen Wastes', 'Coastal Cliffs', 'Mountain Pass', 'Sacred Grove']; // Map info display var mapText = new Text2(regionNames[currentMap], { size: 60, fill: 0xFFFFFF }); mapText.anchor.set(1, 1); LK.gui.bottomRight.addChild(mapText); // Gold display setup goldIcon = LK.getAsset('gold', { anchorX: 0, anchorY: 0, scaleX: 1.36, scaleY: 1.36 }); goldIcon.x = 160; goldIcon.y = 20; LK.gui.topLeft.addChild(goldIcon); goldText = new Text2(playerGold.toString(), { size: 48, fill: 0xFFD700 }); goldText.anchor.set(0, 0); goldText.x = 270; goldText.y = 50; goldText.scaleX = 2.975; goldText.scaleY = 2.975; LK.gui.topLeft.addChild(goldText); // City market UI variables var marketScreen = null; var marketTitle = null; var closeButton = null; var isMarketOpen = false; var lastCityDistance = Infinity; var hasVisitedCity = false; function createMarketScreen() { // Create market background container marketScreen = new Container(); marketScreen.x = 0; marketScreen.y = 0; // Create market background using citytrade texture var marketBg = LK.getAsset('citytrade', { anchorX: 0.5, anchorY: 0.5, scaleX: 1, scaleY: 1 }); marketBg.x = 24; marketBg.y = -34; marketScreen.addChild(marketBg); // Create market title marketTitle = new Text2(regionNames[currentMap] + ' Market', { size: 64, fill: 0xFFFFFF }); marketTitle.anchor.set(0.5, 0); marketTitle.x = 24; marketTitle.y = -430; marketScreen.addChild(marketTitle); // Create close button using xbutton texture closeButton = LK.getAsset('xbutton', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2 }); closeButton.x = 556; closeButton.y = -660; marketScreen.addChild(closeButton); // Add close button functionality closeButton.down = function () { closeMarketScreen(); }; LK.gui.center.addChild(marketScreen); isMarketOpen = true; } function closeMarketScreen() { if (marketScreen) { LK.gui.center.removeChild(marketScreen); marketScreen = null; marketTitle = null; closeButton = null; isMarketOpen = false; } } function checkCityProximity() { if (!city) { return; } var dx = character.x - city.x; var dy = character.y - city.y; var currentDistance = Math.sqrt(dx * dx + dy * dy); // Check if entering city range (distance < 100) if (lastCityDistance >= 100 && currentDistance < 100) { // Just entered city - show market if not already visited if (!hasVisitedCity && !isMarketOpen) { createMarketScreen(); hasVisitedCity = true; } } // Check if leaving city range (distance > 150) if (lastCityDistance <= 150 && currentDistance > 150) { // Left city area - reset visit flag for next entry hasVisitedCity = false; if (isMarketOpen) { closeMarketScreen(); } } lastCityDistance = currentDistance; } game.down = function (x, y, obj) { // Prevent movement when market is open if (isMarketOpen) { return; } var nearestRoad = findNearestRoad(x, y); if (nearestRoad) { character.moveTo(nearestRoad.x, nearestRoad.y); } }; function updateGoldDisplay() { if (goldText) { goldText.setText(playerGold.toString()); storage.playerGold = playerGold; } } game.update = function () { checkPassageCollision(); mapText.setText(regionNames[currentMap]); checkCityProximity(); updateGoldDisplay(); };
===================================================================
--- original.js
+++ change.js
@@ -1780,12 +1780,12 @@
size: 48,
fill: 0xFFD700
});
goldText.anchor.set(0, 0);
-goldText.x = 210;
+goldText.x = 270;
goldText.y = 50;
-goldText.scaleX = 1.75;
-goldText.scaleY = 1.75;
+goldText.scaleX = 2.975;
+goldText.scaleY = 2.975;
LK.gui.topLeft.addChild(goldText);
// City market UI variables
var marketScreen = null;
var marketTitle = null;
mağara girişi. In-Game asset. 2d. High contrast. No shadows
ortaçağ atlı araba ve tüccar . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
aynısı arkaplansız
medieval X close button. In-Game asset. 2d. High contrast. No shadows
altın kesesi. In-Game asset. 2d. High contrast. No shadows
elma. In-Game asset. 2d. High contrast. No shadows
ortaçağ ticari tuz. In-Game asset. 2d. High contrast. No shadows
çivi ile duvara asılı hafif yıpranmış parşomen. In-Game asset. 2d. High contrast. No shadows
medieval envanter bag. In-Game asset. 2d. High contrast. No shadows
minecraft envaneri gibi kutucuklar sadece kutucuklar başka uı elementi yok. ortaçağ temasında bir çanta içi hissi vermeli dokusu . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
bir ortaçağ eşyası bize hız veriyor ne olur bilmiyorum. In-Game asset. 2d. High contrast. No shadows
medieval sword. In-Game asset. 2d. High contrast. No shadows