User prompt
kart sağa sola sürüklenmesin ortada sabit dursun
User prompt
kartın üstünde yazan soruyu kartın üstünden sil ve barların altına yerleştir
User prompt
Start ve ya dil seçerken Buton sesini aktiv et
User prompt
kartın üstünde ki ipucu yazısını barların tam altında olsun ve sabit olsun
User prompt
sorular kartın ortasında yazıyor bunu kartın üst kısımna yerleştir sabit olacak
User prompt
bize sorulan soruyu kartın üstünde göster
User prompt
şimdi de bize soruların sorular gözükmüyir düzelt onu
User prompt
kart aşağı yukarı harket ediyor onu sabitle sadece sağa sola 45° açı yapa bilsin oyuncu istediği tarafa yöblendirdilten sonra oyuncu kartı bıraksın kart kendisi o yöne tam olarak gidib yok olsun
User prompt
Karta aşağsında kararlar yazıyor evet hayır gibi o yazıları beyaz yap
User prompt
karta basılı tutuğmda ses durmadan ard arda çalıyor bunu karşısını al
User prompt
oyuncu kartı istedii yöne yönledirtikte Cards sesi çalsın
User prompt
starta bastıktan sonra Start1 müziyni çal
User prompt
dil seçimi ekranında Menu1 müziyini çal
User prompt
cardShadow dil seçimi ekranında gözükmesin ve SatarMenu tam elranı kaplasın
User prompt
dil seçimi ekranına SatarMenu resmini ekle
User prompt
Giriş.menusunda StartMenu1 resmini ve Menu1 müziyini ekle
User prompt
kral oyunu kaybederse oyun bitsin
User prompt
Zor dolsun yavaş hızlı azalsın
User prompt
barlar gızlı doluyor bunu düzelt zor olsun oyun
User prompt
oyun güzel gidiyor ve bir anda oyun bitiyor oyun bitmeyecek sonsuz devam etmeli
User prompt
barlar yine azalmıyor sorularda yine aynı olmağa başladı 50 kadar bir metin hazırla bazı sorular güzel gibi olsada ihanetli çıkma olaslığıda olsun
User prompt
Tahtta geçen yıl sayısı sadece bazı önemli kararlardan sonra rastgele 1 ila 3 yıl arasında artsın. Her karardan sonra artmasın. Artış mantıklı bir hızda olsun, ne çok kolay ne de çok zor. Bu yıl sayısı sol alt köşede 'Tahtta X yıl' şeklinde gösterilsin ve oyun bunu otomatik yönetsin.
User prompt
bar sanki çok uzun ve oyuncu için çok kolay bunu biraz zor yapalım oyuncu zorlansın biraz
User prompt
gözükmüyor sol alta "(O zaman ki yıl) Devletin başındasın" olsun
User prompt
sol alta kral kaç yıldır ülkenin başında olduğunu kodla bunu tamamen sana bırakıyorum zamanı kendin ayarla
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // Card class: represents a decision card var Card = Container.expand(function () { var self = Container.call(this); // Card shadow for depth (use image asset, ensure it's added as a child and visible) var shadow = LK.getAsset('cardShadow', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 20, alpha: 0.15 }); self.addChild(shadow); // Card background var bg = self.attachAsset('card', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0 }); // Card text var text = new Text2('', { size: 70, fill: 0x222222, wordWrap: true, wordWrapWidth: 800, align: 'center' }); text.anchor.set(0.5, 0.5); text.x = 0; text.y = -200; self.addChild(text); // Left choice text var leftText = new Text2('', { size: 55, fill: 0xFFFFFF, wordWrap: true, wordWrapWidth: 350, align: 'left' }); leftText.anchor.set(0, 0.5); leftText.x = -400; leftText.y = 400; self.addChild(leftText); // Right choice text var rightText = new Text2('', { size: 55, fill: 0xFFFFFF, wordWrap: true, wordWrapWidth: 350, align: 'right' }); rightText.anchor.set(1, 0.5); rightText.x = 400; rightText.y = 400; self.addChild(rightText); // Card data self.cardData = null; // Set card content self.setCard = function (cardData) { self.cardData = cardData; text.setText(cardData.text); leftText.setText(cardData.left.text); rightText.setText(cardData.right.text); }; // Animate card back to center self.animateToCenter = function (onFinish) { tween(self, { x: 0, y: 0, rotation: 0 }, { duration: 250, easing: tween.easeOut, onFinish: onFinish }); }; // Animate card off screen (left or right) self.animateOff = function (direction, onFinish) { var targetX = direction === 'left' ? -1200 : 1200; tween(self, { x: targetX, y: self.y + 200 * (direction === 'left' ? 1 : -1), rotation: direction === 'left' ? -0.5 : 0.5 }, { duration: 300, easing: tween.cubicOut, onFinish: onFinish }); }; return self; }); // StatBar class: shows a single stat (religion, people, army, economy) var StatBar = Container.expand(function () { var self = Container.call(this); // Background var bg = self.attachAsset('statBarBg', { anchorX: 0, anchorY: 0.5, x: 0, y: 0 }); // Fill (color depends on stat) self.fill = null; self.setType = function (type) { var fillId = 'statBarFill_' + type; self.fill = self.attachAsset(fillId, { anchorX: 0, anchorY: 0.5, x: 0, y: 0 }); self.addChildAt(self.fill, 1); }; // Label self.label = new Text2('', { size: 45, fill: 0xFFFFFF }); self.label.anchor.set(1, 0.5); self.label.x = -20; self.label.y = 0; self.addChild(self.label); // Set value (0-100) self.setValue = function (val) { if (val < 0) val = 0; if (val > 100) val = 100; self.fill.width = 4 * val; // 400px max }; // Set label self.setLabel = function (txt) { self.label.setText(txt); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a1a }); /**** * Game Code ****/ // List of cards (minimal set for MVP, can be expanded) // --- Game Data --- // Card background shapes // Stat bar backgrounds and fills var cards = [ // --- Betrayal and risk cards --- { type: "nobility", text: "A trusted noble offers to double the treasury if you let him manage it.", left: { text: "Accept his offer.", effects: { religion: 0, people: -10, army: -10, economy: +25 } }, right: { text: "Refuse, keep control.", effects: { religion: 0, people: 0, army: 0, economy: -5 } } }, { type: "nobility", text: "A noble is accused of plotting against you.", left: { text: "Exile the noble.", effects: { religion: 0, people: -10, army: +10, economy: 0 } }, right: { text: "Trust the noble.", effects: { religion: 0, people: +5, army: -15, economy: 0 } } }, { type: "army", text: "A general offers to train your army for a price.", left: { text: "Pay for training.", effects: { religion: 0, people: 0, army: +20, economy: -15 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: -10, economy: 0 } } }, { type: "army", text: "A captain is caught taking bribes.", left: { text: "Punish the captain.", effects: { religion: 0, people: 0, army: -10, economy: +10 } }, right: { text: "Ignore the crime.", effects: { religion: 0, people: -5, army: 0, economy: -5 } } }, { type: "clergy", text: "A priest claims a vision: your advisor is a traitor.", left: { text: "Believe the priest.", effects: { religion: +10, people: -10, army: 0, economy: 0 } }, right: { text: "Ignore the claim.", effects: { religion: -10, people: 0, army: 0, economy: 0 } } }, { type: "clergy", text: "The church asks for a secret donation.", left: { text: "Donate in secret.", effects: { religion: +15, people: -5, army: 0, economy: -15 } }, right: { text: "Refuse.", effects: { religion: -10, people: 0, army: 0, economy: 0 } } }, { type: "people", text: "A popular leader is stirring unrest.", left: { text: "Arrest the leader.", effects: { religion: 0, people: -15, army: +10, economy: 0 } }, right: { text: "Let them speak.", effects: { religion: 0, people: +10, army: -10, economy: 0 } } }, { type: "people", text: "A festival is planned, but rumors of a plot spread.", left: { text: "Cancel the festival.", effects: { religion: 0, people: -10, army: +5, economy: 0 } }, right: { text: "Proceed as planned.", effects: { religion: 0, people: +10, army: -10, economy: -5 } } }, { type: "economy", text: "A merchant offers a suspiciously good deal.", left: { text: "Accept the deal.", effects: { religion: 0, people: 0, army: 0, economy: +20 } }, right: { text: "Refuse, too risky.", effects: { religion: 0, people: 0, army: 0, economy: -5 } } }, { type: "economy", text: "A banker offers a loan with hidden terms.", left: { text: "Take the loan.", effects: { religion: 0, people: 0, army: 0, economy: +15 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: 0, economy: -5 } } }, // --- Betrayal/treason risk cards --- { type: "nobility", text: "A noble offers to spy for you, but may be a double agent.", left: { text: "Accept his help.", effects: { religion: 0, people: 0, army: +10, economy: -10 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: -5, economy: 0 } } }, { type: "army", text: "A general asks for more power, threatening a coup.", left: { text: "Grant more power.", effects: { religion: 0, people: -10, army: +15, economy: -10 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: -15, economy: 0 } } }, { type: "clergy", text: "A bishop is accused of heresy.", left: { text: "Punish the bishop.", effects: { religion: -10, people: 0, army: 0, economy: 0 } }, right: { text: "Ignore the accusation.", effects: { religion: +10, people: 0, army: 0, economy: 0 } } }, { type: "people", text: "A peasant claims to be the true heir.", left: { text: "Imprison the peasant.", effects: { religion: 0, people: -10, army: +5, economy: 0 } }, right: { text: "Let them speak.", effects: { religion: 0, people: +10, army: -10, economy: 0 } } }, { type: "economy", text: "A guild offers to pay for influence.", left: { text: "Accept the bribe.", effects: { religion: -5, people: 0, army: 0, economy: +15 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: 0, economy: -5 } } }, // --- Standard and event cards (varied) --- { type: "army", text: "The army wants to recruit more soldiers.", left: { text: "Approve recruitment.", effects: { religion: 0, people: -10, army: +20, economy: -15 } }, right: { text: "Deny the request.", effects: { religion: 0, people: +5, army: -15, economy: +5 } } }, { type: "villager", text: "A famine strikes the land.", left: { text: "Open the royal granaries.", effects: { religion: 0, people: +20, army: 0, economy: -20 } }, right: { text: "Do nothing.", effects: { religion: 0, people: -20, army: 0, economy: 0 } } }, { type: "merchant", text: "Merchants offer a lucrative trade deal.", left: { text: "Accept the deal.", effects: { religion: 0, people: +5, army: 0, economy: +20 } }, right: { text: "Decline the offer.", effects: { religion: 0, people: -5, army: 0, economy: -10 } } }, { type: "heretic", text: "A heretic is spreading dissent.", left: { text: "Punish the heretic.", effects: { religion: +10, people: -10, army: 0, economy: 0 } }, right: { text: "Show mercy.", effects: { religion: -10, people: +10, army: 0, economy: 0 } } }, { type: "army", text: "The army requests better equipment.", left: { text: "Invest in equipment.", effects: { religion: 0, people: 0, army: +15, economy: -15 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: -10, economy: +5 } } }, { type: "villager", text: "A festival is proposed to boost morale.", left: { text: "Host the festival.", effects: { religion: +5, people: +15, army: 0, economy: -10 } }, right: { text: "Decline.", effects: { religion: -5, people: -10, army: 0, economy: +5 } } }, { type: "spy", text: "A spy has been caught in the castle.", left: { text: "Interrogate the spy.", effects: { religion: 0, people: -5, army: +10, economy: 0 } }, right: { text: "Release the spy.", effects: { religion: 0, people: +5, army: -10, economy: 0 } } }, { type: "disaster", text: "A great fire devastates the capital.", left: { text: "Send aid to the people.", effects: { religion: +5, people: +10, army: 0, economy: -20 } }, right: { text: "Let them rebuild on their own.", effects: { religion: -5, people: -10, army: 0, economy: 0 } } }, { type: "tax", text: "The treasury is low. Raise taxes?", left: { text: "Raise taxes.", effects: { religion: 0, people: -15, army: 0, economy: +20 } }, right: { text: "Keep taxes the same.", effects: { religion: 0, people: 0, army: 0, economy: -10 } } }, { type: "festival", text: "A famous bard offers to perform for the court.", left: { text: "Host the performance.", effects: { religion: 0, people: +10, army: 0, economy: -5 } }, right: { text: "Refuse the bard.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "invention", text: "An inventor presents a strange new machine.", left: { text: "Fund the invention.", effects: { religion: -5, people: 0, army: 0, economy: +10 } }, right: { text: "Dismiss the inventor.", effects: { religion: +5, people: 0, army: 0, economy: -5 } } }, { type: "plague", text: "A plague is spreading in the countryside.", left: { text: "Quarantine the villages.", effects: { religion: 0, people: -10, army: 0, economy: -10 } }, right: { text: "Pray for deliverance.", effects: { religion: +10, people: -20, army: 0, economy: 0 } } }, { type: "nobility", text: "A noble accuses another of treason.", left: { text: "Investigate the claim.", effects: { religion: 0, people: 0, army: +5, economy: -5 } }, right: { text: "Ignore the accusation.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "clergy", text: "A relic is discovered in the kingdom.", left: { text: "Display the relic.", effects: { religion: +15, people: +5, army: 0, economy: -10 } }, right: { text: "Sell the relic.", effects: { religion: -10, people: 0, army: 0, economy: +20 } } }, { type: "diplomacy", text: "A foreign ambassador arrives with gifts.", left: { text: "Accept the gifts.", effects: { religion: 0, people: +5, army: 0, economy: +10 } }, right: { text: "Refuse politely.", effects: { religion: 0, people: 0, army: 0, economy: 0 } } }, { type: "bandits", text: "Bandits are raiding the countryside.", left: { text: "Send the army.", effects: { religion: 0, people: 0, army: -10, economy: -5 } }, right: { text: "Offer a reward for their capture.", effects: { religion: 0, people: +5, army: 0, economy: -10 } } }, { type: "harvest", text: "A bountiful harvest is reported.", left: { text: "Celebrate with a feast.", effects: { religion: +5, people: +10, army: 0, economy: -10 } }, right: { text: "Store the surplus.", effects: { religion: 0, people: 0, army: 0, economy: +10 } } }, { type: "scandal", text: "A scandal erupts at court.", left: { text: "Cover it up.", effects: { religion: -5, people: 0, army: 0, economy: -5 } }, right: { text: "Punish those involved.", effects: { religion: 0, people: -5, army: +5, economy: 0 } } }, { type: "market", text: "A new market opens in the city.", left: { text: "Encourage trade.", effects: { religion: 0, people: +5, army: 0, economy: +10 } }, right: { text: "Impose strict regulations.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "witch", text: "Villagers accuse a woman of witchcraft.", left: { text: "Hold a fair trial.", effects: { religion: +5, people: +5, army: 0, economy: -5 } }, right: { text: "Ignore the accusations.", effects: { religion: -5, people: 0, army: 0, economy: 0 } } }, { type: "tournament", text: "Knights request a royal tournament.", left: { text: "Host the tournament.", effects: { religion: 0, people: +10, army: +10, economy: -15 } }, right: { text: "Deny the request.", effects: { religion: 0, people: -5, army: -5, economy: 0 } } }, { type: "taxrelief", text: "Peasants beg for tax relief.", left: { text: "Grant relief.", effects: { religion: 0, people: +15, army: 0, economy: -15 } }, right: { text: "Refuse.", effects: { religion: 0, people: -10, army: 0, economy: +10 } } }, { type: "oracle", text: "An oracle offers a prophecy for gold.", left: { text: "Pay for the prophecy.", effects: { religion: +10, people: 0, army: 0, economy: -10 } }, right: { text: "Decline.", effects: { religion: -5, people: 0, army: 0, economy: 0 } } }, { type: "bridge", text: "A bridge collapses after a storm.", left: { text: "Rebuild the bridge.", effects: { religion: 0, people: +5, army: 0, economy: -15 } }, right: { text: "Leave it in ruins.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, // --- More event cards for variety (to reach 50+) --- { type: "nobility", text: "A noble's daughter is accused of witchcraft.", left: { text: "Pardon her.", effects: { religion: -10, people: +5, army: 0, economy: 0 } }, right: { text: "Let her be tried.", effects: { religion: +10, people: -5, army: 0, economy: 0 } } }, { type: "army", text: "Soldiers demand higher pay.", left: { text: "Increase pay.", effects: { religion: 0, people: 0, army: +10, economy: -15 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: -10, economy: 0 } } }, { type: "clergy", text: "A relic is stolen from the church.", left: { text: "Fund the search.", effects: { religion: +10, people: 0, army: 0, economy: -10 } }, right: { text: "Do nothing.", effects: { religion: -10, people: 0, army: 0, economy: 0 } } }, { type: "people", text: "A popular play criticizes your rule.", left: { text: "Ban the play.", effects: { religion: 0, people: -10, army: 0, economy: 0 } }, right: { text: "Allow it.", effects: { religion: 0, people: +10, army: 0, economy: 0 } } }, { type: "economy", text: "A drought threatens the crops.", left: { text: "Import food.", effects: { religion: 0, people: +10, army: 0, economy: -15 } }, right: { text: "Do nothing.", effects: { religion: 0, people: -10, army: 0, economy: 0 } } }, { type: "nobility", text: "A noble offers to fund a new church.", left: { text: "Accept the offer.", effects: { religion: +10, people: 0, army: 0, economy: +5 } }, right: { text: "Refuse.", effects: { religion: -5, people: 0, army: 0, economy: 0 } } }, { type: "army", text: "A border skirmish breaks out.", left: { text: "Send reinforcements.", effects: { religion: 0, people: 0, army: -10, economy: -5 } }, right: { text: "Do nothing.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "clergy", text: "A new sect is gaining followers.", left: { text: "Tolerate them.", effects: { religion: -10, people: +5, army: 0, economy: 0 } }, right: { text: "Suppress them.", effects: { religion: +10, people: -5, army: 0, economy: 0 } } }, { type: "people", text: "A fire destroys part of the city.", left: { text: "Rebuild quickly.", effects: { religion: 0, people: +10, army: 0, economy: -15 } }, right: { text: "Let them rebuild.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "economy", text: "A new tax is proposed.", left: { text: "Approve the tax.", effects: { religion: 0, people: -10, army: 0, economy: +15 } }, right: { text: "Reject the tax.", effects: { religion: 0, people: 0, army: 0, economy: -5 } } }, { type: "nobility", text: "A noble is caught cheating at cards.", left: { text: "Punish him.", effects: { religion: 0, people: 0, army: +5, economy: 0 } }, right: { text: "Ignore it.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "army", text: "A new weapon is invented.", left: { text: "Adopt it.", effects: { religion: 0, people: 0, army: +15, economy: -10 } }, right: { text: "Reject it.", effects: { religion: 0, people: 0, army: -5, economy: 0 } } }, { type: "clergy", text: "A miracle is reported.", left: { text: "Celebrate it.", effects: { religion: +10, people: +5, army: 0, economy: -5 } }, right: { text: "Ignore it.", effects: { religion: -10, people: 0, army: 0, economy: 0 } } }, { type: "people", text: "A famous artist wants to paint your portrait.", left: { text: "Commission the portrait.", effects: { religion: 0, people: +10, army: 0, economy: -10 } }, right: { text: "Refuse.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "economy", text: "A gold mine is discovered.", left: { text: "Exploit the mine.", effects: { religion: 0, people: 0, army: 0, economy: +20 } }, right: { text: "Leave it untouched.", effects: { religion: 0, people: 0, army: 0, economy: 0 } } }, { type: "nobility", text: "A noble's son is caught stealing.", left: { text: "Punish the son.", effects: { religion: 0, people: 0, army: +5, economy: 0 } }, right: { text: "Let him go.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "army", text: "A mercenary offers his services.", left: { text: "Hire him.", effects: { religion: 0, people: 0, army: +10, economy: -10 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: -5, economy: 0 } } }, { type: "clergy", text: "A monk claims to have found a cure for plague.", left: { text: "Support his work.", effects: { religion: +10, people: +10, army: 0, economy: -10 } }, right: { text: "Ignore him.", effects: { religion: -10, people: -10, army: 0, economy: 0 } } }, { type: "people", text: "A group of peasants demand land.", left: { text: "Grant land.", effects: { religion: 0, people: +15, army: 0, economy: -15 } }, right: { text: "Refuse.", effects: { religion: 0, people: -10, army: 0, economy: +10 } } }, { type: "economy", text: "A foreign trader offers rare spices.", left: { text: "Buy the spices.", effects: { religion: 0, people: +5, army: 0, economy: -10 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: 0, economy: 0 } } }, { type: "nobility", text: "A noblewoman wants to marry into your family.", left: { text: "Accept the marriage.", effects: { religion: 0, people: +10, army: 0, economy: +5 } }, right: { text: "Refuse.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "army", text: "A veteran asks for a pension.", left: { text: "Grant the pension.", effects: { religion: 0, people: 0, army: +5, economy: -10 } }, right: { text: "Refuse.", effects: { religion: 0, people: 0, army: -5, economy: 0 } } }, { type: "clergy", text: "A new holiday is proposed.", left: { text: "Approve the holiday.", effects: { religion: +10, people: +5, army: 0, economy: -10 } }, right: { text: "Refuse.", effects: { religion: -5, people: 0, army: 0, economy: 0 } } }, { type: "people", text: "A baker is accused of poisoning bread.", left: { text: "Investigate.", effects: { religion: 0, people: +5, army: 0, economy: -5 } }, right: { text: "Ignore.", effects: { religion: 0, people: -10, army: 0, economy: 0 } } }, { type: "economy", text: "A drought raises food prices.", left: { text: "Subsidize food.", effects: { religion: 0, people: +10, army: 0, economy: -15 } }, right: { text: "Do nothing.", effects: { religion: 0, people: -10, army: 0, economy: 0 } } }]; // Shuffle cards for each game function shuffleCards(arr) { var a = arr.slice(); for (var i = a.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var t = a[i]; a[i] = a[j]; a[j] = t; } return a; } // --- Game State --- var statNames = ['religion', 'people', 'army', 'economy']; // statLabels is now only used for initial UI setup; actual labels are set by setLanguage() // (kept for legacy, but not used for language switching) var statLabels = { religion: 'Religion', people: 'People', army: 'Army', economy: 'Economy' }; var statColors = { religion: 0x6a4cff, people: 0x1abc9c, // Beautiful teal for people army: 0xff4136, economy: 0xffdc00 // Economy stays the same }; var stats = { religion: 50, people: 50, army: 50, economy: 50 }; var statBars = {}; var currentCard = null; var cardIndex = 0; var deck = []; var isDragging = false; var dragStart = { x: 0, y: 0 }; var dragOffset = { x: 0, y: 0 }; var dragThreshold = 200; // px to trigger a choice var cardContainer = null; var reign = 0; // Number of cards survived // --- UI Setup --- // Stat icons at top (avoid top left 100x100) var statIconY = 120; var statIconSpacing = 440; var statIconAssets = { religion: { icon: 'statIcon_religion', img: null }, // Will be replaced with image if available people: { icon: 'statIcon_people', img: null }, army: { icon: 'statIcon_army', img: null }, economy: { icon: 'statIcon_economy', img: null } }; // You can replace the icon asset ids above with custom image ids if you have them, e.g. 'priestImage', 'swordsImage', etc. var statIcons = {}; // Store preview rectangles for stat effect preview var statEffectPreviews = {}; for (var i = 0; i < statNames.length; i++) { var stat = statNames[i]; var iconAssetId = statIconAssets[stat].icon; var iconContainer = new Container(); // Icon background (gray, always full) // Remove background for religion stat so only priest image is visible var bg = null; if (stat !== "religion" && stat !== "economy") { bg = iconContainer.attachAsset('statBarBg', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 160, height: 160, tint: 0x333333 }); bg.alpha = 0.5; } // Icon (fixed, does not change) var fillHeight = 120; var iconWidth = stat === "economy" ? 80 : 120; var icon = iconContainer.attachAsset(iconAssetId, { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: iconWidth, height: fillHeight }); icon.alpha = 1; // Icon outline (white, always full) var outline = null; if (stat !== "religion" && stat !== "economy") { outline = iconContainer.attachAsset(iconAssetId, { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 120, height: 120 }); outline.alpha = 0.18; } // Stat label (below icon) var label = new Text2(statLabels[stat], { size: 45, fill: 0xFFFFFF }); label.anchor.set(0.5, 0); label.x = 0; label.y = 90; // Vertical stat bar (same height as icon, thin, fills up/down) var barHeight = fillHeight; // Match icon height var barWidth = 32; var barX = 80; // to the right of the icon var barY = 0; // Bar background var barBg = iconContainer.attachAsset('statBarBg', { anchorX: 0.5, anchorY: 1, x: barX, y: barY + barHeight / 2, width: barWidth, height: barHeight, tint: 0x222222 }); barBg.alpha = 0.5; // Bar fill (colored, height changes) var barFillId = 'statBarFill_' + stat; var barFill = iconContainer.attachAsset(barFillId, { anchorX: 0.5, anchorY: 1, x: barX, y: barY + barHeight / 2, width: barWidth, height: barHeight, tint: statColors[stat] }); barFill.alpha = 1; // --- Stat effect preview rectangle (hidden by default) --- var previewRect = iconContainer.attachAsset('statBarBg', { anchorX: 0.5, anchorY: 0, x: 0, y: 160, width: 24, // even narrower preview height: 36, // taller preview rectangle tint: statColors[stat] }); previewRect.alpha = 0.7; previewRect.visible = false; iconContainer.addChild(previewRect); statEffectPreviews[stat] = previewRect; // Add children in correct order if (bg) iconContainer.addChild(bg); iconContainer.addChild(icon); if (outline) iconContainer.addChild(outline); iconContainer.addChild(label); iconContainer.addChild(barBg); iconContainer.addChild(barFill); iconContainer.x = 350 + i * statIconSpacing; iconContainer.y = statIconY; statIcons[stat] = { container: iconContainer, icon: icon, label: label, barFill: barFill, barBg: barBg, barHeight: barHeight }; game.addChild(iconContainer); } // Reign counter (center top, below stat bars) var reignText = new Text2('Reign: 0', { size: 70, fill: 0xFFFFFF }); reignText.anchor.set(0.5, 0); reignText.x = 2048 / 2; reignText.y = 220; LK.gui.top.addChild(reignText); // --- Reign Year Counter (bottom left) --- var reignYear = 1; // Başlangıç yılı var reignYearText = new Text2('Tahtta 1 yıl', { size: 60, fill: 0xffffff }); reignYearText.anchor.set(0, 1); reignYearText.x = 40; reignYearText.y = 2732 - 40; LK.gui.addChild(reignYearText); // Add background image (centered, behind everything) var backgroundImage = LK.getAsset('cardShadow', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, width: 2048, height: 2732, alpha: 0.18 }); game.addChild(backgroundImage); // Card container (centered) cardContainer = new Container(); cardContainer.x = 2048 / 2; cardContainer.y = 2732 / 2 + 100; game.addChild(cardContainer); // --- Game Logic --- function startGame() { // Reset stats stats.religion = 50; stats.people = 50; stats.army = 50; stats.economy = 50; reign = 0; reignYear = 1; if (selectedLanguage === "tr") { reignYearText.setText('Tahtta 1 yıl'); } else { reignYearText.setText('Years on throne: 1'); } cardIndex = 0; deck = shuffleCards(cards); updateStatBars(); reignText.setText('Reign: 0'); clearCard(); showNextCard(); } function updateStatBars() { for (var i = 0; i < statNames.length; i++) { var stat = statNames[i]; var val = stats[stat]; if (val < 0) val = 0; if (val > 100) val = 100; // Update vertical bar fill (barFill) var barFill = statIcons[stat].barFill; var barHeight = statIcons[stat].barHeight; barFill.height = barHeight * (val / 100); // anchorY = 1, so y is at the bottom, height shrinks up // Update label if language changed if (statIcons[stat].label) { statIcons[stat].label.setText(languageData[selectedLanguage].statLabels[stat]); } } } function clearCard() { if (currentCard) { currentCard.destroy(); currentCard = null; } } function showNextCard() { clearCard(); if (cardIndex >= deck.length) { // Reshuffle and continue deck = shuffleCards(cards); cardIndex = 0; } var cardData = deck[cardIndex]; var card = new Card(); card.setCard(cardData); card.x = 0; card.y = 0; card.rotation = 0; cardContainer.addChild(card); currentCard = card; isDragging = false; dragStart.x = 0; dragStart.y = 0; dragOffset.x = 0; dragOffset.y = 0; } // Apply effects and check for game over function applyChoice(effects) { // Randomize effect size: 70% normal, 15% small (half), 15% big (double) var effectMultiplier = 1; var rand = Math.random(); if (rand < 0.15) { effectMultiplier = 0.5; // small effect } else if (rand > 0.85) { effectMultiplier = 2; // big effect } // Make the stat bar fill much slower for positive effects (gains), but much faster for negative effects (losses) for (var i = 0; i < statNames.length; i++) { var stat = statNames[i]; var effect = effects[stat] || 0; var appliedEffect = 0; if (effect > 0) { // Gains: only 30% of the effect (very slow gain) appliedEffect = Math.round(effect * effectMultiplier * 0.3); } else if (effect < 0) { // Losses: 100% of the effect (fast loss) appliedEffect = Math.round(effect * effectMultiplier * 1.0); } stats[stat] += appliedEffect; if (stats[stat] > 100) stats[stat] = 100; if (stats[stat] < 0) stats[stat] = 0; } updateStatBars(); reign++; // --- Yıl ilerlemesi: Sadece önemli kararlardan sonra rastgele 1-3 yıl artır --- // Önemli kararlar: Etkilerden herhangi biri |effect| >= 10 ise yıl ilerlet var shouldAdvanceYear = false; for (var i = 0; i < statNames.length; i++) { var stat = statNames[i]; var effect = Math.abs(effects[stat] || 0); if (effect >= 10) { shouldAdvanceYear = true; break; } } if (shouldAdvanceYear) { // 1-3 yıl arası rastgele artır var yearInc = 1 + Math.floor(Math.random() * 3); reignYear += yearInc; // Türkçe/İngilizce gösterim if (selectedLanguage === "tr") { reignYearText.setText('Tahtta ' + reignYear + ' yıl'); } else { reignYearText.setText('Years on throne: ' + reignYear); } } reignText.setText(languageData[selectedLanguage].reign + reign); // Check for loss (any stat at 0 or 100) - only if it just reached 0 or 100 this turn var fail = false; for (var i = 0; i < statNames.length; i++) { var stat = statNames[i]; // Only trigger fail if the stat was NOT at 0 or 100 before, but is now if (stats[stat] <= 0 && stats[stat] + -(effects[stat] || 0) > 0 || stats[stat] >= 100 && stats[stat] - (effects[stat] || 0) < 100) { fail = stat; break; } } // If fail, flash the screen and end the game (king loses) if (fail) { LK.effects.flashScreen(statColors[fail], 1000); // Clamp the stat to 0 or 100 so it doesn't get stuck out of bounds stats[fail] = stats[fail] <= 0 ? 0 : 100; // End the game LK.showGameOver(); return; } // Next card cardIndex++; showNextCard(); } // --- Card Dragging and Swiping --- function handleCardMove(x, y, obj) { if (!currentCard) return; if (!isDragging) return; // Convert to local cardContainer coordinates var local = cardContainer.toLocal({ x: x, y: y }); var dx = local.x - dragStart.x; var dy = local.y - dragStart.y; dragOffset.x = dx; dragOffset.y = dy; // Play Cards sound when player drags the card in any direction, but only once per drag if (Math.abs(dx) > 5 || Math.abs(dy) > 5) { if (!handleCardMove._hasPlayedSound) { var cardsSound = LK.getSound('Cards'); if (cardsSound) cardsSound.play(); handleCardMove._hasPlayedSound = true; } } // Move card with finger currentCard.x = dx; currentCard.y = dy; currentCard.rotation = dx / 1200; // slight tilt // Optionally, highlight left/right text as user drags var leftAlpha = Math.max(0.5, 1 - Math.max(0, dx) / 300); var rightAlpha = Math.max(0.5, 1 + Math.min(0, dx) / 300); currentCard.children[2].alpha = leftAlpha; // leftText currentCard.children[3].alpha = rightAlpha; // rightText // --- Stat effect preview rectangles logic --- if (currentCard && currentCard.cardData) { var leftEffects = currentCard.cardData.left.effects; var rightEffects = currentCard.cardData.right.effects; // Show preview if dragging left or right var showPreview = Math.abs(dx) > 30; for (var i = 0; i < statNames.length; i++) { var stat = statNames[i]; var preview = statEffectPreviews[stat]; if (!preview) continue; // Determine if this stat will be affected by the current direction var t = Math.max(-1, Math.min(1, dx / 300)); var effect = 0; if (t < 0) { effect = leftEffects[stat] || 0; } else if (t > 0) { effect = rightEffects[stat] || 0; } // Only show preview if this stat will be affected (effect !== 0) and showPreview is true if (showPreview && effect !== 0) { preview.visible = true; // If not moving much, fade out preview if (Math.abs(dx) < 60) { preview.alpha = 0.3; } else { preview.alpha = 0.7; } // Set color and text preview.tint = statColors[stat]; // Set width based on effect size (positive = right, negative = left) // Make preview even less wide: base 24, max 36 var absEffect = Math.abs(effect); // Determine if this would be a "big" effect (multiplier=2) for this stat // Simulate the effectMultiplier logic: 15% chance for big effect, but for preview, show big if abs(effect) >= 15 // Instead, let's check if the effect for this stat is the max among all stats for this choice and is at least 10 var isBigEffect = false; if (currentCard && currentCard.cardData) { var effectsObj = t < 0 ? leftEffects : rightEffects; var maxAbs = 0; for (var si = 0; si < statNames.length; si++) { var e = Math.abs(effectsObj[statNames[si]] || 0); if (e > maxAbs) maxAbs = e; } // If this stat's effect is the max and at least 10, consider it "big" if (absEffect === maxAbs && absEffect >= 10) isBigEffect = true; } if (isBigEffect) { preview.width = 36 + Math.min(18, absEffect * 5); // wider for big preview.height = 54; // taller for big } else { preview.width = 24 + Math.min(12, absEffect * 4); preview.height = 36; } // Always center the preview rectangle under the stat icon preview.x = 0; // Do not show any plus/minus or value, only the rectangle itself if (preview._text) { preview._text.setText(''); preview._text.visible = false; } } else { preview.visible = false; } } } else { // Hide all previews if no card for (var i = 0; i < statNames.length; i++) { var preview = statEffectPreviews[statNames[i]]; if (preview) preview.visible = false; } } } function handleCardUp(x, y, obj) { if (!currentCard) return; if (!isDragging) return; isDragging = false; // Reset Cards sound play flag at drag end handleCardMove._hasPlayedSound = false; // Hide all stat effect previews for (var i = 0; i < statNames.length; i++) { var preview = statEffectPreviews[statNames[i]]; if (preview) preview.visible = false; } var dx = dragOffset.x; var direction = null; if (dx < -dragThreshold) direction = 'left'; if (dx > dragThreshold) direction = 'right'; if (direction) { // Animate card off screen, then apply choice currentCard.animateOff(direction, function () { var effects = direction === 'left' ? currentCard.cardData.left.effects : currentCard.cardData.right.effects; applyChoice(effects); }); } else { // Animate card back to center currentCard.animateToCenter(function () { // Reset alphas if (currentCard) { currentCard.children[2].alpha = 1; currentCard.children[3].alpha = 1; } }); } } function handleCardDown(x, y, obj) { if (!currentCard) return; // Always start drag, regardless of where the card is touched var local = cardContainer.toLocal({ x: x, y: y }); isDragging = true; dragStart.x = local.x - currentCard.x; dragStart.y = local.y - currentCard.y; dragOffset.x = 0; dragOffset.y = 0; // Reset Cards sound play flag at drag start handleCardMove._hasPlayedSound = false; } // --- Game Event Handlers --- game.move = function (x, y, obj) { handleCardMove(x, y, obj); }; game.down = function (x, y, obj) { handleCardDown(x, y, obj); }; game.up = function (x, y, obj) { handleCardUp(x, y, obj); }; // On game over, restart game after popup LK.on('gameover', function () { // Wait for LK to reset, then start new game LK.setTimeout(function () { startGame(); }, 100); }); // On you win (not used in MVP, but for future expansion) LK.on('youwin', function () { LK.setTimeout(function () { startGame(); }, 100); }); // Main Menu UI --- var menuContainer = new Container(); menuContainer.x = 2048 / 2; menuContainer.y = 2732 / 2; game.addChild(menuContainer); // Add SatarMenu image to menuContainer, filling the entire screen and hiding cardShadow // Remove cardShadow if present in menuContainer for (var i = menuContainer.children.length - 1; i >= 0; i--) { var child = menuContainer.children[i]; if (child.assetId === 'cardShadow') { menuContainer.removeChild(child); } } // Add SatarMenu image, full screen, centered var satarMenuImg = LK.getAsset('SatarMenu', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 2048, height: 2732 }); menuContainer.addChildAt(satarMenuImg, 0); // Language state var languages = [{ code: 'en', label: 'English' }, { code: 'tr', label: 'Türkçe' }]; var selectedLanguage = 'en'; // Language button UI var langButtons = []; for (var i = 0; i < languages.length; i++) { var lang = languages[i]; var btn = new Container(); var btnBg = btn.attachAsset('statBarBg', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 500, height: 120 }); btnBg.alpha = 0.7; var btnText = new Text2(lang.label, { size: 60, fill: 0xffffff }); btnText.anchor.set(0.5, 0.5); btnText.x = 0; btnText.y = 0; btn.addChild(btnText); btn.x = (i - 0.5) * 600; btn.y = -200; btn.interactive = true; btn.buttonMode = true; (function (code, idx) { btn.down = function (x, y, obj) { selectedLanguage = code; for (var j = 0; j < langButtons.length; j++) { langButtons[j].children[0].alpha = j === idx ? 1 : 0.7; } }; })(lang.code, i); menuContainer.addChild(btn); langButtons.push(btn); } langButtons[0].children[0].alpha = 1; // Default English selected // Start button var startBtn = new Container(); var startBtnBg = startBtn.attachAsset('statBarBg', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 0, width: 600, height: 140 }); startBtnBg.alpha = 1; var startBtnText = new Text2('Start', { size: 70, fill: 0x222222 }); startBtnText.anchor.set(0.5, 0.5); startBtnText.x = 0; startBtnText.y = 0; startBtn.addChild(startBtnText); startBtn.x = 0; startBtn.y = 200; startBtn.interactive = true; startBtn.buttonMode = true; startBtn.down = function (x, y, obj) { menuContainer.visible = false; // Set language for game setLanguage(selectedLanguage); LK.playMusic('Start1'); startGame(); }; menuContainer.addChild(startBtn); // Hide game UI until menu is gone for (var i = 0; i < statNames.length; i++) { statIcons[statNames[i]].container.visible = false; } reignText.visible = false; cardContainer.visible = false; // Show/hide game UI on menu/game function setGameUIVisible(visible) { for (var i = 0; i < statNames.length; i++) { statIcons[statNames[i]].container.visible = visible; } reignText.visible = visible; cardContainer.visible = visible; // Hide cardShadow background when menu is visible if (typeof backgroundImage !== "undefined" && backgroundImage) { backgroundImage.visible = visible; } } // Language data var languageData = { en: { statLabels: { religion: 'Religion', people: 'People', army: 'Army', economy: 'Economy' }, reign: 'Reign: ', start: 'Start', cards: cards // Use original cards }, tr: { statLabels: { religion: 'Din', people: 'Halk', army: 'Ordu', economy: 'Ekonomi' }, reign: 'Saltanat: ', start: 'Başla', cards: [{ type: "soylu", text: "Komşu bir krallık evlilik ittifakı istiyor.", left: { text: "İttifakı kabul et.", effects: { religion: +5, people: +10, army: -5, economy: +10 } }, right: { text: "Teklifi reddet.", effects: { religion: -5, people: -10, army: +5, economy: -10 } } }, { type: "dinadami", text: "Kilise yeni bir katedral için daha fazla altın talep ediyor.", left: { text: "Katedrali finanse et.", effects: { religion: +15, people: -5, army: 0, economy: -20 } }, right: { text: "Talebi reddet.", effects: { religion: -15, people: +5, army: 0, economy: +10 } } }, { type: "asker", text: "Ordu daha fazla asker almak istiyor.", left: { text: "Alımları onayla.", effects: { religion: 0, people: -10, army: +20, economy: -15 } }, right: { text: "Talebi reddet.", effects: { religion: 0, people: +5, army: -15, economy: +5 } } }, { type: "koylu", text: "Ülkede kıtlık baş gösterdi.", left: { text: "Kraliyet ambarlarını aç.", effects: { religion: 0, people: +20, army: 0, economy: -20 } }, right: { text: "Hiçbir şey yapma.", effects: { religion: 0, people: -20, army: 0, economy: 0 } } }, { type: "tuccar", text: "Tüccarlar kârlı bir ticaret anlaşması teklif ediyor.", left: { text: "Anlaşmayı kabul et.", effects: { religion: 0, people: +5, army: 0, economy: +20 } }, right: { text: "Teklifi reddet.", effects: { religion: 0, people: -5, army: 0, economy: -10 } } }, { type: "sapkin", text: "Bir sapkın huzursuzluk yayıyor.", left: { text: "Sapkını cezalandır.", effects: { religion: +10, people: -10, army: 0, economy: 0 } }, right: { text: "Merhamet göster.", effects: { religion: -10, people: +10, army: 0, economy: 0 } } }, { type: "asker", text: "Ordu daha iyi ekipman istiyor.", left: { text: "Ekipmana yatırım yap.", effects: { religion: 0, people: 0, army: +15, economy: -15 } }, right: { text: "Reddet.", effects: { religion: 0, people: 0, army: -10, economy: +5 } } }, { type: "koylu", text: "Morali yükseltmek için bir festival önerildi.", left: { text: "Festivali düzenle.", effects: { religion: +5, people: +15, army: 0, economy: -10 } }, right: { text: "Reddet.", effects: { religion: -5, people: -10, army: 0, economy: +5 } } }, // --- Yeni, daha çeşitli kartlar aşağıda --- { type: "casus", text: "Kalede bir casus yakalandı.", left: { text: "Casusu sorgula.", effects: { religion: 0, people: -5, army: +10, economy: 0 } }, right: { text: "Casusu serbest bırak.", effects: { religion: 0, people: +5, army: -10, economy: 0 } } }, { type: "afet", text: "Büyük bir yangın başkenti harap etti.", left: { text: "Halka yardım gönder.", effects: { religion: +5, people: +10, army: 0, economy: -20 } }, right: { text: "Kendi başlarına toparlansınlar.", effects: { religion: -5, people: -10, army: 0, economy: 0 } } }, { type: "vergi", text: "Hazine azaldı. Vergileri artır?", left: { text: "Vergileri artır.", effects: { religion: 0, people: -15, army: 0, economy: +20 } }, right: { text: "Vergileri aynı bırak.", effects: { religion: 0, people: 0, army: 0, economy: -10 } } }, { type: "festival", text: "Ünlü bir ozan sarayda gösteri yapmak istiyor.", left: { text: "Gösteriyi düzenle.", effects: { religion: 0, people: +10, army: 0, economy: -5 } }, right: { text: "Ozanı reddet.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "mucit", text: "Bir mucit tuhaf bir makine sundu.", left: { text: "Buluşu finanse et.", effects: { religion: -5, people: 0, army: 0, economy: +10 } }, right: { text: "Muciti reddet.", effects: { religion: +5, people: 0, army: 0, economy: -5 } } }, { type: "veba", text: "Taşrada veba yayılıyor.", left: { text: "Köyleri karantinaya al.", effects: { religion: 0, people: -10, army: 0, economy: -10 } }, right: { text: "Kurtuluş için dua et.", effects: { religion: +10, people: -20, army: 0, economy: 0 } } }, { type: "soylu", text: "Bir soylu diğerini ihanetten suçluyor.", left: { text: "İddiaları araştır.", effects: { religion: 0, people: 0, army: +5, economy: -5 } }, right: { text: "Suçlamayı görmezden gel.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "dinadami", text: "Krallıkta bir kutsal emanet bulundu.", left: { text: "Emaneti sergile.", effects: { religion: +15, people: +5, army: 0, economy: -10 } }, right: { text: "Emaneti sat.", effects: { religion: -10, people: 0, army: 0, economy: +20 } } }, { type: "diplomasi", text: "Yabancı bir elçi hediyelerle geldi.", left: { text: "Hediyeleri kabul et.", effects: { religion: 0, people: +5, army: 0, economy: +10 } }, right: { text: "Nazikçe reddet.", effects: { religion: 0, people: 0, army: 0, economy: 0 } } }, { type: "haydut", text: "Haydutlar taşrada yağma yapıyor.", left: { text: "Orduyu gönder.", effects: { religion: 0, people: 0, army: -10, economy: -5 } }, right: { text: "Yakalayana ödül ver.", effects: { religion: 0, people: +5, army: 0, economy: -10 } } }, { type: "hasat", text: "Bol bir hasat elde edildi.", left: { text: "Ziyafet düzenle.", effects: { religion: +5, people: +10, army: 0, economy: -10 } }, right: { text: "Fazlayı depola.", effects: { religion: 0, people: 0, army: 0, economy: +10 } } }, { type: "skandal", text: "Sarayda bir skandal patlak verdi.", left: { text: "Üstünü ört.", effects: { religion: -5, people: 0, army: 0, economy: -5 } }, right: { text: "Suçluları cezalandır.", effects: { religion: 0, people: -5, army: +5, economy: 0 } } }, { type: "pazar", text: "Şehirde yeni bir pazar açıldı.", left: { text: "Ticareti teşvik et.", effects: { religion: 0, people: +5, army: 0, economy: +10 } }, right: { text: "Sıkı düzenleme getir.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }, { type: "cadı", text: "Köylüler bir kadını cadılıkla suçluyor.", left: { text: "Adil bir yargılama yap.", effects: { religion: +5, people: +5, army: 0, economy: -5 } }, right: { text: "Suçlamaları görmezden gel.", effects: { religion: -5, people: 0, army: 0, economy: 0 } } }, { type: "turnuva", text: "Şövalyeler kraliyet turnuvası istiyor.", left: { text: "Turnuvayı düzenle.", effects: { religion: 0, people: +10, army: +10, economy: -15 } }, right: { text: "Talebi reddet.", effects: { religion: 0, people: -5, army: -5, economy: 0 } } }, { type: "vergiaffı", text: "Köylüler vergi affı istiyor.", left: { text: "Affı ver.", effects: { religion: 0, people: +15, army: 0, economy: -15 } }, right: { text: "Reddet.", effects: { religion: 0, people: -10, army: 0, economy: +10 } } }, { type: "kahin", text: "Bir kahin altın karşılığı kehanet sunuyor.", left: { text: "Kehaneti satın al.", effects: { religion: +10, people: 0, army: 0, economy: -10 } }, right: { text: "Reddet.", effects: { religion: -5, people: 0, army: 0, economy: 0 } } }, { type: "köprü", text: "Bir köprü fırtınadan sonra yıkıldı.", left: { text: "Köprüyü yeniden inşa et.", effects: { religion: 0, people: +5, army: 0, economy: -15 } }, right: { text: "Yıkık kalsın.", effects: { religion: 0, people: -5, army: 0, economy: 0 } } }] } }; // Set language and update UI function setLanguage(lang) { selectedLanguage = lang; // Update stat labels var labels = languageData[lang].statLabels; for (var i = 0; i < statNames.length; i++) { if (statIcons[statNames[i]] && statIcons[statNames[i]].label) { statIcons[statNames[i]].label.setText(labels[statNames[i]]); } } // Update reign text reignText.setText(languageData[lang].reign + reign); // Update reign year text if (lang === "tr") { reignYearText.setText('Tahtta ' + reignYear + ' yıl'); } else { reignYearText.setText('Years on throne: ' + reignYear); } // Update start button text startBtnText.setText(languageData[lang].start); } // Override startGame to use selected language var _originalStartGame = startGame; startGame = function startGame() { setGameUIVisible(true); menuContainer.visible = false; // Use language-specific cards deck = shuffleCards(languageData[selectedLanguage].cards); cardIndex = 0; // Update stat labels and reign text setLanguage(selectedLanguage); // Reset stats stats.religion = 50; stats.people = 50; stats.army = 50; stats.economy = 50; reign = 0; updateStatBars(); reignText.setText(languageData[selectedLanguage].reign + reign); clearCard(); showNextCard(); }; // On game over, show menu again LK.on('gameover', function () { setGameUIVisible(false); menuContainer.visible = true; // Reset language selection UI for (var j = 0; j < langButtons.length; j++) { langButtons[j].children[0].alpha = languages[j].code === selectedLanguage ? 1 : 0.7; } }); // On you win, show menu again (future expansion) LK.on('youwin', function () { setGameUIVisible(false); menuContainer.visible = true; for (var j = 0; j < langButtons.length; j++) { langButtons[j].children[0].alpha = languages[j].code === selectedLanguage ? 1 : 0.7; } }); // Show menu at start setGameUIVisible(false); menuContainer.visible = true; LK.playMusic('Menu1');
===================================================================
--- original.js
+++ change.js
@@ -39,9 +39,9 @@
self.addChild(text);
// Left choice text
var leftText = new Text2('', {
size: 55,
- fill: 0x6A6A6A,
+ fill: 0xFFFFFF,
wordWrap: true,
wordWrapWidth: 350,
align: 'left'
});
@@ -51,9 +51,9 @@
self.addChild(leftText);
// Right choice text
var rightText = new Text2('', {
size: 55,
- fill: 0x6A6A6A,
+ fill: 0xFFFFFF,
wordWrap: true,
wordWrapWidth: 350,
align: 'right'
});
bir din adamı simgesi beyaz olsun içi oyuncun kararına göre dolub boşalacak her hangi bir terinde hiç bir dinle alakalı din simvolu bulunmasın. In-Game asset. 2d. High contrast. No shadows
2 çapraz bir birne girmiş kılıç simgesi olacak beyaz olsun. In-Game asset. 2d. High contrast. No shadows
3 tane insan profil resmi 1 tane önde 2 arkada kalıyor beyaz olsun. In-Game asset. 2d. High contrast. No shadows
sadece beyaz rengte olan basit dolar simgesi. In-Game asset. 2d. High contrast. No shadows
Gerçek hayata yakın bir menü arka planı istiyorum. Yeşil doğa, çimenlikler ve taş yollar olsun. Uzakta bir kale ya da yapı görünsün. Gökyüzü mavi ve açık olsun, hava gündüz gibi. Renkler doğal tonlarda olsun, altın veya süslü detaylar olmasın. Arka plan sade ve huzurlu bir ortam sunsun, ortası menü için boş ve hafif koyu olabilir.. In-Game asset. 2d. High contrast. No shadows
Krallık oyunu başladıktan sonra kullanılacak, arka planda bir kale olan ama çok karanlık veya kasvetli görünmeyen, hafif sisli ve tarihi atmosferli bir sahne. Gökyüzü açık ya da hafif bulutlu, renkler doğal ve dengeli olmalı.”
dikdörtgen olsun içi notsarjik rengde olsun buton olarak kullanılacak genişliği uzun hiç bir yazı içermesin. In-Game asset. 2d. High contrast. No shadows
sade 1 tane kraliyet kalesi 2 tane gözcü yeri olsun beyaz renkte olsun. In-Game asset. 2d. High contrast. No shadows