44
0
13d
User prompt
Hatsu butonu gözükmüyor seçtiğimiz Nen klasmanına göre ekle ve Nen diye bir buton daha koy burada tüm Nen teknikleri olsun temel 4 ilke Ten Zetsu Hatsu Ren ve sonrai leri düzey teknikler de olsun
User prompt
şu Level in Statların Barların göründüğü kısmı Ekranın Sol altına çek vede oyuna Bosslar da ekle Gon,Killua Hisoka Illumi bir tane tuş koy mesela Heavens Arena ya gidelim 200. kat a kadar dövüşelim kısaca Seyahat butonu ekle ve orada açılan ekrana gidebileceğimiz yerleri yaz Hatsu Yaratma 150 Aura 250 Strenght ve 100 Inteligence gerektirsin kısaca Oyuna anime ve Mangadaki Dinamikleri ekle !
User prompt
baştan bi Ekrandaki herşeyin yerini çalışıp çalışmadığını kontrol et ve bir kısma koy hepsini ve Hatsu oluşturma falan getir Nen yeminleri vb Statları bir kenara sayı ile yaz Level in altına
User prompt
Level kısmı haraket etmiyor 1 de takılı kalıyır ekranın Sol altındaki ve her seviye 2 Sp versin ve Type yerine Nen tipimizi yaz ve Hunter Exams ı Baya detaylandır Anime/mangadaki gibi aşamalar yap
User prompt
Maksimum 50 Level sınırı koy Oyunun en başında Avcı Sınavı bitene kadar Nen öğrenemeyelim
User prompt
oyuna Avcı sınavına girmeden önce başlayalım Antrenman yapıp Dövüşlerde Yeni yetenekler kazanalım Meditation butonu Push up butonu Run butonu antrenman için ekle Yetenek ağacı ekle !
User prompt
tuşları falan biraz daha büyütürmüsün ? yazılarıda aynı şekilde barlarda
Code edit (1 edits merged)
Please save this source code
User prompt
Hunter X Hunter: Nen Mastery Challenge
Initial prompt
bir Text Based Hunter X Hunter oyunu yaratmanı istiyorum !
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var MenuButton = Container.expand(function (text, callback) { var self = Container.call(this); var buttonBg = self.attachAsset('buttonBg', { anchorX: 0.5, anchorY: 0.5 }); var buttonText = new Text2(text, { size: 40, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.5); self.addChild(buttonText); self.callback = callback; self.isHovered = false; self.down = function (x, y, obj) { LK.getSound('menuSelect').play(); if (self.callback) { self.callback(); } }; self.move = function (x, y, obj) { if (!self.isHovered) { self.isHovered = true; buttonBg.tint = 0x6a6a6a; } }; return self; }); var SkillButton = Container.expand(function (skill, skillData) { var self = Container.call(this); var buttonColor = skillData.unlocked ? 0x4a4a4a : 0x2a2a2a; var buttonBg = LK.getAsset('buttonBg', { anchorX: 0.5, anchorY: 0.5, tint: buttonColor }); self.addChild(buttonBg); var skillText = new Text2(skillData.name, { size: 32, fill: skillData.unlocked ? 0xFFFFFF : 0x888888 }); skillText.anchor.set(0.5, 0.3); self.addChild(skillText); var costText = new Text2("SP: " + skillData.cost, { size: 24, fill: 0x00FF00 }); costText.anchor.set(0.5, 0.7); self.addChild(costText); self.skill = skill; self.skillData = skillData; self.down = function (x, y, obj) { if (!skillData.unlocked && player.skillPoints >= skillData.cost) { LK.getSound('levelUp').play(); unlockSkill(skill, skillData); } }; return self; }); var StatBar = Container.expand(function (label, maxValue, currentValue, color) { var self = Container.call(this); var labelText = new Text2(label + ": " + currentValue + "/" + maxValue, { size: 30, fill: 0xFFFFFF }); labelText.anchor.set(0, 0.5); self.addChild(labelText); var barBg = self.attachAsset('statBar', { anchorX: 0, anchorY: 0.5, x: 200 }); var barFill = LK.getAsset('statBarFill', { anchorX: 0, anchorY: 0.5, x: 200, scaleX: currentValue / maxValue, tint: color || 0x00ff00 }); self.addChild(barFill); self.maxValue = maxValue; self.currentValue = currentValue; self.barFill = barFill; self.labelText = labelText; self.updateValue = function (newValue) { self.currentValue = Math.max(0, Math.min(newValue, self.maxValue)); self.barFill.scaleX = self.currentValue / self.maxValue; self.labelText.setText(label + ": " + self.currentValue + "/" + self.maxValue); }; return self; }); var StoryPanel = Container.expand(function () { var self = Container.call(this); var panelBg = self.attachAsset('backgroundPanel', { anchorX: 0.5, anchorY: 0.5 }); var storyText = new Text2("", { size: 34, fill: 0xFFFFFF, wordWrap: true, wordWrapWidth: 1700 }); storyText.anchor.set(0.5, 0.5); self.addChild(storyText); self.storyText = storyText; self.setText = function (text) { self.storyText.setText(text); }; return self; }); var TrainingButton = Container.expand(function (activity, activityData) { var self = Container.call(this); var buttonBg = self.attachAsset('buttonBg', { anchorX: 0.5, anchorY: 0.5 }); var buttonText = new Text2(activityData.name, { size: 36, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.3); self.addChild(buttonText); var costText = new Text2("Energy: " + activityData.cost, { size: 24, fill: 0xFFFF00 }); costText.anchor.set(0.5, 0.7); self.addChild(costText); self.activity = activity; self.activityData = activityData; self.isHovered = false; self.down = function (x, y, obj) { if (player.energy >= activityData.cost) { LK.getSound('menuSelect').play(); performTraining(activity); } }; self.move = function (x, y, obj) { if (!self.isHovered) { self.isHovered = true; buttonBg.tint = 0x6a6a6a; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a1a }); /**** * Game Code ****/ // Game State var gameState = "characterCreation"; var trainingState = "menu"; // menu, training, skillTree var player = { name: "Hunter", nenType: "", level: 1, experience: 0, maxExperience: 100, health: 100, maxHealth: 100, aura: 50, maxAura: 50, stats: { strength: 10, speed: 10, intelligence: 10, aura: 10 }, abilities: [], currentChapter: 1, energy: 100, maxEnergy: 100, skillPoints: 0, trainingCount: 0, hunterExamCompleted: false }; // Nen Types Data var nenTypes = { "Enhancer": { description: "Enhancers can increase the natural abilities of an object or one's own body.", bonuses: { strength: 3, health: 20 } }, "Emitter": { description: "Emitters can separate their aura from their body and control it from a distance.", bonuses: { aura: 10, intelligence: 2 } }, "Manipulator": { description: "Manipulators can control living or non-living things with their aura.", bonuses: { intelligence: 3, aura: 5 } }, "Transmuter": { description: "Transmuters can change the properties of their aura to mimic other substances.", bonuses: { speed: 3, aura: 5 } }, "Conjurer": { description: "Conjurers can create physical objects out of their aura.", bonuses: { intelligence: 2, aura: 8 } }, "Specialist": { description: "Specialists have unique abilities that don't fit into other categories.", bonuses: { aura: 15 } } }; // Story Chapters var storyChapters = { 1: { title: "The Hunter Exam Begins", text: "You've arrived at the Hunter Exam site. The examiner explains that you must first discover your Nen type before proceeding. What will you do?", choices: [{ text: "Meditate and focus on your inner aura", action: "meditation" }, { text: "Observe other candidates", action: "observe" }, { text: "Ask the examiner for guidance", action: "guidance" }] }, 2: { title: "First Training Session", text: "Now that you know your Nen type, it's time to begin training. Your instructor assigns you basic exercises.", choices: [{ text: "Focus on physical conditioning", action: "physical" }, { text: "Practice aura control", action: "aura" }, { text: "Study Nen theory", action: "theory" }] }, 3: { title: "Your First Battle", text: "A wild beast appears during your training! You must use your newly learned abilities to defend yourself.", choices: [{ text: "Fight aggressively", action: "attack" }, { text: "Fight defensively", action: "defend" }, { text: "Try to escape", action: "escape" }] } }; // Training Activities var trainingActivities = { meditation: { name: "Meditation", description: "Focus your mind and expand your aura capacity", cost: 10, // energy cost benefits: { aura: 2, intelligence: 1 }, experience: 15 }, pushups: { name: "Push-ups", description: "Build physical strength through intense training", cost: 15, benefits: { strength: 2, health: 5 }, experience: 20 }, running: { name: "Running", description: "Improve speed and endurance", cost: 12, benefits: { speed: 2, health: 3 }, experience: 18 } }; // Skill Tree var skillTree = { enhancer: { name: "Enhancement Skills", skills: [{ name: "Iron Body", cost: 50, unlocked: false, description: "Increase defense by 20%" }, { name: "Power Boost", cost: 100, unlocked: false, description: "Increase strength by 50%" }, { name: "Regeneration", cost: 150, unlocked: false, description: "Slowly recover health over time" }] }, emitter: { name: "Emission Skills", skills: [{ name: "Aura Blast", cost: 60, unlocked: false, description: "Ranged aura attack" }, { name: "Remote Control", cost: 120, unlocked: false, description: "Control objects from distance" }, { name: "Aura Sphere", cost: 180, unlocked: false, description: "Create protective aura barriers" }] }, manipulator: { name: "Manipulation Skills", skills: [{ name: "Object Control", cost: 70, unlocked: false, description: "Manipulate nearby objects" }, { name: "Mind Influence", cost: 140, unlocked: false, description: "Influence enemy actions" }, { name: "Mass Control", cost: 200, unlocked: false, description: "Control multiple targets" }] }, transmuter: { name: "Transmutation Skills", skills: [{ name: "Rubber Aura", cost: 55, unlocked: false, description: "Make aura elastic and bouncy" }, { name: "Electric Aura", cost: 110, unlocked: false, description: "Transmute aura into electricity" }, { name: "Shape Shift", cost: 165, unlocked: false, description: "Change aura into various forms" }] }, conjurer: { name: "Conjuration Skills", skills: [{ name: "Weapon Summon", cost: 80, unlocked: false, description: "Conjure basic weapons" }, { name: "Tool Creation", cost: 160, unlocked: false, description: "Create useful tools" }, { name: "Complex Objects", cost: 240, unlocked: false, description: "Conjure complex mechanisms" }] }, specialist: { name: "Specialist Skills", skills: [{ name: "Unique Ability", cost: 100, unlocked: false, description: "Discover your unique power" }, { name: "Power Amplify", cost: 200, unlocked: false, description: "Amplify all abilities" }, { name: "Reality Bend", cost: 300, unlocked: false, description: "Bend rules of reality" }] } }; // UI Elements var storyPanel; var buttons = []; var statsUI = []; var titleText; // Initialize UI function initializeUI() { // Title titleText = new Text2("Hunter X Hunter: Nen Mastery Challenge", { size: 56, fill: 0xFFFF00 }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 200; game.addChild(titleText); // Story Panel storyPanel = new StoryPanel(); storyPanel.x = 1024; storyPanel.y = 800; game.addChild(storyPanel); // Stats UI var statsY = 1400; statsUI.push(new StatBar("Health", player.maxHealth, player.health, 0xff0000)); statsUI.push(new StatBar("Aura", player.maxAura, player.aura, 0x0066ff)); statsUI.push(new StatBar("Energy", player.maxEnergy, player.energy, 0x00ff00)); statsUI.push(new StatBar("Experience", player.maxExperience, player.experience, 0xffff00)); for (var i = 0; i < statsUI.length; i++) { statsUI[i].x = 200; statsUI[i].y = statsY + i * 60; game.addChild(statsUI[i]); } // Player info var playerInfoText = new Text2("Level: " + player.level + " | Type: " + player.nenType + " | SP: " + player.skillPoints, { size: 38, fill: 0xFFFFFF }); playerInfoText.anchor.set(0, 0.5); playerInfoText.x = 200; playerInfoText.y = 1700; game.addChild(playerInfoText); } // Character Creation function startCharacterCreation() { storyPanel.setText("Welcome, aspiring Hunter! First, you must discover your Nen type. Choose your path:"); clearButtons(); var nenTypeKeys = Object.keys(nenTypes); for (var i = 0; i < nenTypeKeys.length; i++) { var nenType = nenTypeKeys[i]; var button = new MenuButton(nenType, createNenTypeCallback(nenType)); button.x = 400 + i % 3 * 450; button.y = 1200 + Math.floor(i / 3) * 100; buttons.push(button); game.addChild(button); } } function createNenTypeCallback(nenType) { return function () { selectNenType(nenType); }; } function selectNenType(nenType) { player.nenType = nenType; var typeData = nenTypes[nenType]; // Apply bonuses if (typeData.bonuses.strength) player.stats.strength += typeData.bonuses.strength; if (typeData.bonuses.speed) player.stats.speed += typeData.bonuses.speed; if (typeData.bonuses.intelligence) player.stats.intelligence += typeData.bonuses.intelligence; if (typeData.bonuses.aura) player.stats.aura += typeData.bonuses.aura; if (typeData.bonuses.health) { player.maxHealth += typeData.bonuses.health; player.health = player.maxHealth; } storyPanel.setText("Excellent! You are a " + nenType + ". " + typeData.description); clearButtons(); var continueButton = new MenuButton("Start Training", function () { gameState = "training"; startTrainingMode(); }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); updateStatsUI(); } // Story System function startStoryChapter(chapterNum) { var chapter = storyChapters[chapterNum]; if (!chapter) return; player.currentChapter = chapterNum; storyPanel.setText(chapter.title + "\n\n" + chapter.text); clearButtons(); for (var i = 0; i < chapter.choices.length; i++) { var choice = chapter.choices[i]; var button = new MenuButton(choice.text, createChoiceCallback(choice.action)); button.x = 1024; button.y = 1400 + i * 100; buttons.push(button); game.addChild(button); } } function createChoiceCallback(action) { return function () { handleChoice(action); }; } function handleChoice(action) { var result = ""; var expGain = 0; switch (action) { case "meditation": result = "Through meditation, you sense your inner aura more clearly. Your aura control improves."; player.stats.aura += 2; expGain = 20; break; case "observe": result = "By observing others, you learn different techniques. Your intelligence increases."; player.stats.intelligence += 2; expGain = 15; break; case "guidance": result = "The examiner teaches you basic principles. Your understanding deepens."; player.stats.intelligence += 1; player.stats.aura += 1; expGain = 25; break; case "physical": result = "Physical training strengthens your body. Your strength and speed increase."; player.stats.strength += 2; player.stats.speed += 1; expGain = 20; break; case "aura": result = "Aura control practice enhances your Nen abilities. Your aura capacity grows."; player.maxAura += 10; player.aura = player.maxAura; expGain = 25; break; case "theory": result = "Studying Nen theory broadens your knowledge. Your intelligence increases significantly."; player.stats.intelligence += 3; expGain = 30; break; case "attack": result = "You fight bravely! Your combat experience grows, but you take some damage."; player.health -= 20; player.stats.strength += 2; expGain = 40; break; case "defend": result = "Your defensive stance protects you while you learn the enemy's patterns."; player.health -= 5; player.stats.speed += 1; expGain = 30; break; case "escape": result = "You escape safely and learn to be more cautious. Your speed increases."; player.stats.speed += 2; expGain = 15; break; } // Apply experience player.experience += expGain; if (player.experience >= player.maxExperience) { levelUp(); } storyPanel.setText(result); clearButtons(); var continueButton = new MenuButton("Continue", function () { var nextChapter = player.currentChapter + 1; if (nextChapter <= 3) { startStoryChapter(nextChapter); } else { showGameComplete(); } }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); updateStatsUI(); } function levelUp() { if (player.level >= 50) { return; // Maximum level reached } player.level++; player.experience = 0; player.maxExperience += 50; player.maxHealth += 20; player.health = player.maxHealth; player.maxAura += 10; player.aura = player.maxAura; LK.getSound('levelUp').play(); LK.effects.flashScreen(0xffff00, 500); } function showGameComplete() { player.hunterExamCompleted = true; storyPanel.setText("Congratulations! You have completed the Hunter Exam!\n\nYou can now access advanced Nen techniques through the Skill Tree.\n\nFinal Stats:\nLevel: " + player.level + "\nType: " + player.nenType + "\nStrength: " + player.stats.strength + "\nSpeed: " + player.stats.speed + "\nIntelligence: " + player.stats.intelligence + "\nAura: " + player.stats.aura); clearButtons(); var continueButton = new MenuButton("Continue Training", function () { gameState = "training"; startTrainingMode(); }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); LK.setScore(player.level * 100 + player.stats.strength + player.stats.speed + player.stats.intelligence + player.stats.aura); } function startTrainingMode() { storyPanel.setText("Welcome to the training grounds! Train your abilities before attempting the Hunter Exam.\n\nTraining will cost energy but will make you stronger. Rest to recover energy."); clearButtons(); // Training buttons var activities = Object.keys(trainingActivities); for (var i = 0; i < activities.length; i++) { var activity = activities[i]; var activityData = trainingActivities[activity]; var button = new TrainingButton(activity, activityData); button.x = 400 + i * 450; button.y = 1300; buttons.push(button); game.addChild(button); } // Rest button var restButton = new MenuButton("Rest (+50 Energy)", function () { player.energy = Math.min(player.maxEnergy, player.energy + 50); updateStatsUI(); }); restButton.x = 400; restButton.y = 1450; buttons.push(restButton); game.addChild(restButton); // Skill Tree button (only available after Hunter Exam) if (player.hunterExamCompleted) { var skillTreeButton = new MenuButton("Skill Tree", function () { showSkillTree(); }); skillTreeButton.x = 850; skillTreeButton.y = 1450; buttons.push(skillTreeButton); game.addChild(skillTreeButton); } else { var skillTreeButton = new MenuButton("Skill Tree (Locked)", function () { // Do nothing - button is disabled }); skillTreeButton.x = 850; skillTreeButton.y = 1450; skillTreeButton.alpha = 0.5; // Make it look disabled buttons.push(skillTreeButton); game.addChild(skillTreeButton); } // Hunter Exam button (available after some training) if (player.trainingCount >= 5) { var examButton = new MenuButton("Take Hunter Exam", function () { gameState = "story"; startStoryChapter(1); }); examButton.x = 1300; examButton.y = 1450; buttons.push(examButton); game.addChild(examButton); } } function performTraining(activity) { var activityData = trainingActivities[activity]; // Deduct energy player.energy -= activityData.cost; // Apply benefits if (activityData.benefits.strength) player.stats.strength += activityData.benefits.strength; if (activityData.benefits.speed) player.stats.speed += activityData.benefits.speed; if (activityData.benefits.intelligence) player.stats.intelligence += activityData.benefits.intelligence; if (activityData.benefits.aura) player.stats.aura += activityData.benefits.aura; if (activityData.benefits.health) { player.maxHealth += activityData.benefits.health; player.health = player.maxHealth; } // Add experience and skill points player.experience += activityData.experience; player.skillPoints += Math.floor(activityData.experience / 10); player.trainingCount++; // Check for level up if (player.experience >= player.maxExperience) { levelUp(); } // Update UI updateStatsUI(); // Flash effect LK.effects.flashScreen(0x00ff00, 300); // Refresh training mode to update buttons startTrainingMode(); } function showSkillTree() { var nenTypeKey = player.nenType.toLowerCase(); var skillCategory = skillTree[nenTypeKey]; if (!skillCategory) return; storyPanel.setText("Skill Tree: " + skillCategory.name + "\n\nSpend skill points to unlock new abilities. Each skill will enhance your combat effectiveness."); clearButtons(); // Skill buttons for (var i = 0; i < skillCategory.skills.length; i++) { var skill = skillCategory.skills[i]; var skillButton = new SkillButton(skill, skill); skillButton.x = 400 + i * 450; skillButton.y = 1300; buttons.push(skillButton); game.addChild(skillButton); } // Back button var backButton = new MenuButton("Back to Training", function () { startTrainingMode(); }); backButton.x = 1024; backButton.y = 1450; buttons.push(backButton); game.addChild(backButton); } function unlockSkill(skill, skillData) { player.skillPoints -= skillData.cost; skillData.unlocked = true; player.abilities.push(skill.name); // Apply skill effects if (skill.name === "Iron Body") player.maxHealth += 50; if (skill.name === "Power Boost") player.stats.strength += 20; if (skill.name === "Aura Blast") player.maxAura += 30; updateStatsUI(); showSkillTree(); // Refresh skill tree } function resetGame() { player = { name: "Hunter", nenType: "", level: 1, experience: 0, maxExperience: 100, health: 100, maxHealth: 100, aura: 50, maxAura: 50, stats: { strength: 10, speed: 10, intelligence: 10, aura: 10 }, abilities: [], currentChapter: 1, energy: 100, maxEnergy: 100, skillPoints: 0, trainingCount: 0, hunterExamCompleted: false }; gameState = "characterCreation"; updateStatsUI(); startCharacterCreation(); } function clearButtons() { for (var i = 0; i < buttons.length; i++) { buttons[i].destroy(); } buttons = []; } function updateStatsUI() { if (statsUI.length > 0) { statsUI[0].updateValue(player.health); statsUI[1].updateValue(player.aura); statsUI[2].updateValue(player.energy); statsUI[3].updateValue(player.experience); } // Update player info text var playerInfoText = game.children.find(function (child) { return child.setText && child.text && child.text.includes("Level:"); }); if (playerInfoText) { playerInfoText.setText("Level: " + player.level + " | Type: " + player.nenType + " | SP: " + player.skillPoints); } } // Initialize game initializeUI(); startCharacterCreation(); game.update = function () { // Game loop logic if needed };
===================================================================
--- original.js
+++ change.js
@@ -187,9 +187,10 @@
currentChapter: 1,
energy: 100,
maxEnergy: 100,
skillPoints: 0,
- trainingCount: 0
+ trainingCount: 0,
+ hunterExamCompleted: false
};
// Nen Types Data
var nenTypes = {
"Enhancer": {
@@ -612,8 +613,11 @@
game.addChild(continueButton);
updateStatsUI();
}
function levelUp() {
+ if (player.level >= 50) {
+ return; // Maximum level reached
+ }
player.level++;
player.experience = 0;
player.maxExperience += 50;
player.maxHealth += 20;
@@ -623,17 +627,19 @@
LK.getSound('levelUp').play();
LK.effects.flashScreen(0xffff00, 500);
}
function showGameComplete() {
- storyPanel.setText("Congratulations! You have completed the first phase of your Hunter training.\n\nFinal Stats:\nLevel: " + player.level + "\nType: " + player.nenType + "\nStrength: " + player.stats.strength + "\nSpeed: " + player.stats.speed + "\nIntelligence: " + player.stats.intelligence + "\nAura: " + player.stats.aura);
+ player.hunterExamCompleted = true;
+ storyPanel.setText("Congratulations! You have completed the Hunter Exam!\n\nYou can now access advanced Nen techniques through the Skill Tree.\n\nFinal Stats:\nLevel: " + player.level + "\nType: " + player.nenType + "\nStrength: " + player.stats.strength + "\nSpeed: " + player.stats.speed + "\nIntelligence: " + player.stats.intelligence + "\nAura: " + player.stats.aura);
clearButtons();
- var restartButton = new MenuButton("Start New Journey", function () {
- resetGame();
+ var continueButton = new MenuButton("Continue Training", function () {
+ gameState = "training";
+ startTrainingMode();
});
- restartButton.x = 1024;
- restartButton.y = 1400;
- buttons.push(restartButton);
- game.addChild(restartButton);
+ continueButton.x = 1024;
+ continueButton.y = 1400;
+ buttons.push(continueButton);
+ game.addChild(continueButton);
LK.setScore(player.level * 100 + player.stats.strength + player.stats.speed + player.stats.intelligence + player.stats.aura);
}
function startTrainingMode() {
storyPanel.setText("Welcome to the training grounds! Train your abilities before attempting the Hunter Exam.\n\nTraining will cost energy but will make you stronger. Rest to recover energy.");
@@ -657,16 +663,27 @@
restButton.x = 400;
restButton.y = 1450;
buttons.push(restButton);
game.addChild(restButton);
- // Skill Tree button
- var skillTreeButton = new MenuButton("Skill Tree", function () {
- showSkillTree();
- });
- skillTreeButton.x = 850;
- skillTreeButton.y = 1450;
- buttons.push(skillTreeButton);
- game.addChild(skillTreeButton);
+ // Skill Tree button (only available after Hunter Exam)
+ if (player.hunterExamCompleted) {
+ var skillTreeButton = new MenuButton("Skill Tree", function () {
+ showSkillTree();
+ });
+ skillTreeButton.x = 850;
+ skillTreeButton.y = 1450;
+ buttons.push(skillTreeButton);
+ game.addChild(skillTreeButton);
+ } else {
+ var skillTreeButton = new MenuButton("Skill Tree (Locked)", function () {
+ // Do nothing - button is disabled
+ });
+ skillTreeButton.x = 850;
+ skillTreeButton.y = 1450;
+ skillTreeButton.alpha = 0.5; // Make it look disabled
+ buttons.push(skillTreeButton);
+ game.addChild(skillTreeButton);
+ }
// Hunter Exam button (available after some training)
if (player.trainingCount >= 5) {
var examButton = new MenuButton("Take Hunter Exam", function () {
gameState = "story";
@@ -762,9 +779,10 @@
currentChapter: 1,
energy: 100,
maxEnergy: 100,
skillPoints: 0,
- trainingCount: 0
+ trainingCount: 0,
+ hunterExamCompleted: false
};
gameState = "characterCreation";
updateStatsUI();
startCharacterCreation();