User prompt
astığımız adamın konumunu stand ve ipe göre yeniden ayarla
User prompt
adamı astığımızipin bağlı olduğu bir stand oluştur
User prompt
adamı astığımız ipin bağlı olduğu bir stand oluştur
User prompt
adamı astğımız ipin bağlı olduğu bir stand oluştur
User prompt
menüye girildiğinde ya da oyun bittiğinde menünnün arkasında kalan tuş takımı çalışmasın
User prompt
menüdeki ayarlar butonuna basınca gelen ekrana müzik ses ayarı ve genel ses ayarı ekle ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyunu duraklattığımızda "oyun bitti" ve cevap yerine "MENÜ" yazsın
User prompt
menüyü yukarıdan ve aşağıdan genişlet ve menüye devam et butonu ekle. menüye basıldığında oyun duraklasın ve devam et tuşun basıldığında devam etsin
User prompt
oyunun sonunda çıkan menüye oyun içindeyken erişebilmek için sağ üste menü tuşu ekle
User prompt
menü tuşlarına ses ekle
User prompt
ayarlar ve yapımcılar butonuna basıldığında gelen ekranda yazan "AYARLAR" ve "YAPIMCILAR" başlılarını gelen ekranın üstüne konumlandır
User prompt
yapımcılar ve ayarlar menüsündeki "AYARLAR" ve "YAPIMCILAR" yazılarını menünün en üstüne konumlandır
User prompt
ayarlar ve yapımcılar butonlarına basıldığında gelen ekranı menü ile orantılı boyutlara getir
User prompt
menü deki yazıları da iki kat büyült ve menüdeki objelerin arasındaki boşluklarıda iki kat arttır
User prompt
menüyü iki kat büyült ve oyun bitince menü dışındaki yerleri yarı saydam yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
konfetilerin boyutunu eski haline getir ve konfeti sayısını iki katına çıkar
User prompt
konfetileri büyült
User prompt
konfetiler ekranın sağından ve solundan orta yukarıya doğru dağılarak gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
kazanınca sağdan ve soldan konfeti patlasın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
kelime ilgili her oyun başı bir ipucu ver. Örneğin cevap "kedi" ise ipucu "hayvan" ya da cevap"masa" ise ipucu"eşya" olmalı.
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var localPos = self.toLocal(obj.parent.toGlobal(obj.position));' Line Number: 190
User prompt
oyun sona erdiğinde çıkacak bir arayüz yap. yeniden başlatma tuşu ayarlar tuşu ve credits tuşu bulunsun
User prompt
tahmin edilecek kelimeleri türk dil kurumu sözlüğünden rastgele seç
Code edit (1 edits merged)
Please save this source code
User prompt
Hangman Challenge
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Gallows = Container.expand(function () {
var self = Container.call(this);
var base = self.attachAsset('gallows', {
anchorX: 0.5,
anchorY: 1.0
});
var rope = self.attachAsset('rope', {
anchorX: 0.5,
anchorY: 0.0,
x: 100,
y: -380
});
self.bodyParts = [];
var head = LK.getAsset('head', {
anchorX: 0.5,
anchorY: 0.5,
x: 100,
y: -290
});
head.alpha = 0;
self.addChild(head);
self.bodyParts.push(head);
var body = LK.getAsset('body', {
anchorX: 0.5,
anchorY: 0.0,
x: 100,
y: -260
});
body.alpha = 0;
self.addChild(body);
self.bodyParts.push(body);
var leftArm = LK.getAsset('leftArm', {
anchorX: 1.0,
anchorY: 0.5,
x: 96,
y: -230
});
leftArm.alpha = 0;
leftArm.rotation = Math.PI / 4;
self.addChild(leftArm);
self.bodyParts.push(leftArm);
var rightArm = LK.getAsset('rightArm', {
anchorX: 0.0,
anchorY: 0.5,
x: 104,
y: -230
});
rightArm.alpha = 0;
rightArm.rotation = -Math.PI / 4;
self.addChild(rightArm);
self.bodyParts.push(rightArm);
var leftLeg = LK.getAsset('leftLeg', {
anchorX: 1.0,
anchorY: 0.5,
x: 96,
y: -160
});
leftLeg.alpha = 0;
leftLeg.rotation = Math.PI / 6;
self.addChild(leftLeg);
self.bodyParts.push(leftLeg);
var rightLeg = LK.getAsset('rightLeg', {
anchorX: 0.0,
anchorY: 0.5,
x: 104,
y: -160
});
rightLeg.alpha = 0;
rightLeg.rotation = -Math.PI / 6;
self.addChild(rightLeg);
self.bodyParts.push(rightLeg);
self.showBodyPart = function (partIndex) {
if (partIndex < self.bodyParts.length) {
self.bodyParts[partIndex].alpha = 1;
tween(self.bodyParts[partIndex], {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 200,
onFinish: function onFinish() {
tween(self.bodyParts[partIndex], {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 200
});
}
});
}
};
return self;
});
var GameOverMenu = Container.expand(function (isWin) {
var self = Container.call(this);
// Semi-transparent background overlay
var overlay = LK.getAsset('menuOverlay', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.95
});
self.addChild(overlay);
// Title text
var titleText = new Text2(isWin ? 'TEBRİKLER!' : 'OYUN BİTTİ', {
size: 60,
fill: isWin ? 0x00AA00 : 0xAA0000
});
titleText.anchor.set(0.5, 0.5);
titleText.y = -150;
self.addChild(titleText);
// Result text
var resultText = new Text2(isWin ? 'Kelimeyi doğru tahmin ettiniz!' : 'Kelime: ' + currentWord, {
size: 40,
fill: 0x333333
});
resultText.anchor.set(0.5, 0.5);
resultText.y = -80;
self.addChild(resultText);
// Restart button
var restartButton = LK.getAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
y: -10
});
self.addChild(restartButton);
var restartText = new Text2('YENİDEN BAŞLA', {
size: 30,
fill: 0xFFFFFF
});
restartText.anchor.set(0.5, 0.5);
restartText.y = -10;
self.addChild(restartText);
// Settings button
var settingsButton = LK.getAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
y: 80
});
self.addChild(settingsButton);
var settingsText = new Text2('AYARLAR', {
size: 30,
fill: 0xFFFFFF
});
settingsText.anchor.set(0.5, 0.5);
settingsText.y = 80;
self.addChild(settingsText);
// Credits button
var creditsButton = LK.getAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
y: 170
});
self.addChild(creditsButton);
var creditsText = new Text2('YAPIMCILAR', {
size: 30,
fill: 0xFFFFFF
});
creditsText.anchor.set(0.5, 0.5);
creditsText.y = 170;
self.addChild(creditsText);
// Button interactions
self.down = function (x, y, obj) {
// Use the x, y coordinates directly instead of complex coordinate conversion
// Check restart button
if (y >= -50 && y <= 30) {
restartGame();
}
// Check settings button
else if (y >= 40 && y <= 120) {
showSettings();
}
// Check credits button
else if (y >= 130 && y <= 210) {
showCredits();
}
};
return self;
});
var LetterButton = Container.expand(function (letter) {
var self = Container.call(this);
self.letter = letter;
self.isUsed = false;
var buttonBg = self.attachAsset('letterButton', {
anchorX: 0.5,
anchorY: 0.5
});
var letterText = new Text2(letter.toUpperCase(), {
size: 40,
fill: 0xFFFFFF
});
letterText.anchor.set(0.5, 0.5);
self.addChild(letterText);
self.markAsUsed = function () {
if (!self.isUsed) {
self.isUsed = true;
self.removeChild(buttonBg);
var usedBg = self.attachAsset('usedLetterButton', {
anchorX: 0.5,
anchorY: 0.5
});
letterText.tint = 0x999999;
}
};
self.down = function (x, y, obj) {
if (!self.isUsed) {
guessLetter(self.letter);
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xF5F5F5
});
/****
* Game Code
****/
var turkishWords = [
// Doğa ve Hayvanlar
'AKREP', 'ASLAN', 'AYGA', 'BALIK', 'BİZON', 'BÖCEK', 'BÜYÜ', 'ÇAKAL', 'ÇAYIR', 'ÇIYAN', 'DEVE', 'DOMUZU', 'EJDER', 'ELMAS', 'FAĞFUR', 'GEYIK', 'GÜVERCIN', 'HAMAM', 'HOROZ', 'ILIK', 'JAPON', 'KANAT', 'KARTAL', 'KEDİ', 'KIRPI', 'KÖPEK', 'KUĞU', 'KURBAĞA', 'KURT', 'KUZU', 'LAHANA', 'LEOPAR', 'MAYMUN', 'NERGIS', 'OKYANUS', 'ÖRDEK', 'PAPAĞAN', 'PENÇE', 'RÜZGAR', 'SALYANGOZ', 'TAVŞAN', 'TURNA', 'UYGAR', 'VAŞAK', 'YABAN', 'ZEBRA',
// Gıda ve İçecekler
'ARMUT', 'BADEM', 'BÖREK', 'ÇORBA', 'DOMATES', 'ELMA', 'FASULYE', 'GÜVEÇ', 'HELVA', 'IZGARA', 'JAMBON', 'KAHVE', 'LAHMACUN', 'MEYVE', 'NOHUT', 'OMLET', 'PEYNIR', 'REÇEL', 'SALATA', 'TAVUK', 'ÜZÜM', 'VIŞNE', 'YOĞURT', 'ZEYTİN',
// Eşyalar ve Nesneler
'ANAHTAR', 'BAVUL', 'ÇANTA', 'DOLAP', 'ELEKTRIK', 'FINCAN', 'GÖZLÜK', 'HALKA', 'IBRIK', 'JAPON', 'KALEM', 'LAMBA', 'MASA', 'NAMAZ', 'OKUL', 'PERDE', 'RADYO', 'SAAT', 'TELEFON', 'ÜTÜLÜ', 'VAZO', 'YAZICI', 'ZINCIR',
// Duygular ve Kavramlar
'AŞKA', 'BAHAR', 'CESARET', 'DOSTLUK', 'EMEK', 'FIKIR', 'GÜVEN', 'HAYAL', 'IŞIK', 'JIMNASTIK', 'KORKU', 'LÜTUF', 'MUTLULUK', 'NEFRET', 'OZLEM', 'PIŞMANLIK', 'RAHAT', 'SEVGI', 'TATLILUK', 'UMUT', 'VICDAN', 'YAŞAM', 'ZEVK',
// Meslekler ve İnsanlar
'AVUKAT', 'BERBER', 'CERRAH', 'DOKTOR', 'ELEKTRIKÇI', 'FIRIN', 'GARSON', 'HEMŞIRE', 'IŞÇI', 'JOKEY', 'KAPICI', 'LABORANT', 'MIMAR', 'NOTER', 'ÖĞRETMEN', 'PILOT', 'RESSAM', 'SÜRÜCÜ', 'TERZI', 'USTA', 'VETERINER', 'YAZAR', 'ZOOLOG',
// Mekanlar
'ANTIDEPO', 'BAHÇE', 'ÇARŞI', 'DERSHANE', 'ECZANE', 'FABRIKA', 'GALERİ', 'HASTANE', 'IŞHANE', 'JIMNASIUM', 'KAHVEHANE', 'LIMAN', 'MÜZE', 'OTOPARK', 'PLAZA', 'RESTORAN', 'STADYUM', 'TIYATRO', 'ÜNİVERSİTE', 'VİLLA', 'YURTLAR', 'ZOO',
// Renkler ve Şekiller
'AÇIK', 'BEYAZ', 'CYAN', 'DEVASA', 'EFLATUN', 'FÜME', 'GRİ', 'HAKI', 'INDIGO', 'JAPON', 'KAHVE', 'LACİVERT', 'MAVI', 'NARİN', 'OPAK', 'PEMBE', 'RENK', 'SARMAL', 'TURQUAZ', 'ULTRAMARIN', 'VİOLE', 'YEMYEŞIL', 'ZEYTUNİ',
// Ulaşım
'ARABA', 'BISIKLET', 'ÇAVLAK', 'DOLMUŞ', 'EKSPRES', 'FERIBOT', 'GEMI', 'HELIKOPTER', 'IKAR', 'JET', 'KAMYON', 'LİMUZİN', 'METRO', 'NİSAN', 'OTOBÜS', 'PLANE', 'ROKET', 'SCOOTER', 'TAKSI', 'UÇAK', 'VAPUR', 'YACHT', 'ZEPLİN',
// Teknoloji
'ALGORITMA', 'BLUETOOTH', 'COMPUTER', 'DATABASE', 'EMAIL', 'FIRMWARE', 'GOOGLE', 'HARDWARE', 'INTERNET', 'JAVA', 'KLAVYE', 'LAPTOP', 'MODEM', 'NETWORK', 'ONLINE', 'PROGRAM', 'ROUTER', 'SOFTWARE', 'TABLET', 'USB', 'VİRÜS', 'WİFİ', 'XEROX', 'YOUTUBE', 'ZIP',
// Spor ve Oyunlar
'ATLETIZM', 'BASKETBOL', 'CUDİ', 'DALGIC', 'ESKRİM', 'FUTBOL', 'GOLF', 'HALTER', 'ISLIK', 'JOKERI', 'KARATE', 'LUKS', 'MARATON', 'NIŞAN', 'OLIMPIK', 'PENALTI', 'RUGBY', 'SURFING', 'TENIS', 'UNIVERSITE', 'VOLEYBOL', 'WRESTLING', 'EXTREME', 'YOGA', 'ZUMBAİ',
// Müzik ve Sanat
'AKORD', 'BALE', 'CELLO', 'DANS', 'ESTETIK', 'FLÜT', 'GITAR', 'HEYKEL', 'IKONA', 'JAZZ', 'KLASIK', 'LIED', 'MÜZIK', 'NOTA', 'OPERA', 'PIYANO', 'RITIM', 'SENFONI', 'TABLO', 'UDIO', 'VİOLİN', 'WALTZ', 'XYLOPHONE', 'YAYLI', 'ZURNA'];
var currentWord = '';
var guessedLetters = [];
var wrongGuesses = 0;
var maxWrongGuesses = 6;
var gameOver = false;
var gallows;
var wordDisplay;
var letterButtons = [];
var statusText;
function initializeGame() {
currentWord = turkishWords[Math.floor(Math.random() * turkishWords.length)];
guessedLetters = [];
wrongGuesses = 0;
gameOver = false;
// Create gallows
gallows = game.addChild(new Gallows());
gallows.x = 300;
gallows.y = 600;
// Create word display
wordDisplay = new Text2(getDisplayWord(), {
size: 80,
fill: 0x333333
});
wordDisplay.anchor.set(0.5, 0.5);
wordDisplay.x = 1024;
wordDisplay.y = 800;
game.addChild(wordDisplay);
// Create letter buttons
var alphabet = 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ';
var buttonStartX = 200;
var buttonStartY = 1200;
var buttonsPerRow = 6;
var buttonSpacing = 140;
var rowSpacing = 100;
for (var i = 0; i < alphabet.length; i++) {
var button = new LetterButton(alphabet[i]);
var row = Math.floor(i / buttonsPerRow);
var col = i % buttonsPerRow;
button.x = buttonStartX + col * buttonSpacing;
button.y = buttonStartY + row * rowSpacing;
letterButtons.push(button);
game.addChild(button);
}
// Create status text
statusText = new Text2('Harfleri tahmin edin!', {
size: 50,
fill: 0x666666
});
statusText.anchor.set(0.5, 0.5);
statusText.x = 1024;
statusText.y = 950;
game.addChild(statusText);
}
function getDisplayWord() {
var display = '';
for (var i = 0; i < currentWord.length; i++) {
var letter = currentWord[i];
if (guessedLetters.indexOf(letter) !== -1) {
display += letter + ' ';
} else {
display += '_ ';
}
}
return display.trim();
}
function guessLetter(letter) {
if (gameOver || guessedLetters.indexOf(letter) !== -1) {
return;
}
guessedLetters.push(letter);
// Find and mark button as used
for (var i = 0; i < letterButtons.length; i++) {
if (letterButtons[i].letter === letter) {
letterButtons[i].markAsUsed();
break;
}
}
if (currentWord.indexOf(letter) !== -1) {
// Correct guess
LK.getSound('correct').play();
statusText.setText('Doğru tahmin!');
statusText.tint = 0x00AA00;
// Check if word is complete
var wordComplete = true;
for (var i = 0; i < currentWord.length; i++) {
if (guessedLetters.indexOf(currentWord[i]) === -1) {
wordComplete = false;
break;
}
}
if (wordComplete) {
gameOver = true;
statusText.setText('Tebrikler! Kazandınız!');
LK.getSound('win').play();
LK.setTimeout(function () {
showCustomGameOver(true);
}, 2000);
}
} else {
// Wrong guess
wrongGuesses++;
LK.getSound('wrong').play();
statusText.setText('Yanlış tahmin!');
statusText.tint = 0xAA0000;
gallows.showBodyPart(wrongGuesses - 1);
if (wrongGuesses >= maxWrongGuesses) {
gameOver = true;
statusText.setText('Kaybettiniz! Kelime: ' + currentWord);
LK.getSound('lose').play();
LK.setTimeout(function () {
showCustomGameOver(false);
}, 2000);
}
}
wordDisplay.setText(getDisplayWord());
// Reset status color after a delay
if (!gameOver) {
LK.setTimeout(function () {
statusText.setText('Harfleri tahmin edin!');
statusText.tint = 0x666666;
}, 1500);
}
}
var gameOverMenu;
function showCustomGameOver(isWin) {
gameOverMenu = game.addChild(new GameOverMenu(isWin));
gameOverMenu.x = 1024;
gameOverMenu.y = 1366;
}
function restartGame() {
if (gameOverMenu) {
game.removeChild(gameOverMenu);
gameOverMenu = null;
}
// Clear existing game elements
game.removeChild(gallows);
game.removeChild(wordDisplay);
game.removeChild(statusText);
for (var i = 0; i < letterButtons.length; i++) {
game.removeChild(letterButtons[i]);
}
letterButtons = [];
// Restart the game
initializeGame();
}
function showSettings() {
if (gameOverMenu) {
game.removeChild(gameOverMenu);
gameOverMenu = null;
}
var settingsMenu = game.addChild(new Container());
settingsMenu.x = 1024;
settingsMenu.y = 1366;
var settingsOverlay = LK.getAsset('menuOverlay', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.95
});
settingsMenu.addChild(settingsOverlay);
var settingsTitle = new Text2('AYARLAR', {
size: 50,
fill: 0x333333
});
settingsTitle.anchor.set(0.5, 0.5);
settingsTitle.y = -100;
settingsMenu.addChild(settingsTitle);
var settingsInfo = new Text2('Ses efektleri ve müzik\nayarları burada olacak', {
size: 30,
fill: 0x666666
});
settingsInfo.anchor.set(0.5, 0.5);
settingsMenu.addChild(settingsInfo);
var backButton = LK.getAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
y: 100
});
settingsMenu.addChild(backButton);
var backText = new Text2('GERİ', {
size: 30,
fill: 0xFFFFFF
});
backText.anchor.set(0.5, 0.5);
backText.y = 100;
settingsMenu.addChild(backText);
settingsMenu.down = function (x, y, obj) {
game.removeChild(settingsMenu);
gameOverMenu = game.addChild(new GameOverMenu(false));
gameOverMenu.x = 1024;
gameOverMenu.y = 1366;
};
}
function showCredits() {
if (gameOverMenu) {
game.removeChild(gameOverMenu);
gameOverMenu = null;
}
var creditsMenu = game.addChild(new Container());
creditsMenu.x = 1024;
creditsMenu.y = 1366;
var creditsOverlay = LK.getAsset('menuOverlay', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.95
});
creditsMenu.addChild(creditsOverlay);
var creditsTitle = new Text2('YAPIMCILAR', {
size: 50,
fill: 0x333333
});
creditsTitle.anchor.set(0.5, 0.5);
creditsTitle.y = -120;
creditsMenu.addChild(creditsTitle);
var creditsInfo = new Text2('Geliştirici: FRVR\nTasarım: Ava\nTürk Dil Kurumu Sözlüğü\nkullanılmıştır', {
size: 25,
fill: 0x666666
});
creditsInfo.anchor.set(0.5, 0.5);
creditsInfo.y = -20;
creditsMenu.addChild(creditsInfo);
var backButton = LK.getAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
y: 120
});
creditsMenu.addChild(backButton);
var backText = new Text2('GERİ', {
size: 30,
fill: 0xFFFFFF
});
backText.anchor.set(0.5, 0.5);
backText.y = 120;
creditsMenu.addChild(backText);
creditsMenu.down = function (x, y, obj) {
game.removeChild(creditsMenu);
gameOverMenu = game.addChild(new GameOverMenu(false));
gameOverMenu.x = 1024;
gameOverMenu.y = 1366;
};
}
// Initialize the game
initializeGame();
; ===================================================================
--- original.js
+++ change.js
@@ -166,19 +166,19 @@
creditsText.y = 170;
self.addChild(creditsText);
// Button interactions
self.down = function (x, y, obj) {
- var localPos = self.toLocal(obj.parent.toGlobal(obj.position));
+ // Use the x, y coordinates directly instead of complex coordinate conversion
// Check restart button
- if (localPos.y >= -50 && localPos.y <= 30) {
+ if (y >= -50 && y <= 30) {
restartGame();
}
- // Check settings button
- else if (localPos.y >= 40 && localPos.y <= 120) {
+ // Check settings button
+ else if (y >= 40 && y <= 120) {
showSettings();
}
// Check credits button
- else if (localPos.y >= 130 && localPos.y <= 210) {
+ else if (y >= 130 && y <= 210) {
showCredits();
}
};
return self;