User prompt
ellerin içindeki score kısım ne kadar para toplarsak toplayalım boyutu aynı kalsın sağa veya sola score taşmasın
User prompt
score yazan kısım 3cm boyutla ellerin içinde olsun eller maus ile hareket ederken onlarda gittiği tarafa hareket etsin
User prompt
score yazan kısım 5 cm boyutla ellerin içinde olsun
User prompt
10/10 olan kısmı kaldırıp score kısmını ellerin üzerine alır mısın
User prompt
scor kısmı 10 cm boyutla 10/10 olan yere yazar mısın
User prompt
score kısmı elin içine 30 cm yazı boyutuyla yazar mısın
User prompt
aşağıdaki ellerin içinde 10 /10 yazsın her kaçırmada bir tane azalsın
User prompt
tekrar dene butonu 30 cm ve skor kısmınıda 30 cm oyun sonu gösterir misin
User prompt
oyun bitince skor ortada yazsın ve game play butonu olsun
User prompt
düşen para boyutu 15 cm olsun yazı boyutu 15 cm olsun
User prompt
alttaki yakalayan ellerin boyutu 15 cm olsun yazı boyutuda 15 cm olsun , 10 tane düşen para kaçırınca oyun bitsin
User prompt
düşen para birimlerinin boyutunu 20 cm yap yazı boyutunuda 20 cm yap
User prompt
para birimlerini yukardan düşsün ancak yavaş bir biçimde başlasın kademeli olarak hızlansın alttaki hesaplama da yakaladıkça artsın 10 kaçırmaya ise oyun bitsin , para birimleri yukardan tekrarlanarak farklı bir biçimde geometrik olarak düşsün , bunları aşağıda 10cmlik 2 el yakalasın ve bu yakalama sadece maus ile olsun maus olmayanlar için ise yön tuşları ile kontrol için sağ üstte seçenek olsun , her yakalamadan sonra da para sesi gelsin , ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
boyutlarını telefon ekranına sığacak kadar büyütür müsün , yazı boyutları ise 14 olsun
User prompt
buna 200 tl türkiye için ekler misin ve güncel kuru 47 tl yap , euro için de 500 euro 1000 euro ekle , centlerini de ekle ve türk lirası için 1 kurus , 5 kurus , 10 kurus , 25kurus 50 kurus , 1 lira ekle ,
Code edit (1 edits merged)
Please save this source code
User prompt
TL vs Euro: Currency Power Game
Initial prompt
İyi günler şimdi senden Türkiyede yer alan para birimlerini bozuk paralar dahil güncel kur üzerinden almanyanın kullandığı para birimi ile ilgili eşleştirmesini ve alım gücünü gösteren bir uygulama istiyorum . Bu uygulamada para birimleri eşleştirilsin ve en sonunda paranın alım gücünü belirlemek için alt tarafta bir hesaplama yeri olsun ve tl ile euro birimleri birbirlerine dönüştürebilsin . En son oyun biterken iki taraftan hangisi yüksekse kâr veya zarar diye seçenek olsun ve Kâr olunca yeşil ekran zarar olunca kırmızı ekran , Yeşil ekran sesi ve kırmızı ekran sesi birbirinden farklı olsun
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Calculator = Container.expand(function () { var self = Container.call(this); self.displayValue = "0"; self.operation = null; self.operand = null; self.waitingForOperand = false; var bg = self.attachAsset('calculatorBg', { anchorX: 0.5, anchorY: 0.5 }); var display = self.attachAsset('calcDisplay', { anchorX: 0.5, anchorY: 0.5, y: -90 }); self.displayText = new Text2(self.displayValue, { size: 24, fill: 0x00FF00 }); self.displayText.anchor.set(1, 0.5); self.displayText.x = 170; self.displayText.y = -90; self.addChild(self.displayText); var buttons = [['C', 'TL→€', '€→TL', '='], ['7', '8', '9', '/'], ['4', '5', '6', '*'], ['1', '2', '3', '-'], ['0', '.', '+', 'OK']]; self.buttons = []; for (var row = 0; row < buttons.length; row++) { for (var col = 0; col < buttons[row].length; col++) { var button = self.createButton(buttons[row][col], col, row); self.addChild(button); self.buttons.push(button); } } self.createButton = function (text, col, row) { var button = new Container(); var bg = LK.getAsset('calcButton', { anchorX: 0.5, anchorY: 0.5 }); button.addChild(bg); var label = new Text2(text, { size: 18, fill: 0xFFFFFF }); label.anchor.set(0.5, 0.5); button.addChild(label); button.x = (col - 1.5) * 90; button.y = (row - 1) * 70 - 20; button.buttonText = text; button.down = function (x, y, obj) { calculator.handleButtonPress(obj.buttonText); }; return button; }; self.handleButtonPress = function (buttonText) { LK.getSound('click').play(); if (buttonText === 'C') { self.clear(); } else if (buttonText === 'OK') { gamePhase = 'assessment'; showAssessment(); } else if (buttonText === 'TL→€') { var tlAmount = parseFloat(self.displayValue); var euroAmount = convertCurrency(tlAmount, 'tl', 'euro'); self.displayValue = euroAmount.toFixed(2); self.updateDisplay(); } else if (buttonText === '€→TL') { var euroAmount = parseFloat(self.displayValue); var tlAmount = convertCurrency(euroAmount, 'euro', 'tl'); self.displayValue = tlAmount.toFixed(2); self.updateDisplay(); } else if (['+', '-', '*', '/', '='].indexOf(buttonText) !== -1) { self.handleOperator(buttonText); } else { self.handleNumber(buttonText); } }; self.handleNumber = function (num) { if (self.waitingForOperand) { self.displayValue = num; self.waitingForOperand = false; } else { self.displayValue = self.displayValue === '0' ? num : self.displayValue + num; } self.updateDisplay(); }; self.handleOperator = function (nextOperator) { var inputValue = parseFloat(self.displayValue); if (self.operand === null) { self.operand = inputValue; } else if (self.operation) { var currentValue = self.operand || 0; var newValue = self.calculate(currentValue, inputValue, self.operation); self.displayValue = String(newValue); self.operand = newValue; self.updateDisplay(); } self.waitingForOperand = true; self.operation = nextOperator === '=' ? null : nextOperator; }; self.calculate = function (firstOperand, secondOperand, operation) { switch (operation) { case '+': return firstOperand + secondOperand; case '-': return firstOperand - secondOperand; case '*': return firstOperand * secondOperand; case '/': return firstOperand / secondOperand; default: return secondOperand; } }; self.clear = function () { self.displayValue = "0"; self.operation = null; self.operand = null; self.waitingForOperand = false; self.updateDisplay(); }; self.updateDisplay = function () { self.displayText.setText(self.displayValue); }; return self; }); var CurrencyItem = Container.expand(function (type, value, currency) { var self = Container.call(this); self.itemType = type; self.value = value; self.currency = currency; self.isDragging = false; self.originalX = 0; self.originalY = 0; var assetId = currency + type + value; var graphics = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5 }); var label = new Text2(value + ' ' + currency.toUpperCase(), { size: 24, fill: 0xFFFFFF }); label.anchor.set(0.5, 0.5); self.addChild(label); self.down = function (x, y, obj) { self.isDragging = true; self.originalX = self.x; self.originalY = self.y; self.alpha = 0.8; LK.getSound('click').play(); }; self.up = function (x, y, obj) { self.isDragging = false; self.alpha = 1.0; var matched = false; for (var i = 0; i < dropZones.length; i++) { if (self.intersects(dropZones[i]) && !dropZones[i].occupied) { var expectedValue = convertCurrency(self.value, self.currency, dropZones[i].targetCurrency); if (Math.abs(expectedValue - dropZones[i].targetValue) < 0.1) { self.x = dropZones[i].x; self.y = dropZones[i].y; dropZones[i].occupied = true; dropZones[i].occupiedBy = self; matched = true; matchedPairs++; LK.getSound('match').play(); LK.setScore(LK.getScore() + 10); scoreText.setText('Score: ' + LK.getScore()); if (matchedPairs >= totalPairs) { gamePhase = 'calculator'; showCalculator(); } break; } } } if (!matched) { tween(self, { x: self.originalX, y: self.originalY }, { duration: 300 }); } }; return self; }); var DropZone = Container.expand(function (targetValue, targetCurrency) { var self = Container.call(this); self.targetValue = targetValue; self.targetCurrency = targetCurrency; self.occupied = false; self.occupiedBy = null; var bg = self.attachAsset('dropZone', { anchorX: 0.5, anchorY: 0.5 }); bg.alpha = 0.3; var label = new Text2(targetValue.toFixed(2) + ' ' + targetCurrency.toUpperCase(), { size: 20, fill: 0xFFFFFF }); label.anchor.set(0.5, 0.5); self.addChild(label); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a2e }); /**** * Game Code ****/ var exchangeRate = 32.5; // TL per Euro var gamePhase = 'matching'; // 'matching', 'calculator', 'assessment' var matchedPairs = 0; var totalPairs = 6; var currencyItems = []; var dropZones = []; var calculator; var scoreText = new Text2('Score: 0', { size: 40, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); var phaseText = new Text2('Match Turkish Lira with Euro equivalents', { size: 32, fill: 0xFFD700 }); phaseText.anchor.set(0.5, 0); phaseText.y = 80; LK.gui.top.addChild(phaseText); var exchangeRateText = new Text2('Exchange Rate: 1 EUR = ' + exchangeRate + ' TL', { size: 28, fill: 0x00FF00 }); exchangeRateText.anchor.set(0.5, 0); exchangeRateText.y = 120; LK.gui.top.addChild(exchangeRateText); function convertCurrency(amount, fromCurrency, toCurrency) { if (fromCurrency === 'tl' && toCurrency === 'euro') { return amount / exchangeRate; } else if (fromCurrency === 'euro' && toCurrency === 'tl') { return amount * exchangeRate; } return amount; } function setupMatchingPhase() { var tlValues = [1, 5, 10, 20, 50, 100]; var tlTypes = ['Coin', 'Coin', 'Coin', 'Note', 'Note', 'Note']; for (var i = 0; i < tlValues.length; i++) { var tlItem = new CurrencyItem(tlTypes[i], tlValues[i], 'tl'); tlItem.x = 200 + i % 3 * 200; tlItem.y = 300 + Math.floor(i / 3) * 150; currencyItems.push(tlItem); game.addChild(tlItem); var euroEquivalent = convertCurrency(tlValues[i], 'tl', 'euro'); var dropZone = new DropZone(euroEquivalent, 'euro'); dropZone.x = 1400 + i % 3 * 200; dropZone.y = 300 + Math.floor(i / 3) * 150; dropZones.push(dropZone); game.addChild(dropZone); } } function showCalculator() { phaseText.setText('Use calculator to convert currencies'); calculator = new Calculator(); calculator.x = 1024; calculator.y = 2200; game.addChild(calculator); } function showAssessment() { phaseText.setText('Assessment Complete!'); for (var i = 0; i < currencyItems.length; i++) { currencyItems[i].destroy(); } for (var i = 0; i < dropZones.length; i++) { dropZones[i].destroy(); } if (calculator) { calculator.destroy(); } var finalScore = LK.getScore(); var isProfit = finalScore >= 50; if (isProfit) { game.setBackgroundColor(0x006400); LK.effects.flashScreen(0x00FF00, 1500); LK.getSound('success').play(); var successText = new Text2('PROFIT! Well done!', { size: 80, fill: 0xFFFFFF }); successText.anchor.set(0.5, 0.5); successText.x = 1024; successText.y = 1200; game.addChild(successText); } else { game.setBackgroundColor(0x8B0000); LK.effects.flashScreen(0xFF0000, 1500); LK.getSound('warning').play(); var lossText = new Text2('LOSS! Try again!', { size: 80, fill: 0xFFFFFF }); lossText.anchor.set(0.5, 0.5); lossText.x = 1024; lossText.y = 1200; game.addChild(lossText); } LK.setTimeout(function () { if (isProfit) { LK.showYouWin(); } else { LK.showGameOver(); } }, 3000); } game.move = function (x, y, obj) { if (gamePhase === 'matching') { for (var i = 0; i < currencyItems.length; i++) { if (currencyItems[i].isDragging) { currencyItems[i].x = x; currencyItems[i].y = y; break; } } } }; setupMatchingPhase();
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,342 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Calculator = Container.expand(function () {
+ var self = Container.call(this);
+ self.displayValue = "0";
+ self.operation = null;
+ self.operand = null;
+ self.waitingForOperand = false;
+ var bg = self.attachAsset('calculatorBg', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ var display = self.attachAsset('calcDisplay', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ y: -90
+ });
+ self.displayText = new Text2(self.displayValue, {
+ size: 24,
+ fill: 0x00FF00
+ });
+ self.displayText.anchor.set(1, 0.5);
+ self.displayText.x = 170;
+ self.displayText.y = -90;
+ self.addChild(self.displayText);
+ var buttons = [['C', 'TL→€', '€→TL', '='], ['7', '8', '9', '/'], ['4', '5', '6', '*'], ['1', '2', '3', '-'], ['0', '.', '+', 'OK']];
+ self.buttons = [];
+ for (var row = 0; row < buttons.length; row++) {
+ for (var col = 0; col < buttons[row].length; col++) {
+ var button = self.createButton(buttons[row][col], col, row);
+ self.addChild(button);
+ self.buttons.push(button);
+ }
+ }
+ self.createButton = function (text, col, row) {
+ var button = new Container();
+ var bg = LK.getAsset('calcButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ button.addChild(bg);
+ var label = new Text2(text, {
+ size: 18,
+ fill: 0xFFFFFF
+ });
+ label.anchor.set(0.5, 0.5);
+ button.addChild(label);
+ button.x = (col - 1.5) * 90;
+ button.y = (row - 1) * 70 - 20;
+ button.buttonText = text;
+ button.down = function (x, y, obj) {
+ calculator.handleButtonPress(obj.buttonText);
+ };
+ return button;
+ };
+ self.handleButtonPress = function (buttonText) {
+ LK.getSound('click').play();
+ if (buttonText === 'C') {
+ self.clear();
+ } else if (buttonText === 'OK') {
+ gamePhase = 'assessment';
+ showAssessment();
+ } else if (buttonText === 'TL→€') {
+ var tlAmount = parseFloat(self.displayValue);
+ var euroAmount = convertCurrency(tlAmount, 'tl', 'euro');
+ self.displayValue = euroAmount.toFixed(2);
+ self.updateDisplay();
+ } else if (buttonText === '€→TL') {
+ var euroAmount = parseFloat(self.displayValue);
+ var tlAmount = convertCurrency(euroAmount, 'euro', 'tl');
+ self.displayValue = tlAmount.toFixed(2);
+ self.updateDisplay();
+ } else if (['+', '-', '*', '/', '='].indexOf(buttonText) !== -1) {
+ self.handleOperator(buttonText);
+ } else {
+ self.handleNumber(buttonText);
+ }
+ };
+ self.handleNumber = function (num) {
+ if (self.waitingForOperand) {
+ self.displayValue = num;
+ self.waitingForOperand = false;
+ } else {
+ self.displayValue = self.displayValue === '0' ? num : self.displayValue + num;
+ }
+ self.updateDisplay();
+ };
+ self.handleOperator = function (nextOperator) {
+ var inputValue = parseFloat(self.displayValue);
+ if (self.operand === null) {
+ self.operand = inputValue;
+ } else if (self.operation) {
+ var currentValue = self.operand || 0;
+ var newValue = self.calculate(currentValue, inputValue, self.operation);
+ self.displayValue = String(newValue);
+ self.operand = newValue;
+ self.updateDisplay();
+ }
+ self.waitingForOperand = true;
+ self.operation = nextOperator === '=' ? null : nextOperator;
+ };
+ self.calculate = function (firstOperand, secondOperand, operation) {
+ switch (operation) {
+ case '+':
+ return firstOperand + secondOperand;
+ case '-':
+ return firstOperand - secondOperand;
+ case '*':
+ return firstOperand * secondOperand;
+ case '/':
+ return firstOperand / secondOperand;
+ default:
+ return secondOperand;
+ }
+ };
+ self.clear = function () {
+ self.displayValue = "0";
+ self.operation = null;
+ self.operand = null;
+ self.waitingForOperand = false;
+ self.updateDisplay();
+ };
+ self.updateDisplay = function () {
+ self.displayText.setText(self.displayValue);
+ };
+ return self;
+});
+var CurrencyItem = Container.expand(function (type, value, currency) {
+ var self = Container.call(this);
+ self.itemType = type;
+ self.value = value;
+ self.currency = currency;
+ self.isDragging = false;
+ self.originalX = 0;
+ self.originalY = 0;
+ var assetId = currency + type + value;
+ var graphics = self.attachAsset(assetId, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ var label = new Text2(value + ' ' + currency.toUpperCase(), {
+ size: 24,
+ fill: 0xFFFFFF
+ });
+ label.anchor.set(0.5, 0.5);
+ self.addChild(label);
+ self.down = function (x, y, obj) {
+ self.isDragging = true;
+ self.originalX = self.x;
+ self.originalY = self.y;
+ self.alpha = 0.8;
+ LK.getSound('click').play();
+ };
+ self.up = function (x, y, obj) {
+ self.isDragging = false;
+ self.alpha = 1.0;
+ var matched = false;
+ for (var i = 0; i < dropZones.length; i++) {
+ if (self.intersects(dropZones[i]) && !dropZones[i].occupied) {
+ var expectedValue = convertCurrency(self.value, self.currency, dropZones[i].targetCurrency);
+ if (Math.abs(expectedValue - dropZones[i].targetValue) < 0.1) {
+ self.x = dropZones[i].x;
+ self.y = dropZones[i].y;
+ dropZones[i].occupied = true;
+ dropZones[i].occupiedBy = self;
+ matched = true;
+ matchedPairs++;
+ LK.getSound('match').play();
+ LK.setScore(LK.getScore() + 10);
+ scoreText.setText('Score: ' + LK.getScore());
+ if (matchedPairs >= totalPairs) {
+ gamePhase = 'calculator';
+ showCalculator();
+ }
+ break;
+ }
+ }
+ }
+ if (!matched) {
+ tween(self, {
+ x: self.originalX,
+ y: self.originalY
+ }, {
+ duration: 300
+ });
+ }
+ };
+ return self;
+});
+var DropZone = Container.expand(function (targetValue, targetCurrency) {
+ var self = Container.call(this);
+ self.targetValue = targetValue;
+ self.targetCurrency = targetCurrency;
+ self.occupied = false;
+ self.occupiedBy = null;
+ var bg = self.attachAsset('dropZone', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ bg.alpha = 0.3;
+ var label = new Text2(targetValue.toFixed(2) + ' ' + targetCurrency.toUpperCase(), {
+ size: 20,
+ fill: 0xFFFFFF
+ });
+ label.anchor.set(0.5, 0.5);
+ self.addChild(label);
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x1a1a2e
+});
+
+/****
+* Game Code
+****/
+var exchangeRate = 32.5; // TL per Euro
+var gamePhase = 'matching'; // 'matching', 'calculator', 'assessment'
+var matchedPairs = 0;
+var totalPairs = 6;
+var currencyItems = [];
+var dropZones = [];
+var calculator;
+var scoreText = new Text2('Score: 0', {
+ size: 40,
+ fill: 0xFFFFFF
+});
+scoreText.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreText);
+var phaseText = new Text2('Match Turkish Lira with Euro equivalents', {
+ size: 32,
+ fill: 0xFFD700
+});
+phaseText.anchor.set(0.5, 0);
+phaseText.y = 80;
+LK.gui.top.addChild(phaseText);
+var exchangeRateText = new Text2('Exchange Rate: 1 EUR = ' + exchangeRate + ' TL', {
+ size: 28,
+ fill: 0x00FF00
+});
+exchangeRateText.anchor.set(0.5, 0);
+exchangeRateText.y = 120;
+LK.gui.top.addChild(exchangeRateText);
+function convertCurrency(amount, fromCurrency, toCurrency) {
+ if (fromCurrency === 'tl' && toCurrency === 'euro') {
+ return amount / exchangeRate;
+ } else if (fromCurrency === 'euro' && toCurrency === 'tl') {
+ return amount * exchangeRate;
+ }
+ return amount;
+}
+function setupMatchingPhase() {
+ var tlValues = [1, 5, 10, 20, 50, 100];
+ var tlTypes = ['Coin', 'Coin', 'Coin', 'Note', 'Note', 'Note'];
+ for (var i = 0; i < tlValues.length; i++) {
+ var tlItem = new CurrencyItem(tlTypes[i], tlValues[i], 'tl');
+ tlItem.x = 200 + i % 3 * 200;
+ tlItem.y = 300 + Math.floor(i / 3) * 150;
+ currencyItems.push(tlItem);
+ game.addChild(tlItem);
+ var euroEquivalent = convertCurrency(tlValues[i], 'tl', 'euro');
+ var dropZone = new DropZone(euroEquivalent, 'euro');
+ dropZone.x = 1400 + i % 3 * 200;
+ dropZone.y = 300 + Math.floor(i / 3) * 150;
+ dropZones.push(dropZone);
+ game.addChild(dropZone);
+ }
+}
+function showCalculator() {
+ phaseText.setText('Use calculator to convert currencies');
+ calculator = new Calculator();
+ calculator.x = 1024;
+ calculator.y = 2200;
+ game.addChild(calculator);
+}
+function showAssessment() {
+ phaseText.setText('Assessment Complete!');
+ for (var i = 0; i < currencyItems.length; i++) {
+ currencyItems[i].destroy();
+ }
+ for (var i = 0; i < dropZones.length; i++) {
+ dropZones[i].destroy();
+ }
+ if (calculator) {
+ calculator.destroy();
+ }
+ var finalScore = LK.getScore();
+ var isProfit = finalScore >= 50;
+ if (isProfit) {
+ game.setBackgroundColor(0x006400);
+ LK.effects.flashScreen(0x00FF00, 1500);
+ LK.getSound('success').play();
+ var successText = new Text2('PROFIT! Well done!', {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ successText.anchor.set(0.5, 0.5);
+ successText.x = 1024;
+ successText.y = 1200;
+ game.addChild(successText);
+ } else {
+ game.setBackgroundColor(0x8B0000);
+ LK.effects.flashScreen(0xFF0000, 1500);
+ LK.getSound('warning').play();
+ var lossText = new Text2('LOSS! Try again!', {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ lossText.anchor.set(0.5, 0.5);
+ lossText.x = 1024;
+ lossText.y = 1200;
+ game.addChild(lossText);
+ }
+ LK.setTimeout(function () {
+ if (isProfit) {
+ LK.showYouWin();
+ } else {
+ LK.showGameOver();
+ }
+ }, 3000);
+}
+game.move = function (x, y, obj) {
+ if (gamePhase === 'matching') {
+ for (var i = 0; i < currencyItems.length; i++) {
+ if (currencyItems[i].isDragging) {
+ currencyItems[i].x = x;
+ currencyItems[i].y = y;
+ break;
+ }
+ }
+ }
+};
+setupMatchingPhase();
\ No newline at end of file