User prompt
seviyeyi geçtiğimizde seviyeyi geçtin diye bir yazı çıksın ve altındada sonraki seviye yazsın sonraki seviye yazısına tıkladığımızda sonraki seviyeye geçelim bide Kelime bulmaca oyununda oyuncu harfleri tek tek dokunarak değil, parmağını ekranda sürükleyerek bağlamalı. Telefon desenini çizer gibi, harfler sürüklenerek birleşsin ve kelime oluşsun.” ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Uncaught TypeError: LK.getMusicVolume is not a function' in or related to this line: 'LK.playMusic('backgroundMusic', {' Line Number: 1234
User prompt
kelime bulma sistemini bir yuvarlak şeklinde yap ve harfleri sanki telefon deseni çiziyormuşuz gibi tutup sürükleyelim ve kelimeyi bulalım ve ayrıca oyuna bir arkaplan müziği ekle ayarlar kısmı olsun ve müzikğin sesini ayarlayabilelim ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
menüdeki herşey yani kısaca oyundaki her şey ingilizce olsun
User prompt
I want you to generate valid English words inside a longer word. Only use existing English dictionary words, not random syllables or letter combinations. Each word must have a real meaning in English. Do not invent new words and Do not repeat the same word in different levels
User prompt
oyunda 1000 seviye olsun ve her 300 bölümde zorluk seviyesi değişsin arada bir oyuncunun karşısına zor bölümlerde çıksın ve oyun hakkındaki herşey menüdeki hakkında kısmına yazılsın ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
kelime yanlış bilindiğinde kırmızı bir efekt kelimenin üzerinde olsun ve kelime sağa sola 2 saniye hareket etsin doğru bilindiğinde de yeşil bir efekt gelsin ve sağa sola yine 2 saniye hareket etsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
türkçe dil seçeneğini oyundan kaldır ve artık her kelime başına 5 coin kazanalım ve menüye bir hakkında kısmı ekle buraya oyunun hakkındakileri yaz nasıl oynandığına dair ki oyuncu oyunun nasıl oynandığını bilsin ve her 50 seviyede bir arkaplan ekle genellikle futuristik yerlerin fotoğrafı gibi olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
ingilizce dilini seçtiğimizde oyundaki bütün herşey ingilizce olsun bide türkçeyi seçtiğimizde kelimeleri türkçe alfabesiyle yaz ingilizceyi seçtiğimizde ingilizceyi kullan kelimeyi bulurken bir harfe bastığımızda onu sırayla 1,2,3 kelimenin üst tarafına koysun bir harfe bastğımızda onu ilk sıraya koysun ipucu kullandığımızda kelimenin içindeki harfin doğru yazılışındaki bir harfi üst taraftaki kutucuğa koysun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
menüdeyken başlata bastığımda kelime bulma yeri gelmiyor bunu düzelt ayrıca menüye dil seçenekleri kısmı ekle ve ordan türkçe veya ingilizceyi seçelim yani oyunu iki dildede oynaya bilelim
User prompt
bir ana sayfa yapalım başlat butonu olsun ve oyuncuyu kaldğı yerden geri başlatsın ayrıca her bir kelime bildiğin 10 para kazansın ve o paralarıda ipucu almak için kullansın ipucu almak için ayrı bir yer yap ve bir ipucu 50 para olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
en kolay seviye en uzun kelime orta seviyede uzun kelimenin içinde 1 kelime ve uzun kelim zor seviyedede uzun kelime ve uzun kelimenin içindeki 3 kelime uzun kelimenin içindeki kelimeleride türk dil kurumuna göre yap
User prompt
kullanılan kelimenin kendisi girilincede doğru sayılsın ve ayrıca kelimenin heceleri değil keliminenin içinden çıkabilecek kelimelerin hepsini girince doğru olup sonraki seviyeye geçilmesi lazım
User prompt
seviye bir bittikten sonra ve göndere basınca seviye 2 ye geçsin
User prompt
harflerin yerleri karıık olsun ve her seviyede 5 kelime olsun ben sana oyun içinde kullanacağın kelimeler bu kodun içerisinde # -*- coding: utf-8 -*- import requests from HTMLParser import HTMLParser import re class PageNumParser(HTMLParser): def handle_data(self, data): if "sayfanın" in data: getContent(int(re.search(r'\d+', data).group())) class wordParser(HTMLParser): def handle_starttag(self, tag, attrs): if tag == "a" and len(attrs) == 1: for attr in attrs: word = re.search(r"kelime=(.*)&cesit", attr[1]) print word.group(1) def getContent(totalPageCount): currentPage = 0 while totalPageCount > currentPage/60: pageURL = "http://tdk.gov.tr/index.php?option=com_yazimkilavuzu&view=yazimkilavuzu&kelime1=z&kategori1=yazim_listeli&ayn1=bas&konts=" + str(currentPage) response = requests.get(pageURL, headers={'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'}, timeout=15) wordParser.feed(response.content.split('')[1].split(" ")[0]) currentPage = currentPage + 60 pageNumParser = PageNumParser() wordParser = wordParser() pageURL = "http://tdk.gov.tr/index.php?option=com_yazimkilavuzu&view=yazimkilavuzu&kelime1=z&kategori1=yazim_listeli&ayn1=bas&konts=0" response = requests.get(pageURL, headers={'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'}, timeout=15) pageNumParser.feed(response.content.split('')[1].split("")[0])
User prompt
kelimeyi doğru bildiğimizde sonraki seviyeye geçelim ve oyunda 150 seviye olsun
User prompt
oyun tüm ekranı kaplasın ve yapacağımız kelimeyi söylemesin
Code edit (1 edits merged)
Please save this source code
User prompt
Kelime Avı - Harf Ustası
Initial prompt
bir kelime bulma oyunu yapalım harflerle kelime bulalım ismi en uzun kelimenin içinden diğer kelimeleri bulalım ve oyundaki kelimeleri Türk Dil Kurumundan seç ve bu oyunda sonsuz level olsun oyun hiç bitmesin oyuncu zorlandığı zaman bir harf çıkarabilmek için bir ipucu kutusu olsun ama 2 hakkı olsun her 50 levelde bir 1 ipucu kutusu hediyesi verilsin
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var LetterTile = Container.expand(function (letter, index) {
var self = Container.call(this);
var background = self.attachAsset('letterTile', {
anchorX: 0.5,
anchorY: 0.5
});
var letterText = new Text2(letter.toUpperCase(), {
size: 50,
fill: 0x333333
});
letterText.anchor.set(0.5, 0.5);
self.addChild(letterText);
self.letter = letter;
self.index = index;
self.isSelected = false;
self.background = background;
self.letterText = letterText;
self.setSelected = function (selected) {
self.isSelected = selected;
if (selected) {
self.background.tint = 0x4CAF50;
} else {
self.background.tint = 0xffffff;
}
};
self.down = function (x, y, obj) {
if (!self.isSelected) {
selectedLetters.push(self);
self.setSelected(true);
updateCurrentWord();
updateSequenceDisplay();
LK.getSound('buttonClick').play();
}
};
return self;
});
var WordItem = Container.expand(function (word, points) {
var self = Container.call(this);
var background = self.attachAsset('wordBackground', {
anchorX: 0,
anchorY: 0.5
});
background.alpha = 0.8;
var wordText = new Text2(word.toUpperCase(), {
size: 36,
fill: 0x333333
});
wordText.anchor.set(0, 0.5);
wordText.x = 15;
self.addChild(wordText);
var pointText = new Text2('+' + points, {
size: 30,
fill: 0x4CAF50
});
pointText.anchor.set(1, 0.5);
pointText.x = 580;
self.addChild(pointText);
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xffffff
});
/****
* Game Code
****/
// Game data and word lists - 150 levels total with difficulty progression
var currentLanguage = storage.currentLanguage || 'turkish';
var turkishWordLists = [];
var englishWordLists = [];
var wordLists = [];
// Language strings
var languageStrings = {
turkish: {
title: 'KELİME OYUNU',
start: 'BAŞLAT',
money: 'PARA',
level: 'SEVİYE',
languageSelection: 'DİL SEÇİMİ:',
buyHint: 'İPUCU SATIN AL',
oneHint: '1 İPUCU = 50 PARA',
yourMoney: 'PARAN',
buy: 'SATIN AL',
back: 'GERİ',
send: 'GÖNDER',
clear: 'TEMİZLE',
hint: 'İPUCU',
buyHintShort: 'İPUCU\nAL',
menu: 'MENÜ',
score: 'SKOR',
hintText: 'İPUCU: ',
completedAll: 'TEBRİKLER! TÜM SEVİYELERİ TAMAMLADINIZ!',
bonusHint: '+1 İPUCU BONUS!'
},
english: {
title: 'WORD GAME',
start: 'START',
money: 'COINS',
level: 'LEVEL',
languageSelection: 'LANGUAGE:',
buyHint: 'BUY HINT',
oneHint: '1 HINT = 50 COINS',
yourMoney: 'YOUR COINS',
buy: 'BUY',
back: 'BACK',
send: 'SUBMIT',
clear: 'CLEAR',
hint: 'HINT',
buyHintShort: 'BUY\nHINT',
menu: 'MENU',
score: 'SCORE',
hintText: 'HINTS: ',
completedAll: 'CONGRATULATIONS! ALL LEVELS COMPLETED!',
bonusHint: '+1 HINT BONUS!'
}
};
// Function to get localized string
function getString(key) {
return languageStrings[currentLanguage][key] || key;
}
// Alphabet definitions
var turkishAlphabet = 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ';
var englishAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
function getAlphabet() {
return currentLanguage === 'turkish' ? turkishAlphabet : englishAlphabet;
}
// EASY LEVELS (1-50): Only the main word can be found
var easyWords = ["KALEM", "KITAP", "OKUL", "MASA", "KEDI", "KOPEK", "ELMA", "ARMUT", "SEKER", "EKMEK", "GUNES", "YAGMUR", "KARLI", "SICAK", "SOGUK", "MUTLU", "UZGUN", "HIZLI", "YAVAS", "BUYUK", "KUCUK", "UZUN", "KISA", "GENIS", "DAR", "YENI", "ESKI", "GUZEL", "CIRKIN", "TEMIZ", "KIRLI", "BEYAZ", "SIYAH", "KIRMIZI", "MAVI", "YESIL", "SARI", "PEMBE", "MOR", "TURUNCU", "DOKTOR", "OGRETMEN", "POLIS", "ITFAIYE", "ASCI", "BERBER", "TERZI", "KAPICI", "GARSON", "SOFOR"];
for (var i = 0; i < 50; i++) {
turkishWordLists.push({
word: easyWords[i],
words: []
});
}
// MEDIUM LEVELS (51-100): Main word + 1 sub-word that can be made from the letters
var mediumLevels = [{
word: "PENCERE",
words: ["PEN"]
}, {
word: "TABLETU",
words: ["TAB"]
}, {
word: "KAHVALT",
words: ["KAH"]
}, {
word: "OKUYUCU",
words: ["OKU"]
}, {
word: "YAZILIM",
words: ["YAZ"]
}, {
word: "GELISIM",
words: ["GEL"]
}, {
word: "MUTLULUK",
words: ["MUT"]
}, {
word: "DOSTLUK",
words: ["DOS"]
}, {
word: "KARDESLIK",
words: ["KAR"]
}, {
word: "SEVGILIK",
words: ["SEV"]
}, {
word: "OYUNCAK",
words: ["OYN"]
}, {
word: "KITAPLIK",
words: ["KIT"]
}, {
word: "MASALAR",
words: ["MAS"]
}, {
word: "EVLERDE",
words: ["EV"]
}, {
word: "SEHIRLER",
words: ["SEH"]
}, {
word: "AILELER",
words: ["AIL"]
}, {
word: "ARKADAS",
words: ["ARK"]
}, {
word: "MERHABA",
words: ["MER"]
}, {
word: "GUNAYDIN",
words: ["GUN"]
}, {
word: "TESEKKUR",
words: ["TES"]
}, {
word: "HOSGELDIN",
words: ["HOS"]
}, {
word: "GORUSMEK",
words: ["GOR"]
}, {
word: "HABERLER",
words: ["HAB"]
}, {
word: "GELECEK",
words: ["GEL"]
}, {
word: "ZAMANLAR",
words: ["ZAM"]
}, {
word: "DUNYADA",
words: ["DUN"]
}, {
word: "HAYATTA",
words: ["HAY"]
}, {
word: "BILGILER",
words: ["BIL"]
}, {
word: "DERSLERI",
words: ["DER"]
}, {
word: "OGRETMEN",
words: ["OGR"]
}, {
word: "OKULLAR",
words: ["OKL"]
}, {
word: "EVIMIZDE",
words: ["EVI"]
}, {
word: "AILELERIMIZ",
words: ["AIL"]
}, {
word: "ARKADALAR",
words: ["ARK"]
}, {
word: "DOSTLUK",
words: ["DOS"]
}, {
word: "SEVGILIK",
words: ["SEV"]
}, {
word: "MUTLULUK",
words: ["MUT"]
}, {
word: "KAHVALTI",
words: ["KAH"]
}, {
word: "YEMEKLER",
words: ["YEM"]
}, {
word: "ICECEKLER",
words: ["ICE"]
}, {
word: "MEYVELER",
words: ["MEY"]
}, {
word: "SEBZELER",
words: ["SEB"]
}, {
word: "ETKINLIK",
words: ["ETK"]
}, {
word: "OYUNLAR",
words: ["OYN"]
}, {
word: "SPORCULAR",
words: ["SPO"]
}, {
word: "SANATCI",
words: ["SAN"]
}, {
word: "MUZISYEN",
words: ["MUZ"]
}, {
word: "RESSAMLAR",
words: ["RES"]
}, {
word: "YAZARLAR",
words: ["YAZ"]
}, {
word: "SAIRLER",
words: ["SAI"]
}, {
word: "FILMLER",
words: ["FIL"]
}, {
word: "DIZILER",
words: ["DIZ"]
}];
for (var i = 0; i < 50; i++) {
turkishWordLists.push(mediumLevels[i]);
}
// HARD LEVELS (101-150): Main word + 3 sub-words that can be made from the letters
var hardLevels = [{
word: "BILGISAYAR",
words: ["BIL", "GIS", "AYA"]
}, {
word: "TELEVIZYON",
words: ["TEL", "VIZ", "YON"]
}, {
word: "TELEFON",
words: ["TEL", "FON", "ELF"]
}, {
word: "INTERNET",
words: ["INT", "NET", "TER"]
}, {
word: "BILGILER",
words: ["BIL", "GIL", "LER"]
}, {
word: "PROGRAM",
words: ["PRO", "RAM", "GRA"]
}, {
word: "SISTEMI",
words: ["SIS", "TEM", "EMI"]
}, {
word: "TEKNOLOJI",
words: ["TEK", "NOL", "LOJ"]
}, {
word: "MATEMATIK",
words: ["MAT", "TEM", "TIK"]
}, {
word: "GEOMETRI",
words: ["GEO", "MET", "TRI"]
}, {
word: "COGRAFYA",
words: ["COG", "RAF", "YAF"]
}, {
word: "TARIH",
words: ["TAR", "IH", "HI"]
}, {
word: "EDEBIYAT",
words: ["EDE", "BIY", "YAT"]
}, {
word: "FIZIK",
words: ["FIZ", "ZIK", "IK"]
}, {
word: "KIMYA",
words: ["KIM", "MYA", "YA"]
}, {
word: "BIYOLOJI",
words: ["BIY", "OLO", "LOJ"]
}, {
word: "INGILIZCE",
words: ["ING", "LIZ", "ZCE"]
}, {
word: "FRANSIZCA",
words: ["FRA", "SIZ", "ZCA"]
}, {
word: "ALMANCA",
words: ["ALM", "MAN", "ANC"]
}, {
word: "TURKCE",
words: ["TUR", "KCE", "CE"]
}, {
word: "RESIM",
words: ["RES", "SIM", "IM"]
}, {
word: "MUZIK",
words: ["MUZ", "ZIK", "IK"]
}, {
word: "BEDEN",
words: ["BED", "DEN", "EN"]
}, {
word: "SAGLIK",
words: ["SAG", "LIK", "IK"]
}, {
word: "SPOR",
words: ["SPO", "OR", "R"]
}, {
word: "FUTBOL",
words: ["FUT", "BOL", "OL"]
}, {
word: "BASKETBOL",
words: ["BAS", "KET", "BOL"]
}, {
word: "VOLEYBOL",
words: ["VOL", "EY", "BOL"]
}, {
word: "TENIS",
words: ["TEN", "NIS", "IS"]
}, {
word: "YUZME",
words: ["YUZ", "ZME", "ME"]
}, {
word: "KOSU",
words: ["KOS", "OSU", "SU"]
}, {
word: "BISIKLET",
words: ["BIS", "IK", "LET"]
}, {
word: "OTOMOBIL",
words: ["OTO", "MOB", "BIL"]
}, {
word: "OTOBUS",
words: ["OTO", "BUS", "US"]
}, {
word: "TREN",
words: ["TR", "REN", "EN"]
}, {
word: "UCAK",
words: ["UC", "CAK", "AK"]
}, {
word: "GEMI",
words: ["GEM", "EMI", "MI"]
}, {
word: "BISIKLET",
words: ["BIS", "IK", "LET"]
}, {
word: "MOTOSIKLET",
words: ["MOT", "SIK", "LET"]
}, {
word: "TAKMISI",
words: ["TAK", "MIS", "SI"]
}, {
word: "OYUNCU",
words: ["OY", "YUN", "CU"]
}, {
word: "HAKEM",
words: ["HAK", "KEM", "EM"]
}, {
word: "ANTRENOR",
words: ["ANT", "REN", "NOR"]
}, {
word: "SAYGIN",
words: ["SAY", "YGI", "GIN"]
}, {
word: "BASARI",
words: ["BAS", "SAR", "ARI"]
}, {
word: "GALIBIYET",
words: ["GAL", "IBY", "YET"]
}, {
word: "MAGLUBIYE",
words: ["MAG", "LUB", "BIY"]
}, {
word: "BERABERE",
words: ["BER", "RAB", "ERE"]
}, {
word: "TAKIMLAR",
words: ["TAK", "KIM", "LAR"]
}, {
word: "TURNUVA",
words: ["TUR", "NUV", "VAL"]
}, {
word: "SAMPIYONLUK",
words: ["SAM", "PIY", "LUK"]
}];
for (var i = 0; i < 50; i++) {
turkishWordLists.push(hardLevels[i]);
}
// English word lists
var englishEasyWords = ["PAPER", "BOOK", "SCHOOL", "TABLE", "CAT", "DOG", "APPLE", "PEAR", "SUGAR", "BREAD", "SUN", "RAIN", "SNOW", "HOT", "COLD", "HAPPY", "SAD", "FAST", "SLOW", "BIG", "SMALL", "LONG", "SHORT", "WIDE", "NARROW", "NEW", "OLD", "NICE", "UGLY", "CLEAN", "DIRTY", "WHITE", "BLACK", "RED", "BLUE", "GREEN", "YELLOW", "PINK", "PURPLE", "ORANGE", "DOCTOR", "TEACHER", "POLICE", "FIRE", "COOK", "BARBER", "TAILOR", "GUARD", "WAITER", "DRIVER"];
for (var i = 0; i < 50; i++) {
englishWordLists.push({
word: englishEasyWords[i],
words: []
});
}
// English medium levels
var englishMediumLevels = [{
word: "WINDOW",
words: ["WIN"]
}, {
word: "TABLET",
words: ["TAB"]
}, {
word: "BREAKFAST",
words: ["BREAK"]
}, {
word: "READER",
words: ["READ"]
}, {
word: "WRITER",
words: ["WRITE"]
}, {
word: "DEVELOP",
words: ["DEV"]
}, {
word: "HAPPINESS",
words: ["HAPPY"]
}, {
word: "FRIENDSHIP",
words: ["FRIEND"]
}, {
word: "BROTHER",
words: ["BRO"]
}, {
word: "SISTER",
words: ["SIS"]
}, {
word: "TOYBOX",
words: ["TOY"]
}, {
word: "LIBRARY",
words: ["LIB"]
}, {
word: "TABLES",
words: ["TABLE"]
}, {
word: "HOUSES",
words: ["HOUSE"]
}, {
word: "CITIES",
words: ["CITY"]
}, {
word: "FAMILIES",
words: ["FAMILY"]
}, {
word: "FRIEND",
words: ["FRIE"]
}, {
word: "HELLO",
words: ["HEL"]
}, {
word: "MORNING",
words: ["MORN"]
}, {
word: "THANKS",
words: ["THANK"]
}, {
word: "WELCOME",
words: ["COME"]
}, {
word: "MEETING",
words: ["MEET"]
}, {
word: "NEWS",
words: ["NEW"]
}, {
word: "FUTURE",
words: ["FUT"]
}, {
word: "TIMES",
words: ["TIME"]
}, {
word: "WORLD",
words: ["WOR"]
}, {
word: "LIFE",
words: ["LIF"]
}, {
word: "KNOWLEDGE",
words: ["KNOW"]
}, {
word: "LESSONS",
words: ["LES"]
}, {
word: "TEACHER",
words: ["TEACH"]
}, {
word: "SCHOOLS",
words: ["SCH"]
}, {
word: "HOME",
words: ["HOM"]
}, {
word: "FAMILY",
words: ["FAM"]
}, {
word: "FRIENDS",
words: ["FRI"]
}, {
word: "FRIENDSHIP",
words: ["FRIEND"]
}, {
word: "LOVE",
words: ["LOV"]
}, {
word: "HAPPINESS",
words: ["HAPPY"]
}, {
word: "BREAKFAST",
words: ["BREAK"]
}, {
word: "MEALS",
words: ["MEAL"]
}, {
word: "DRINKS",
words: ["DRINK"]
}, {
word: "FRUITS",
words: ["FRUIT"]
}, {
word: "VEGETABLES",
words: ["VEG"]
}, {
word: "ACTIVITY",
words: ["ACT"]
}, {
word: "GAMES",
words: ["GAME"]
}, {
word: "SPORTS",
words: ["SPORT"]
}, {
word: "ARTIST",
words: ["ART"]
}, {
word: "MUSICIAN",
words: ["MUS"]
}, {
word: "PAINTERS",
words: ["PAINT"]
}, {
word: "WRITERS",
words: ["WRITE"]
}, {
word: "POETS",
words: ["POET"]
}, {
word: "MOVIES",
words: ["MOVIE"]
}, {
word: "SERIES",
words: ["SER"]
}];
for (var i = 0; i < 50; i++) {
englishWordLists.push(englishMediumLevels[i]);
}
// English hard levels
var englishHardLevels = [{
word: "COMPUTER",
words: ["COM", "PUT", "TER"]
}, {
word: "TELEVISION",
words: ["TEL", "VIS", "ION"]
}, {
word: "TELEPHONE",
words: ["TEL", "PHONE", "ONE"]
}, {
word: "INTERNET",
words: ["INT", "NET", "TER"]
}, {
word: "INFORMATION",
words: ["INF", "FOR", "TION"]
}, {
word: "PROGRAM",
words: ["PRO", "GRAM", "RAM"]
}, {
word: "SYSTEM",
words: ["SYS", "TEM", "EM"]
}, {
word: "TECHNOLOGY",
words: ["TECH", "NOL", "OGY"]
}, {
word: "MATHEMATICS",
words: ["MATH", "MAT", "TICS"]
}, {
word: "GEOMETRY",
words: ["GEO", "MET", "TRY"]
}, {
word: "GEOGRAPHY",
words: ["GEO", "GRAPH", "PHY"]
}, {
word: "HISTORY",
words: ["HIS", "TORY", "ORY"]
}, {
word: "LITERATURE",
words: ["LIT", "ERAT", "TURE"]
}, {
word: "PHYSICS",
words: ["PHY", "SIC", "ICS"]
}, {
word: "CHEMISTRY",
words: ["CHEM", "IST", "RY"]
}, {
word: "BIOLOGY",
words: ["BIO", "LOG", "GY"]
}, {
word: "ENGLISH",
words: ["ENG", "LISH", "ISH"]
}, {
word: "FRENCH",
words: ["FRE", "NCH", "CH"]
}, {
word: "GERMAN",
words: ["GER", "MAN", "AN"]
}, {
word: "SPANISH",
words: ["SPA", "NISH", "ISH"]
}, {
word: "PICTURE",
words: ["PIC", "TURE", "URE"]
}, {
word: "MUSIC",
words: ["MUS", "SIC", "IC"]
}, {
word: "PHYSICAL",
words: ["PHY", "SIC", "CAL"]
}, {
word: "HEALTH",
words: ["HEA", "LTH", "TH"]
}, {
word: "SPORTS",
words: ["SPO", "RTS", "TS"]
}, {
word: "FOOTBALL",
words: ["FOOT", "BALL", "ALL"]
}, {
word: "BASKETBALL",
words: ["BASKET", "BALL", "ALL"]
}, {
word: "VOLLEYBALL",
words: ["VOLLEY", "BALL", "ALL"]
}, {
word: "TENNIS",
words: ["TEN", "NIS", "IS"]
}, {
word: "SWIMMING",
words: ["SWIM", "MING", "ING"]
}, {
word: "RUNNING",
words: ["RUN", "NING", "ING"]
}, {
word: "BICYCLE",
words: ["BIKE", "CYCLE", "CLE"]
}, {
word: "AUTOMOBILE",
words: ["AUTO", "MOBILE", "BILE"]
}, {
word: "BUSINESS",
words: ["BUS", "NESS", "ESS"]
}, {
word: "TRAIN",
words: ["TRA", "AIN", "IN"]
}, {
word: "AIRPLANE",
words: ["AIR", "PLANE", "ANE"]
}, {
word: "SHIP",
words: ["SH", "HIP", "IP"]
}, {
word: "BICYCLE",
words: ["BIKE", "CYCLE", "CLE"]
}, {
word: "MOTORCYCLE",
words: ["MOTOR", "CYCLE", "CLE"]
}, {
word: "TEAM",
words: ["TEA", "EAM", "AM"]
}, {
word: "PLAYER",
words: ["PLAY", "LAYER", "YER"]
}, {
word: "REFEREE",
words: ["REF", "REE", "EE"]
}, {
word: "TRAINER",
words: ["TRAIN", "AINER", "NER"]
}, {
word: "RESPECT",
words: ["RES", "PECT", "ECT"]
}, {
word: "SUCCESS",
words: ["SUC", "CESS", "ESS"]
}, {
word: "VICTORY",
words: ["VIC", "TORY", "ORY"]
}, {
word: "DEFEAT",
words: ["DEF", "FEAT", "EAT"]
}, {
word: "BALANCE",
words: ["BAL", "LANCE", "NCE"]
}, {
word: "TEAMS",
words: ["TEA", "EAMS", "AMS"]
}, {
word: "TOURNAMENT",
words: ["TOUR", "MENT", "ENT"]
}, {
word: "CHAMPIONSHIP",
words: ["CHAMP", "SHIP", "HIP"]
}];
for (var i = 0; i < 50; i++) {
englishWordLists.push(englishHardLevels[i]);
}
// Language switching function
function setLanguage(language) {
currentLanguage = language;
storage.currentLanguage = language;
if (language === 'turkish') {
wordLists = turkishWordLists;
} else {
wordLists = englishWordLists;
}
// Reset game to level 1 when switching languages
currentLevel = 0;
storage.currentLevel = 0;
currentWordData = wordLists[currentLevel % wordLists.length];
// Update all UI texts
updateAllUITexts();
}
// Function to update all UI texts based on current language
function updateAllUITexts() {
// Menu texts
titleText.setText(getString('title'));
startButtonText.setText(getString('start'));
menuCoinsText.setText(getString('money') + ': ' + coins);
menuLevelText.setText(getString('level') + ': ' + (currentLevel + 1));
languageText.setText(getString('languageSelection'));
// Buy hint menu texts
buyHintTitleText.setText(getString('buyHint'));
buyHintInfoText.setText(getString('oneHint'));
buyHintCoinsText.setText(getString('yourMoney') + ': ' + coins);
buyHintButtonText.setText(getString('buy'));
backFromBuyButtonText.setText(getString('back'));
// Game UI texts
levelText.setText(getString('level') + ' ' + (currentLevel + 1));
coinsText.setText(getString('money') + ': ' + coins);
scoreText.setText(getString('score') + ': ' + totalScore);
hintText.setText(getString('hintText') + hintCount);
submitText.setText(getString('send'));
clearText.setText(getString('clear'));
hintButtonText.setText(getString('hint'));
buyHintGameText.setText(getString('buyHintShort'));
backToMenuText.setText(getString('menu'));
}
// Set initial language
if (currentLanguage === 'turkish') {
wordLists = turkishWordLists;
} else {
wordLists = englishWordLists;
}
// Game state
var gameState = 'menu'; // 'menu', 'playing', 'buying'
var currentLevel = storage.currentLevel || 0;
var totalScore = storage.totalScore || 0;
var coins = storage.coins || 0;
var hintCount = storage.hintCount || 2;
var currentWordData = wordLists[currentLevel % wordLists.length];
var foundWords = [];
var selectedLetters = [];
var currentWord = "";
var letterTiles = [];
var foundWordItems = [];
// Main Menu Elements
var menuContainer = new Container();
game.addChild(menuContainer);
var titleText = new Text2('KELİME OYUNU', {
size: 80,
fill: 0x2196F3
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 800;
menuContainer.addChild(titleText);
var startButton = menuContainer.addChild(LK.getAsset('menuButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1200,
scaleX: 1.5,
scaleY: 1.5
}));
var startButtonText = new Text2('BAŞLAT', {
size: 48,
fill: 0xFFFFFF
});
startButtonText.anchor.set(0.5, 0.5);
startButtonText.x = 1024;
startButtonText.y = 1200;
menuContainer.addChild(startButtonText);
var menuCoinsText = new Text2('PARA: ' + coins, {
size: 42,
fill: 0xFFD700
});
menuCoinsText.anchor.set(0.5, 0.5);
menuCoinsText.x = 1024;
menuCoinsText.y = 1000;
menuContainer.addChild(menuCoinsText);
var menuLevelText = new Text2('SEVİYE: ' + (currentLevel + 1), {
size: 36,
fill: 0x666666
});
menuLevelText.anchor.set(0.5, 0.5);
menuLevelText.x = 1024;
menuLevelText.y = 1400;
menuContainer.addChild(menuLevelText);
// Language selection
var languageText = new Text2('DİL SEÇİMİ:', {
size: 36,
fill: 0x666666
});
languageText.anchor.set(0.5, 0.5);
languageText.x = 1024;
languageText.y = 1550;
menuContainer.addChild(languageText);
var turkishButton = menuContainer.addChild(LK.getAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 824,
y: 1650,
scaleX: 1.2,
scaleY: 1.2
}));
var turkishButtonText = new Text2('TÜRKÇE', {
size: 32,
fill: 0xFFFFFF
});
turkishButtonText.anchor.set(0.5, 0.5);
turkishButtonText.x = 824;
turkishButtonText.y = 1650;
menuContainer.addChild(turkishButtonText);
var englishButton = menuContainer.addChild(LK.getAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1224,
y: 1650,
scaleX: 1.2,
scaleY: 1.2
}));
var englishButtonText = new Text2('ENGLISH', {
size: 32,
fill: 0xFFFFFF
});
englishButtonText.anchor.set(0.5, 0.5);
englishButtonText.x = 1224;
englishButtonText.y = 1650;
menuContainer.addChild(englishButtonText);
turkishButton.down = function () {
setLanguage('turkish');
LK.getSound('buttonClick').play();
};
englishButton.down = function () {
setLanguage('english');
LK.getSound('buttonClick').play();
};
startButton.down = function () {
startGame();
initializeLetterTiles();
LK.getSound('buttonClick').play();
};
// Buy Hint Menu Elements
var buyHintContainer = new Container();
buyHintContainer.visible = false;
game.addChild(buyHintContainer);
var buyHintTitleText = new Text2('İPUCU SATIN AL', {
size: 60,
fill: 0xFF9800
});
buyHintTitleText.anchor.set(0.5, 0.5);
buyHintTitleText.x = 1024;
buyHintTitleText.y = 800;
buyHintContainer.addChild(buyHintTitleText);
var buyHintInfoText = new Text2('1 İPUCU = 50 PARA', {
size: 42,
fill: 0x666666
});
buyHintInfoText.anchor.set(0.5, 0.5);
buyHintInfoText.x = 1024;
buyHintInfoText.y = 1000;
buyHintContainer.addChild(buyHintInfoText);
var buyHintCoinsText = new Text2('PARAN: ' + coins, {
size: 36,
fill: 0xFFD700
});
buyHintCoinsText.anchor.set(0.5, 0.5);
buyHintCoinsText.x = 1024;
buyHintCoinsText.y = 1100;
buyHintContainer.addChild(buyHintCoinsText);
var buyHintButton = buyHintContainer.addChild(LK.getAsset('buyHintButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 824,
y: 1300,
scaleX: 1.2,
scaleY: 1.2
}));
var buyHintButtonText = new Text2('SATIN AL', {
size: 36,
fill: 0xFFFFFF
});
buyHintButtonText.anchor.set(0.5, 0.5);
buyHintButtonText.x = 824;
buyHintButtonText.y = 1300;
buyHintContainer.addChild(buyHintButtonText);
var backFromBuyButton = buyHintContainer.addChild(LK.getAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1224,
y: 1300,
scaleX: 1.2,
scaleY: 1.2
}));
var backFromBuyButtonText = new Text2('GERİ', {
size: 36,
fill: 0xFFFFFF
});
backFromBuyButtonText.anchor.set(0.5, 0.5);
backFromBuyButtonText.x = 1224;
backFromBuyButtonText.y = 1300;
buyHintContainer.addChild(backFromBuyButtonText);
buyHintButton.down = function () {
buyHint();
};
backFromBuyButton.down = function () {
showBuyHintMenu(false);
};
// Game UI Container
var gameContainer = new Container();
gameContainer.visible = false;
game.addChild(gameContainer);
// UI Elements - Scaled for full screen
var levelText = new Text2('SEVIYE ' + (currentLevel + 1), {
size: 54,
fill: 0x333333
});
levelText.anchor.set(0.5, 0);
levelText.x = 1024;
levelText.y = 150;
gameContainer.addChild(levelText);
var currentWordDisplay = new Text2('', {
size: 48,
fill: 0x666666
});
currentWordDisplay.anchor.set(0.5, 0.5);
currentWordDisplay.x = 1024;
currentWordDisplay.y = 650;
gameContainer.addChild(currentWordDisplay);
var coinsText = new Text2('PARA: ' + coins, {
size: 36,
fill: 0xFFD700
});
coinsText.anchor.set(1, 0);
coinsText.x = 2000;
coinsText.y = 50;
gameContainer.addChild(coinsText);
var scoreText = new Text2('SKOR: ' + totalScore, {
size: 42,
fill: 0x333333
});
scoreText.anchor.set(1, 0);
scoreText.x = 2000;
scoreText.y = 100;
gameContainer.addChild(scoreText);
var hintText = new Text2('İPUCU: ' + hintCount, {
size: 36,
fill: 0xFF9800
});
hintText.anchor.set(0, 0);
hintText.x = 150;
hintText.y = 50;
gameContainer.addChild(hintText);
// Progress bar - Larger and repositioned
var progressBg = gameContainer.addChild(LK.getAsset('progressBg', {
anchorX: 0.5,
anchorY: 0,
x: 1024,
y: 250,
scaleX: 2,
scaleY: 1.5
}));
var progressFill = gameContainer.addChild(LK.getAsset('progressBar', {
anchorX: 0,
anchorY: 0,
x: 624,
y: 250,
scaleX: 0,
scaleY: 1.5
}));
// Submit button - Larger
var submitButton = gameContainer.addChild(LK.getAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 750,
scaleX: 1.5,
scaleY: 1.5
}));
var submitText = new Text2('GÖNDER', {
size: 36,
fill: 0xFFFFFF
});
submitText.anchor.set(0.5, 0.5);
submitText.x = 1024;
submitText.y = 750;
gameContainer.addChild(submitText);
submitButton.down = function (x, y, obj) {
submitWord();
};
// Clear button - Larger and repositioned
var clearButton = gameContainer.addChild(LK.getAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 624,
y: 750,
scaleX: 1.5,
scaleY: 1.5
}));
var clearText = new Text2('TEMİZLE', {
size: 36,
fill: 0xFFFFFF
});
clearText.anchor.set(0.5, 0.5);
clearText.x = 624;
clearText.y = 750;
gameContainer.addChild(clearText);
clearButton.down = function (x, y, obj) {
clearSelection();
};
// Hint button - Larger and repositioned
var hintButton = gameContainer.addChild(LK.getAsset('hintButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1424,
y: 750,
scaleX: 1.5,
scaleY: 1.5
}));
var hintButtonText = new Text2('İPUCU', {
size: 30,
fill: 0xFFFFFF
});
hintButtonText.anchor.set(0.5, 0.5);
hintButtonText.x = 1424;
hintButtonText.y = 750;
gameContainer.addChild(hintButtonText);
hintButton.down = function (x, y, obj) {
useHint();
};
// Buy Hint button
var buyHintGameButton = gameContainer.addChild(LK.getAsset('buyHintButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1724,
y: 750,
scaleX: 1.2,
scaleY: 1.2
}));
var buyHintGameText = new Text2('İPUCU\nAL', {
size: 24,
fill: 0xFFFFFF
});
buyHintGameText.anchor.set(0.5, 0.5);
buyHintGameText.x = 1724;
buyHintGameText.y = 750;
gameContainer.addChild(buyHintGameText);
buyHintGameButton.down = function () {
showBuyHintMenu(true);
};
// Back to menu button
var backToMenuButton = gameContainer.addChild(LK.getAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 324,
y: 750,
scaleX: 1.2,
scaleY: 1.2
}));
var backToMenuText = new Text2('MENÜ', {
size: 30,
fill: 0xFFFFFF
});
backToMenuText.anchor.set(0.5, 0.5);
backToMenuText.x = 324;
backToMenuText.y = 750;
gameContainer.addChild(backToMenuText);
backToMenuButton.down = function () {
backToMenu();
};
// Sequence input display container - Shows selected letters in order
var sequenceContainer = new Container();
sequenceContainer.x = 1024;
sequenceContainer.y = 400;
gameContainer.addChild(sequenceContainer);
// Found words container - Repositioned for full screen
var foundWordsContainer = new Container();
foundWordsContainer.x = 100;
foundWordsContainer.y = 900;
gameContainer.addChild(foundWordsContainer);
// Global variables for sequence display
var sequenceBoxes = [];
var maxSequenceLength = 12; // Maximum word length we expect
// Initialize sequence display boxes
function initializeSequenceDisplay() {
// Clear existing sequence boxes
for (var i = 0; i < sequenceBoxes.length; i++) {
sequenceBoxes[i].destroy();
}
sequenceBoxes = [];
var boxSpacing = 90;
var startX = -((maxSequenceLength - 1) * boxSpacing) / 2;
for (var i = 0; i < maxSequenceLength; i++) {
var box = new Container();
// Background box
var bg = box.attachAsset('letterTile', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.2,
scaleY: 1.2
});
bg.alpha = 0.3;
// Letter text
var letterText = new Text2('', {
size: 40,
fill: 0x333333
});
letterText.anchor.set(0.5, 0.5);
box.addChild(letterText);
box.x = startX + i * boxSpacing;
box.letterText = letterText;
box.background = bg;
sequenceBoxes.push(box);
sequenceContainer.addChild(box);
}
}
// Update sequence display
function updateSequenceDisplay() {
for (var i = 0; i < sequenceBoxes.length; i++) {
var box = sequenceBoxes[i];
if (i < selectedLetters.length) {
var letter = selectedLetters[i].letter;
// Use proper alphabet casing
if (currentLanguage === 'turkish') {
letter = letter.toUpperCase();
} else {
letter = letter.toUpperCase();
}
box.letterText.setText(letter);
box.background.alpha = 1.0;
box.background.tint = 0x4CAF50;
} else {
box.letterText.setText('');
box.background.alpha = 0.3;
box.background.tint = 0xffffff;
}
}
}
// Initialize letter tiles
function initializeLetterTiles() {
// Clear existing tiles
for (var i = 0; i < letterTiles.length; i++) {
letterTiles[i].destroy();
}
letterTiles = [];
var letters = currentWordData.word.split('');
// Convert letters to proper alphabet
for (var i = 0; i < letters.length; i++) {
if (currentLanguage === 'turkish') {
letters[i] = letters[i].toUpperCase();
} else {
letters[i] = letters[i].toUpperCase();
}
}
// Shuffle the letters randomly
var shuffledLetters = [];
for (var i = 0; i < letters.length; i++) {
shuffledLetters.push(letters[i]);
}
// Fisher-Yates shuffle algorithm
for (var i = shuffledLetters.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = shuffledLetters[i];
shuffledLetters[i] = shuffledLetters[j];
shuffledLetters[j] = temp;
}
var tileSpacing = 120;
var startX = 1024 - shuffledLetters.length * tileSpacing / 2;
for (var i = 0; i < shuffledLetters.length; i++) {
var tile = new LetterTile(shuffledLetters[i], i);
tile.x = startX + i * tileSpacing;
tile.y = 550; // Moved down to make room for sequence display
tile.scaleX = 1.5;
tile.scaleY = 1.5;
letterTiles.push(tile);
gameContainer.addChild(tile);
}
// Initialize sequence display
initializeSequenceDisplay();
}
// Update current word display
function updateCurrentWord() {
currentWord = '';
for (var i = 0; i < selectedLetters.length; i++) {
currentWord += selectedLetters[i].letter;
}
currentWordDisplay.setText(currentWord.toUpperCase());
}
// Clear letter selection
function clearSelection() {
for (var i = 0; i < selectedLetters.length; i++) {
selectedLetters[i].setSelected(false);
}
selectedLetters = [];
currentWord = '';
currentWordDisplay.setText('');
updateSequenceDisplay();
LK.getSound('buttonClick').play();
}
// Submit word
function submitWord() {
if (currentWord.length < 3) {
LK.effects.flashObject(currentWordDisplay, 0xff0000, 500);
return;
}
var wordLower = currentWord.toLowerCase();
var isValidWord = false;
// Check if word exists in current level's word list OR is the main word itself
for (var i = 0; i < currentWordData.words.length; i++) {
if (currentWordData.words[i].toLowerCase() === wordLower) {
isValidWord = true;
break;
}
}
// Also check if it's the main word itself
if (currentWordData.word.toLowerCase() === wordLower) {
isValidWord = true;
}
// Check if word already found
var alreadyFound = false;
for (var i = 0; i < foundWords.length; i++) {
if (foundWords[i].toLowerCase() === wordLower) {
alreadyFound = true;
break;
}
}
if (isValidWord && !alreadyFound) {
// Word found!
var points = currentWord.length * 10;
var coinReward = 10;
foundWords.push(currentWord);
totalScore += points;
coins += coinReward;
// Add word to found words display
var wordItem = new WordItem(currentWord, points);
wordItem.y = (foundWords.length - 1) * 90;
foundWordsContainer.addChild(wordItem);
// Update UI
scoreText.setText(getString('score') + ': ' + totalScore);
coinsText.setText(getString('money') + ': ' + coins);
storage.coins = coins;
LK.setScore(totalScore);
// Calculate total possible words (including main word)
var totalPossibleWords = currentWordData.words.length + 1;
// Update progress
var progress = foundWords.length / totalPossibleWords;
progressFill.scaleX = progress;
// Play sound and flash green
LK.getSound('wordFound').play();
LK.effects.flashObject(currentWordDisplay, 0x4CAF50, 500);
// Complete level logic based on difficulty
var shouldCompleteLevel = false;
if (currentLevel < 50) {
// Easy levels: complete when main word is found
shouldCompleteLevel = currentWordData.word.toLowerCase() === wordLower;
} else {
// Medium and Hard levels: complete when ALL words are found (including main word)
shouldCompleteLevel = foundWords.length >= totalPossibleWords;
}
if (shouldCompleteLevel) {
completeLevel();
}
clearSelection();
} else if (alreadyFound) {
LK.effects.flashObject(currentWordDisplay, 0xFFEB3B, 500);
clearSelection();
} else {
LK.effects.flashObject(currentWordDisplay, 0xff0000, 500);
clearSelection();
}
}
// Use hint
function useHint() {
if (hintCount <= 0) {
LK.effects.flashObject(hintText, 0xff0000, 500);
return;
}
// Find an unfound word
var unfoundWords = [];
// Check all words in the level
for (var i = 0; i < currentWordData.words.length; i++) {
var word = currentWordData.words[i];
var found = false;
for (var j = 0; j < foundWords.length; j++) {
if (foundWords[j].toLowerCase() === word.toLowerCase()) {
found = true;
break;
}
}
if (!found) {
unfoundWords.push(word);
}
}
// Also check if main word is unfound
var mainWordFound = false;
for (var j = 0; j < foundWords.length; j++) {
if (foundWords[j].toLowerCase() === currentWordData.word.toLowerCase()) {
mainWordFound = true;
break;
}
}
if (!mainWordFound) {
unfoundWords.push(currentWordData.word);
}
if (unfoundWords.length > 0) {
var randomWord = unfoundWords[Math.floor(Math.random() * unfoundWords.length)];
// Clear current selection
clearSelection();
// Find the first letter of the word and select it
var targetLetter = randomWord.charAt(0).toUpperCase();
for (var i = 0; i < letterTiles.length; i++) {
var tile = letterTiles[i];
if (tile.letter.toUpperCase() === targetLetter && !tile.isSelected) {
selectedLetters.push(tile);
tile.setSelected(true);
updateCurrentWord();
updateSequenceDisplay();
break;
}
}
hintCount--;
hintText.setText(getString('hintText') + hintCount);
storage.hintCount = hintCount;
LK.getSound('buttonClick').play();
}
}
// Complete level
function completeLevel() {
currentLevel++;
// Check if game completed (150 levels)
if (currentLevel >= 150) {
// Show completion message
var completionText = new Text2(getString('completedAll'), {
size: 48,
fill: 0x4CAF50
});
completionText.anchor.set(0.5, 0.5);
completionText.x = 1024;
completionText.y = 1366;
game.addChild(completionText);
LK.showYouWin();
return;
}
// Bonus hint every 50 levels
if (currentLevel % 50 === 0) {
hintCount++;
var bonusText = new Text2(getString('bonusHint'), {
size: 54,
fill: 0x4CAF50
});
bonusText.anchor.set(0.5, 0.5);
bonusText.x = 1024;
bonusText.y = 2000;
bonusText.alpha = 0;
game.addChild(bonusText);
tween(bonusText, {
alpha: 1,
y: 1600
}, {
duration: 500
});
tween(bonusText, {
alpha: 0
}, {
duration: 2000,
onFinish: function onFinish() {
bonusText.destroy();
}
});
}
// Save progress
storage.currentLevel = currentLevel;
storage.totalScore = totalScore;
storage.hintCount = hintCount;
LK.getSound('levelComplete').play();
LK.effects.flashScreen(0x4CAF50, 1000);
// Wait a bit then load next level
LK.setTimeout(function () {
loadNextLevel();
}, 1500);
}
// Load next level
function loadNextLevel() {
currentWordData = wordLists[currentLevel % wordLists.length];
foundWords = [];
selectedLetters = [];
currentWord = '';
// Clear found words display
for (var i = 0; i < foundWordItems.length; i++) {
foundWordItems[i].destroy();
}
foundWordItems = [];
// Clear found words container
for (var i = foundWordsContainer.children.length - 1; i >= 0; i--) {
foundWordsContainer.children[i].destroy();
}
// Update UI
levelText.setText(getString('level') + ' ' + (currentLevel + 1));
currentWordDisplay.setText('');
hintText.setText(getString('hintText') + hintCount);
progressFill.scaleX = 0;
// Reinitialize letter tiles
initializeLetterTiles();
}
// Game state management functions
function startGame() {
gameState = 'playing';
menuContainer.visible = false;
gameContainer.visible = true;
buyHintContainer.visible = false;
// Update display texts
coinsText.setText(getString('money') + ': ' + coins);
scoreText.setText(getString('score') + ': ' + totalScore);
hintText.setText(getString('hintText') + hintCount);
levelText.setText(getString('level') + ' ' + (currentLevel + 1));
}
function backToMenu() {
gameState = 'menu';
menuContainer.visible = true;
gameContainer.visible = false;
buyHintContainer.visible = false;
// Update menu texts
menuCoinsText.setText(getString('money') + ': ' + coins);
menuLevelText.setText(getString('level') + ': ' + (currentLevel + 1));
// Save progress
storage.currentLevel = currentLevel;
storage.totalScore = totalScore;
storage.coins = coins;
storage.hintCount = hintCount;
}
function showBuyHintMenu(show) {
if (show) {
gameState = 'buying';
gameContainer.visible = false;
buyHintContainer.visible = true;
buyHintCoinsText.setText(getString('yourMoney') + ': ' + coins);
} else {
gameState = 'playing';
gameContainer.visible = true;
buyHintContainer.visible = false;
}
}
function buyHint() {
if (coins >= 50) {
coins -= 50;
hintCount++;
storage.coins = coins;
storage.hintCount = hintCount;
// Update displays
buyHintCoinsText.setText(getString('yourMoney') + ': ' + coins);
coinsText.setText(getString('money') + ': ' + coins);
hintText.setText(getString('hintText') + hintCount);
LK.effects.flashObject(buyHintCoinsText, 0x4CAF50, 500);
LK.getSound('buttonClick').play();
} else {
LK.effects.flashObject(buyHintCoinsText, 0xff0000, 500);
}
}
// Initialize first level only if playing
if (gameState === 'playing') {
initializeLetterTiles();
} else {
// Show main menu by default
menuContainer.visible = true;
gameContainer.visible = false;
buyHintContainer.visible = false;
}
game.update = function () {
// Only run game logic when playing
if (gameState === 'playing') {
// Game runs continuously
}
}; ===================================================================
--- original.js
+++ change.js
@@ -36,8 +36,9 @@
if (!self.isSelected) {
selectedLetters.push(self);
self.setSelected(true);
updateCurrentWord();
+ updateSequenceDisplay();
LK.getSound('buttonClick').play();
}
};
return self;
@@ -80,8 +81,63 @@
var currentLanguage = storage.currentLanguage || 'turkish';
var turkishWordLists = [];
var englishWordLists = [];
var wordLists = [];
+// Language strings
+var languageStrings = {
+ turkish: {
+ title: 'KELİME OYUNU',
+ start: 'BAŞLAT',
+ money: 'PARA',
+ level: 'SEVİYE',
+ languageSelection: 'DİL SEÇİMİ:',
+ buyHint: 'İPUCU SATIN AL',
+ oneHint: '1 İPUCU = 50 PARA',
+ yourMoney: 'PARAN',
+ buy: 'SATIN AL',
+ back: 'GERİ',
+ send: 'GÖNDER',
+ clear: 'TEMİZLE',
+ hint: 'İPUCU',
+ buyHintShort: 'İPUCU\nAL',
+ menu: 'MENÜ',
+ score: 'SKOR',
+ hintText: 'İPUCU: ',
+ completedAll: 'TEBRİKLER! TÜM SEVİYELERİ TAMAMLADINIZ!',
+ bonusHint: '+1 İPUCU BONUS!'
+ },
+ english: {
+ title: 'WORD GAME',
+ start: 'START',
+ money: 'COINS',
+ level: 'LEVEL',
+ languageSelection: 'LANGUAGE:',
+ buyHint: 'BUY HINT',
+ oneHint: '1 HINT = 50 COINS',
+ yourMoney: 'YOUR COINS',
+ buy: 'BUY',
+ back: 'BACK',
+ send: 'SUBMIT',
+ clear: 'CLEAR',
+ hint: 'HINT',
+ buyHintShort: 'BUY\nHINT',
+ menu: 'MENU',
+ score: 'SCORE',
+ hintText: 'HINTS: ',
+ completedAll: 'CONGRATULATIONS! ALL LEVELS COMPLETED!',
+ bonusHint: '+1 HINT BONUS!'
+ }
+};
+// Function to get localized string
+function getString(key) {
+ return languageStrings[currentLanguage][key] || key;
+}
+// Alphabet definitions
+var turkishAlphabet = 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ';
+var englishAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+function getAlphabet() {
+ return currentLanguage === 'turkish' ? turkishAlphabet : englishAlphabet;
+}
// EASY LEVELS (1-50): Only the main word can be found
var easyWords = ["KALEM", "KITAP", "OKUL", "MASA", "KEDI", "KOPEK", "ELMA", "ARMUT", "SEKER", "EKMEK", "GUNES", "YAGMUR", "KARLI", "SICAK", "SOGUK", "MUTLU", "UZGUN", "HIZLI", "YAVAS", "BUYUK", "KUCUK", "UZUN", "KISA", "GENIS", "DAR", "YENI", "ESKI", "GUZEL", "CIRKIN", "TEMIZ", "KIRLI", "BEYAZ", "SIYAH", "KIRMIZI", "MAVI", "YESIL", "SARI", "PEMBE", "MOR", "TURUNCU", "DOKTOR", "OGRETMEN", "POLIS", "ITFAIYE", "ASCI", "BERBER", "TERZI", "KAPICI", "GARSON", "SOFOR"];
for (var i = 0; i < 50; i++) {
turkishWordLists.push({
@@ -747,10 +803,36 @@
// Reset game to level 1 when switching languages
currentLevel = 0;
storage.currentLevel = 0;
currentWordData = wordLists[currentLevel % wordLists.length];
- menuLevelText.setText('SEVİYE: ' + (currentLevel + 1));
+ // Update all UI texts
+ updateAllUITexts();
}
+// Function to update all UI texts based on current language
+function updateAllUITexts() {
+ // Menu texts
+ titleText.setText(getString('title'));
+ startButtonText.setText(getString('start'));
+ menuCoinsText.setText(getString('money') + ': ' + coins);
+ menuLevelText.setText(getString('level') + ': ' + (currentLevel + 1));
+ languageText.setText(getString('languageSelection'));
+ // Buy hint menu texts
+ buyHintTitleText.setText(getString('buyHint'));
+ buyHintInfoText.setText(getString('oneHint'));
+ buyHintCoinsText.setText(getString('yourMoney') + ': ' + coins);
+ buyHintButtonText.setText(getString('buy'));
+ backFromBuyButtonText.setText(getString('back'));
+ // Game UI texts
+ levelText.setText(getString('level') + ' ' + (currentLevel + 1));
+ coinsText.setText(getString('money') + ': ' + coins);
+ scoreText.setText(getString('score') + ': ' + totalScore);
+ hintText.setText(getString('hintText') + hintCount);
+ submitText.setText(getString('send'));
+ clearText.setText(getString('clear'));
+ hintButtonText.setText(getString('hint'));
+ buyHintGameText.setText(getString('buyHintShort'));
+ backToMenuText.setText(getString('menu'));
+}
// Set initial language
if (currentLanguage === 'turkish') {
wordLists = turkishWordLists;
} else {
@@ -1092,21 +1174,92 @@
gameContainer.addChild(backToMenuText);
backToMenuButton.down = function () {
backToMenu();
};
+// Sequence input display container - Shows selected letters in order
+var sequenceContainer = new Container();
+sequenceContainer.x = 1024;
+sequenceContainer.y = 400;
+gameContainer.addChild(sequenceContainer);
// Found words container - Repositioned for full screen
var foundWordsContainer = new Container();
foundWordsContainer.x = 100;
foundWordsContainer.y = 900;
gameContainer.addChild(foundWordsContainer);
+// Global variables for sequence display
+var sequenceBoxes = [];
+var maxSequenceLength = 12; // Maximum word length we expect
+// Initialize sequence display boxes
+function initializeSequenceDisplay() {
+ // Clear existing sequence boxes
+ for (var i = 0; i < sequenceBoxes.length; i++) {
+ sequenceBoxes[i].destroy();
+ }
+ sequenceBoxes = [];
+ var boxSpacing = 90;
+ var startX = -((maxSequenceLength - 1) * boxSpacing) / 2;
+ for (var i = 0; i < maxSequenceLength; i++) {
+ var box = new Container();
+ // Background box
+ var bg = box.attachAsset('letterTile', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 1.2,
+ scaleY: 1.2
+ });
+ bg.alpha = 0.3;
+ // Letter text
+ var letterText = new Text2('', {
+ size: 40,
+ fill: 0x333333
+ });
+ letterText.anchor.set(0.5, 0.5);
+ box.addChild(letterText);
+ box.x = startX + i * boxSpacing;
+ box.letterText = letterText;
+ box.background = bg;
+ sequenceBoxes.push(box);
+ sequenceContainer.addChild(box);
+ }
+}
+// Update sequence display
+function updateSequenceDisplay() {
+ for (var i = 0; i < sequenceBoxes.length; i++) {
+ var box = sequenceBoxes[i];
+ if (i < selectedLetters.length) {
+ var letter = selectedLetters[i].letter;
+ // Use proper alphabet casing
+ if (currentLanguage === 'turkish') {
+ letter = letter.toUpperCase();
+ } else {
+ letter = letter.toUpperCase();
+ }
+ box.letterText.setText(letter);
+ box.background.alpha = 1.0;
+ box.background.tint = 0x4CAF50;
+ } else {
+ box.letterText.setText('');
+ box.background.alpha = 0.3;
+ box.background.tint = 0xffffff;
+ }
+ }
+}
// Initialize letter tiles
function initializeLetterTiles() {
// Clear existing tiles
for (var i = 0; i < letterTiles.length; i++) {
letterTiles[i].destroy();
}
letterTiles = [];
var letters = currentWordData.word.split('');
+ // Convert letters to proper alphabet
+ for (var i = 0; i < letters.length; i++) {
+ if (currentLanguage === 'turkish') {
+ letters[i] = letters[i].toUpperCase();
+ } else {
+ letters[i] = letters[i].toUpperCase();
+ }
+ }
// Shuffle the letters randomly
var shuffledLetters = [];
for (var i = 0; i < letters.length; i++) {
shuffledLetters.push(letters[i]);
@@ -1122,14 +1275,16 @@
var startX = 1024 - shuffledLetters.length * tileSpacing / 2;
for (var i = 0; i < shuffledLetters.length; i++) {
var tile = new LetterTile(shuffledLetters[i], i);
tile.x = startX + i * tileSpacing;
- tile.y = 500;
+ tile.y = 550; // Moved down to make room for sequence display
tile.scaleX = 1.5;
tile.scaleY = 1.5;
letterTiles.push(tile);
gameContainer.addChild(tile);
}
+ // Initialize sequence display
+ initializeSequenceDisplay();
}
// Update current word display
function updateCurrentWord() {
currentWord = '';
@@ -1145,8 +1300,9 @@
}
selectedLetters = [];
currentWord = '';
currentWordDisplay.setText('');
+ updateSequenceDisplay();
LK.getSound('buttonClick').play();
}
// Submit word
function submitWord() {
@@ -1186,10 +1342,10 @@
var wordItem = new WordItem(currentWord, points);
wordItem.y = (foundWords.length - 1) * 90;
foundWordsContainer.addChild(wordItem);
// Update UI
- scoreText.setText('SKOR: ' + totalScore);
- coinsText.setText('PARA: ' + coins);
+ scoreText.setText(getString('score') + ': ' + totalScore);
+ coinsText.setText(getString('money') + ': ' + coins);
storage.coins = coins;
LK.setScore(totalScore);
// Calculate total possible words (including main word)
var totalPossibleWords = currentWordData.words.length + 1;
@@ -1254,34 +1410,24 @@
unfoundWords.push(currentWordData.word);
}
if (unfoundWords.length > 0) {
var randomWord = unfoundWords[Math.floor(Math.random() * unfoundWords.length)];
- var hintLetter = randomWord.charAt(0).toUpperCase();
- // Show hint
- var hintDisplay = new Text2('İPUCU: ' + hintLetter + '...', {
- size: 48,
- fill: 0xFF9800
- });
- hintDisplay.anchor.set(0.5, 0.5);
- hintDisplay.x = 1024;
- hintDisplay.y = 850;
- hintDisplay.alpha = 0;
- game.addChild(hintDisplay);
- tween(hintDisplay, {
- alpha: 1
- }, {
- duration: 300
- });
- tween(hintDisplay, {
- alpha: 0
- }, {
- duration: 2000,
- onFinish: function onFinish() {
- hintDisplay.destroy();
+ // Clear current selection
+ clearSelection();
+ // Find the first letter of the word and select it
+ var targetLetter = randomWord.charAt(0).toUpperCase();
+ for (var i = 0; i < letterTiles.length; i++) {
+ var tile = letterTiles[i];
+ if (tile.letter.toUpperCase() === targetLetter && !tile.isSelected) {
+ selectedLetters.push(tile);
+ tile.setSelected(true);
+ updateCurrentWord();
+ updateSequenceDisplay();
+ break;
}
- });
+ }
hintCount--;
- hintText.setText('İPUCU: ' + hintCount);
+ hintText.setText(getString('hintText') + hintCount);
storage.hintCount = hintCount;
LK.getSound('buttonClick').play();
}
}
@@ -1290,9 +1436,9 @@
currentLevel++;
// Check if game completed (150 levels)
if (currentLevel >= 150) {
// Show completion message
- var completionText = new Text2('TEBRİKLER! TÜM SEVİYELERİ TAMAMLADINIZ!', {
+ var completionText = new Text2(getString('completedAll'), {
size: 48,
fill: 0x4CAF50
});
completionText.anchor.set(0.5, 0.5);
@@ -1304,9 +1450,9 @@
}
// Bonus hint every 50 levels
if (currentLevel % 50 === 0) {
hintCount++;
- var bonusText = new Text2('+1 İPUCU BONUS!', {
+ var bonusText = new Text2(getString('bonusHint'), {
size: 54,
fill: 0x4CAF50
});
bonusText.anchor.set(0.5, 0.5);
@@ -1355,11 +1501,11 @@
for (var i = foundWordsContainer.children.length - 1; i >= 0; i--) {
foundWordsContainer.children[i].destroy();
}
// Update UI
- levelText.setText('SEVIYE ' + (currentLevel + 1));
+ levelText.setText(getString('level') + ' ' + (currentLevel + 1));
currentWordDisplay.setText('');
- hintText.setText('İPUCU: ' + hintCount);
+ hintText.setText(getString('hintText') + hintCount);
progressFill.scaleX = 0;
// Reinitialize letter tiles
initializeLetterTiles();
}
@@ -1369,21 +1515,21 @@
menuContainer.visible = false;
gameContainer.visible = true;
buyHintContainer.visible = false;
// Update display texts
- coinsText.setText('PARA: ' + coins);
- scoreText.setText('SKOR: ' + totalScore);
- hintText.setText('İPUCU: ' + hintCount);
- levelText.setText('SEVIYE ' + (currentLevel + 1));
+ coinsText.setText(getString('money') + ': ' + coins);
+ scoreText.setText(getString('score') + ': ' + totalScore);
+ hintText.setText(getString('hintText') + hintCount);
+ levelText.setText(getString('level') + ' ' + (currentLevel + 1));
}
function backToMenu() {
gameState = 'menu';
menuContainer.visible = true;
gameContainer.visible = false;
buyHintContainer.visible = false;
// Update menu texts
- menuCoinsText.setText('PARA: ' + coins);
- menuLevelText.setText('SEVİYE: ' + (currentLevel + 1));
+ menuCoinsText.setText(getString('money') + ': ' + coins);
+ menuLevelText.setText(getString('level') + ': ' + (currentLevel + 1));
// Save progress
storage.currentLevel = currentLevel;
storage.totalScore = totalScore;
storage.coins = coins;
@@ -1393,9 +1539,9 @@
if (show) {
gameState = 'buying';
gameContainer.visible = false;
buyHintContainer.visible = true;
- buyHintCoinsText.setText('PARAN: ' + coins);
+ buyHintCoinsText.setText(getString('yourMoney') + ': ' + coins);
} else {
gameState = 'playing';
gameContainer.visible = true;
buyHintContainer.visible = false;
@@ -1407,11 +1553,11 @@
hintCount++;
storage.coins = coins;
storage.hintCount = hintCount;
// Update displays
- buyHintCoinsText.setText('PARAN: ' + coins);
- coinsText.setText('PARA: ' + coins);
- hintText.setText('İPUCU: ' + hintCount);
+ buyHintCoinsText.setText(getString('yourMoney') + ': ' + coins);
+ coinsText.setText(getString('money') + ': ' + coins);
+ hintText.setText(getString('hintText') + hintCount);
LK.effects.flashObject(buyHintCoinsText, 0x4CAF50, 500);
LK.getSound('buttonClick').play();
} else {
LK.effects.flashObject(buyHintCoinsText, 0xff0000, 500);
In the middle part, there are mountains, in the upper left corner, the sun, a river flowing from the mountain, and a house beside the river. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzerinde hint yazan yeşil bir buton. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzerinde buy hint yazan sarı bir buton. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzerinde about yazan gri bir düğme. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzerinde submit yazan turuncu bir buton. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
bir ayarlar simgesi ve kenarlarını benim için düzelt. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzerinde start yazan yeşil bir buton. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzerinde menu yazan kırmızı bir buton. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzerinde clear yazan bir buton. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
üzeinde Back yazan kırmızı bir buton . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat