/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ // 'menu', 'game', 'options' var AnimeCharacter = Container.expand(function (characterId, pointValue) { var self = Container.call(this); self.characterId = characterId; self.pointValue = pointValue; self.isActive = false; self.isTouched = false; // Create both sprite states var characterGraphicsNormal = self.attachAsset('character' + characterId, { anchorX: 0.5, anchorY: 0.5 }); var characterGraphicsTouched = self.addChild(LK.getAsset('character' + characterId + 'Touched', { anchorX: 0.5, anchorY: 0.5 })); characterGraphicsTouched.visible = false; // Reference to the currently visible sprite var characterGraphics = characterGraphicsNormal; // Face elements removed per request self.playClickAnimation = function () { // Main character bounce with higher intensity tween(self, { scaleX: 1.3, scaleY: 1.3 }, { duration: 80, easing: tween.elasticOut }); tween(self, { scaleX: 1, scaleY: 1 }, { duration: 120, easing: tween.bounceOut }); // Character color flash based on point value var flashColor = self.pointValue > 100 ? 0xFFD700 : self.pointValue > 50 ? 0xFF6347 : self.pointValue > 10 ? 0x32CD32 : 0xFFFFFF; tween(characterGraphics, { tint: flashColor }, { duration: 100, easing: tween.linear }); tween(characterGraphics, { tint: 0xFFFFFF }, { duration: 100, easing: tween.linear }); // Eye and mouth animations removed per request }; self.showTouchedSprite = function () { if (!self.isTouched) { self.isTouched = true; characterGraphicsNormal.visible = false; characterGraphicsTouched.visible = true; characterGraphics = characterGraphicsTouched; } }; self.showNormalSprite = function () { if (self.isTouched) { self.isTouched = false; characterGraphicsNormal.visible = true; characterGraphicsTouched.visible = false; characterGraphics = characterGraphicsNormal; } }; self.setActive = function (active) { self.isActive = active; if (active) { characterGraphicsNormal.alpha = 1.0; characterGraphicsTouched.alpha = 1.0; } else { characterGraphicsNormal.alpha = 0.7; characterGraphicsTouched.alpha = 0.7; } }; self.down = function (x, y, obj) { if (self.isActive) { self.showTouchedSprite(); totalClicks += self.pointValue; LK.setScore(totalClicks); scoreText.setText(totalClicks); clickValueText.setText('+' + self.pointValue); self.playClickAnimation(); LK.getSound('click').play(); checkUnlocks(); // Return to normal sprite after animation - extended duration LK.setTimeout(function () { self.showNormalSprite(); }, 2000); } }; return self; }); var CharacterSlot = Container.expand(function (characterId, unlockThreshold) { var self = Container.call(this); self.characterId = characterId; self.unlockThreshold = unlockThreshold; self.isUnlocked = false; var slotBackground = self.attachAsset('characterSlot', { anchorX: 0.5, anchorY: 0.5 }); var characterIcon = self.addChild(LK.getAsset('characterIcon' + characterId, { anchorX: 0.5, anchorY: 0.5 })); characterIcon.alpha = 0.3; var lockText = self.addChild(new Text2('?', { size: 40, fill: 0xFFFFFF })); lockText.anchor.set(0.5, 0.5); lockText.y = 60; self.unlock = function () { if (!self.isUnlocked) { self.isUnlocked = true; characterIcon.alpha = 1.0; lockText.setText(''); // Create spectacular unlock animation sequence // First: Scale up dramatically tween(self, { scaleX: 2.0, scaleY: 2.0 }, { duration: 300, easing: tween.elasticOut }); // Second: Spin while scaling tween(self, { rotation: Math.PI * 2 }, { duration: 500, easing: tween.easeOut }); // Third: Flash the icon color tween(characterIcon, { tint: 0xFFFFFF }, { duration: 100, easing: tween.linear }); tween(characterIcon, { tint: 0xFFFF00 }, { duration: 150, easing: tween.linear }); tween(characterIcon, { tint: 0xFFFFFF }, { duration: 100, easing: tween.linear }); // Fourth: Return to normal size with bounce tween(self, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 400, easing: tween.bounceOut }); // Flash screen effect LK.effects.flashScreen(0xFFD700, 500); LK.getSound('unlock').play(); } }; self.updateLockText = function () { if (!self.isUnlocked) { var remaining = self.unlockThreshold - totalClicks; if (remaining > 0) { lockText.setText(remaining); } } }; self.down = function (x, y, obj) { if (self.isUnlocked) { setActiveCharacter(self.characterId); } }; return self; }); var MenuButton = Container.expand(function (text, color, action) { var self = Container.call(this); var buttonBackground = self.attachAsset('characterSlot', { anchorX: 0.5, anchorY: 0.5, scaleX: 3, scaleY: 1.5 }); buttonBackground.tint = color; var buttonText = self.addChild(new Text2(text, { size: 60, fill: 0xFFFFFF })); buttonText.anchor.set(0.5, 0.5); self.action = action; self.down = function (x, y, obj) { // Button press animation tween(self, { scaleX: 0.95, scaleY: 0.95 }, { duration: 100, easing: tween.easeOut }); tween(self, { scaleX: 1, scaleY: 1 }, { duration: 100, easing: tween.bounceOut }); // Execute action after animation LK.setTimeout(function () { self.action(); }, 150); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2C3E50 }); /**** * Game Code ****/ // Game state management // Menu elements var gameState = 'menu'; var menuContainer = new Container(); var gameContainer = new Container(); var optionsContainer = new Container(); var warningContainer = new Container(); // Game variables var totalClicks = storage.totalClicks || 0; var currentCharacterId = storage.currentCharacterId || 1; var characters = []; var characterSlots = []; var unlockedCharacters = storage.unlockedCharacters || [1]; // Create menu function createMenu() { var menuTitle = new Text2('Anime Clicker Paradise', { size: 120, fill: 0xE74C3C }); menuTitle.anchor.set(0.5, 0.5); menuTitle.x = 2048 / 2; menuTitle.y = 800; menuContainer.addChild(menuTitle); var playButton = new MenuButton('Play', 0x27AE60, function () { gameState = 'game'; showGame(); }); playButton.x = 2048 / 2; playButton.y = 1200; menuContainer.addChild(playButton); var optionsButton = new MenuButton('Options', 0x3498DB, function () { gameState = 'options'; showOptions(); }); optionsButton.x = 2048 / 2; optionsButton.y = 1400; menuContainer.addChild(optionsButton); var warningButton = new MenuButton('Warning', 0xF39C12, function () { showWarningWindow(); }); warningButton.x = 2048 / 2; warningButton.y = 1600; menuContainer.addChild(warningButton); } // Create options menu function createOptions() { var optionsTitle = new Text2('Options', { size: 100, fill: 0xFFFFFF }); optionsTitle.anchor.set(0.5, 0.5); optionsTitle.x = 2048 / 2; optionsTitle.y = 600; optionsContainer.addChild(optionsTitle); var resetButton = new MenuButton('Reset Game', 0xE74C3C, function () { // Clear all saved data storage.totalClicks = 0; storage.currentCharacterId = 1; storage.unlockedCharacters = [1]; // Reset all game variables totalClicks = 0; currentCharacterId = 1; unlockedCharacters = [1]; // Reset score display LK.setScore(0); scoreText.setText('0'); clickValueText.setText('+1'); // Reset all character slots to locked state for (var i = 0; i < characterSlots.length; i++) { characterSlots[i].isUnlocked = false; characterSlots[i].children[1].alpha = 0.3; // characterIcon characterSlots[i].children[2].setText('?'); // lockText } // Unlock only the first character characterSlots[0].unlock(); // Reset active character to first one setActiveCharacter(1); // Update all lock texts for (var i = 0; i < characterSlots.length; i++) { characterSlots[i].updateLockText(); } // Flash screen to show reset LK.effects.flashScreen(0xFF0000, 1500); // Return to menu after reset LK.setTimeout(function () { gameState = 'menu'; showMenu(); }, 1500); }); resetButton.x = 2048 / 2; resetButton.y = 1200; optionsContainer.addChild(resetButton); var backButton = new MenuButton('Back', 0x95A5A6, function () { gameState = 'menu'; showMenu(); }); backButton.x = 2048 / 2; backButton.y = 1600; optionsContainer.addChild(backButton); } function showMenu() { menuContainer.visible = true; gameContainer.visible = false; optionsContainer.visible = false; } function showGame() { menuContainer.visible = false; gameContainer.visible = true; optionsContainer.visible = false; } function showOptions() { menuContainer.visible = false; gameContainer.visible = false; optionsContainer.visible = true; } // Character data var characterData = [{ id: 1, points: 1, unlockAt: 0 }, { id: 2, points: 2, unlockAt: 50 }, { id: 3, points: 5, unlockAt: 200 }, { id: 4, points: 10, unlockAt: 500 }, { id: 5, points: 20, unlockAt: 1000 }, { id: 6, points: 35, unlockAt: 2000 }, { id: 7, points: 60, unlockAt: 4000 }, { id: 8, points: 100, unlockAt: 7500 }, { id: 9, points: 175, unlockAt: 12000 }, { id: 10, points: 300, unlockAt: 20000 }, { id: 11, points: 500, unlockAt: 35000 }, { id: 12, points: 850, unlockAt: 60000 }, { id: 13, points: 1400, unlockAt: 100000 }, { id: 14, points: 2500, unlockAt: 175000 }, { id: 15, points: 5000, unlockAt: 300000 }]; // Initialize all containers game.addChild(menuContainer); game.addChild(gameContainer); game.addChild(optionsContainer); game.addChild(warningContainer); // Create warning window function createWarningWindow() { // Semi-transparent background overlay var overlay = warningContainer.addChild(LK.getAsset('characterSlot', { anchorX: 0, anchorY: 0, scaleX: 17, scaleY: 23 })); overlay.tint = 0x000000; overlay.alpha = 0.7; // Warning window background var windowBackground = warningContainer.addChild(LK.getAsset('characterSlot', { anchorX: 0.5, anchorY: 0.5, scaleX: 8, scaleY: 4 })); windowBackground.x = 2048 / 2; windowBackground.y = 2732 / 2; windowBackground.tint = 0x34495e; // Warning text var warningText = warningContainer.addChild(new Text2('This game is in beta,\nso it may have bugs.', { size: 60, fill: 0xFFFFFF })); warningText.anchor.set(0.5, 0.5); warningText.x = 2048 / 2; warningText.y = 2732 / 2 - 50; // OK button to close window var okButton = new MenuButton('OK', 0x27AE60, function () { hideWarningWindow(); }); okButton.x = 2048 / 2; okButton.y = 2732 / 2 + 100; warningContainer.addChild(okButton); } function showWarningWindow() { warningContainer.visible = true; // Animate window appearance warningContainer.alpha = 0; tween(warningContainer, { alpha: 1 }, { duration: 300, easing: tween.easeOut }); } function hideWarningWindow() { // Animate window disappearance tween(warningContainer, { alpha: 0 }, { duration: 200, easing: tween.easeIn, onFinish: function onFinish() { warningContainer.visible = false; } }); } // Create menu and options createMenu(); createOptions(); createWarningWindow(); // Set initial container visibility warningContainer.visible = false; // UI Elements for game var scoreText = new Text2(totalClicks.toString(), { size: 80, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 0); var clickValueText = new Text2('+1', { size: 60, fill: 0xF1C40F }); clickValueText.anchor.set(0.5, 0.5); clickValueText.x = 2048 / 2; clickValueText.y = 800; clickValueText.alpha = 0; gameContainer.addChild(clickValueText); var titleText = new Text2('Anime Clicker Paradise', { size: 50, fill: 0xE74C3C }); titleText.anchor.set(0.5, 0); titleText.y = 100; // Create characters for (var i = 0; i < characterData.length; i++) { var charData = characterData[i]; var character = new AnimeCharacter(charData.id, charData.points); character.x = 2048 / 2; character.y = 1200; character.visible = false; characters.push(character); gameContainer.addChild(character); } // Create character selection slots var slotsPerRow = 5; var slotSpacing = 140; var rowSpacing = 150; var startY = 2100; var totalRows = Math.ceil(characterData.length / slotsPerRow); var slotStartX = (2048 - slotsPerRow * slotSpacing) / 2 + 70; for (var i = 0; i < characterData.length; i++) { var charData = characterData[i]; var slot = new CharacterSlot(charData.id, charData.unlockAt); var row = Math.floor(i / slotsPerRow); var col = i % slotsPerRow; var rowWidth = Math.min(characterData.length - row * slotsPerRow, slotsPerRow); var rowStartX = (2048 - rowWidth * slotSpacing) / 2 + 70; slot.x = rowStartX + col * slotSpacing; slot.y = startY + row * rowSpacing; characterSlots.push(slot); gameContainer.addChild(slot); } // Add GUI elements only when in game state function updateGUI() { if (gameState === 'game') { if (scoreText.parent !== LK.gui.top) { LK.gui.top.addChild(scoreText); } if (titleText.parent !== LK.gui.top) { LK.gui.top.addChild(titleText); } } else { if (scoreText.parent) { scoreText.parent.removeChild(scoreText); } if (titleText.parent) { titleText.parent.removeChild(titleText); } } } function setActiveCharacter(characterId) { // Hide all characters for (var i = 0; i < characters.length; i++) { characters[i].visible = false; characters[i].setActive(false); } // Show and activate selected character var character = characters[characterId - 1]; character.visible = true; character.setActive(true); currentCharacterId = characterId; // Update click value display clickValueText.setText('+' + character.pointValue); // Save progress storage.currentCharacterId = currentCharacterId; } function checkUnlocks() { for (var i = 0; i < characterData.length; i++) { var charData = characterData[i]; if (totalClicks >= charData.unlockAt && unlockedCharacters.indexOf(charData.id) === -1) { unlockedCharacters.push(charData.id); characterSlots[i].unlock(); } } // Update lock text on all slots for (var i = 0; i < characterSlots.length; i++) { characterSlots[i].updateLockText(); } // Save progress storage.totalClicks = totalClicks; storage.unlockedCharacters = unlockedCharacters; } // Initialize unlocked characters for (var i = 0; i < unlockedCharacters.length; i++) { var charId = unlockedCharacters[i]; characterSlots[charId - 1].unlock(); } // Set initial active character setActiveCharacter(currentCharacterId); // Initialize score LK.setScore(totalClicks); // Start with menu showMenu(); // Click value text animation var clickValueAlpha = 0; var clickValueFadeTimer = 0; game.update = function () { // Update GUI based on state updateGUI(); // Only run game logic when in game state if (gameState === 'game') { // Animate click value text if (clickValueAlpha > 0) { clickValueFadeTimer--; if (clickValueFadeTimer <= 0) { clickValueAlpha -= 0.02; if (clickValueAlpha < 0) clickValueAlpha = 0; clickValueText.alpha = clickValueAlpha; } } // Check for new unlocks periodically if (LK.ticks % 60 === 0) { checkUnlocks(); } } }; // Show click value when character is clicked (only in game state) var originalDown = game.down; game.down = function (x, y, obj) { if (gameState === 'game') { clickValueAlpha = 1; clickValueFadeTimer = 30; clickValueText.alpha = clickValueAlpha; } if (originalDown) { originalDown(x, y, obj); } };
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
// 'menu', 'game', 'options'
var AnimeCharacter = Container.expand(function (characterId, pointValue) {
var self = Container.call(this);
self.characterId = characterId;
self.pointValue = pointValue;
self.isActive = false;
self.isTouched = false;
// Create both sprite states
var characterGraphicsNormal = self.attachAsset('character' + characterId, {
anchorX: 0.5,
anchorY: 0.5
});
var characterGraphicsTouched = self.addChild(LK.getAsset('character' + characterId + 'Touched', {
anchorX: 0.5,
anchorY: 0.5
}));
characterGraphicsTouched.visible = false;
// Reference to the currently visible sprite
var characterGraphics = characterGraphicsNormal;
// Face elements removed per request
self.playClickAnimation = function () {
// Main character bounce with higher intensity
tween(self, {
scaleX: 1.3,
scaleY: 1.3
}, {
duration: 80,
easing: tween.elasticOut
});
tween(self, {
scaleX: 1,
scaleY: 1
}, {
duration: 120,
easing: tween.bounceOut
});
// Character color flash based on point value
var flashColor = self.pointValue > 100 ? 0xFFD700 : self.pointValue > 50 ? 0xFF6347 : self.pointValue > 10 ? 0x32CD32 : 0xFFFFFF;
tween(characterGraphics, {
tint: flashColor
}, {
duration: 100,
easing: tween.linear
});
tween(characterGraphics, {
tint: 0xFFFFFF
}, {
duration: 100,
easing: tween.linear
});
// Eye and mouth animations removed per request
};
self.showTouchedSprite = function () {
if (!self.isTouched) {
self.isTouched = true;
characterGraphicsNormal.visible = false;
characterGraphicsTouched.visible = true;
characterGraphics = characterGraphicsTouched;
}
};
self.showNormalSprite = function () {
if (self.isTouched) {
self.isTouched = false;
characterGraphicsNormal.visible = true;
characterGraphicsTouched.visible = false;
characterGraphics = characterGraphicsNormal;
}
};
self.setActive = function (active) {
self.isActive = active;
if (active) {
characterGraphicsNormal.alpha = 1.0;
characterGraphicsTouched.alpha = 1.0;
} else {
characterGraphicsNormal.alpha = 0.7;
characterGraphicsTouched.alpha = 0.7;
}
};
self.down = function (x, y, obj) {
if (self.isActive) {
self.showTouchedSprite();
totalClicks += self.pointValue;
LK.setScore(totalClicks);
scoreText.setText(totalClicks);
clickValueText.setText('+' + self.pointValue);
self.playClickAnimation();
LK.getSound('click').play();
checkUnlocks();
// Return to normal sprite after animation - extended duration
LK.setTimeout(function () {
self.showNormalSprite();
}, 2000);
}
};
return self;
});
var CharacterSlot = Container.expand(function (characterId, unlockThreshold) {
var self = Container.call(this);
self.characterId = characterId;
self.unlockThreshold = unlockThreshold;
self.isUnlocked = false;
var slotBackground = self.attachAsset('characterSlot', {
anchorX: 0.5,
anchorY: 0.5
});
var characterIcon = self.addChild(LK.getAsset('characterIcon' + characterId, {
anchorX: 0.5,
anchorY: 0.5
}));
characterIcon.alpha = 0.3;
var lockText = self.addChild(new Text2('?', {
size: 40,
fill: 0xFFFFFF
}));
lockText.anchor.set(0.5, 0.5);
lockText.y = 60;
self.unlock = function () {
if (!self.isUnlocked) {
self.isUnlocked = true;
characterIcon.alpha = 1.0;
lockText.setText('');
// Create spectacular unlock animation sequence
// First: Scale up dramatically
tween(self, {
scaleX: 2.0,
scaleY: 2.0
}, {
duration: 300,
easing: tween.elasticOut
});
// Second: Spin while scaling
tween(self, {
rotation: Math.PI * 2
}, {
duration: 500,
easing: tween.easeOut
});
// Third: Flash the icon color
tween(characterIcon, {
tint: 0xFFFFFF
}, {
duration: 100,
easing: tween.linear
});
tween(characterIcon, {
tint: 0xFFFF00
}, {
duration: 150,
easing: tween.linear
});
tween(characterIcon, {
tint: 0xFFFFFF
}, {
duration: 100,
easing: tween.linear
});
// Fourth: Return to normal size with bounce
tween(self, {
scaleX: 1,
scaleY: 1,
rotation: 0
}, {
duration: 400,
easing: tween.bounceOut
});
// Flash screen effect
LK.effects.flashScreen(0xFFD700, 500);
LK.getSound('unlock').play();
}
};
self.updateLockText = function () {
if (!self.isUnlocked) {
var remaining = self.unlockThreshold - totalClicks;
if (remaining > 0) {
lockText.setText(remaining);
}
}
};
self.down = function (x, y, obj) {
if (self.isUnlocked) {
setActiveCharacter(self.characterId);
}
};
return self;
});
var MenuButton = Container.expand(function (text, color, action) {
var self = Container.call(this);
var buttonBackground = self.attachAsset('characterSlot', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3,
scaleY: 1.5
});
buttonBackground.tint = color;
var buttonText = self.addChild(new Text2(text, {
size: 60,
fill: 0xFFFFFF
}));
buttonText.anchor.set(0.5, 0.5);
self.action = action;
self.down = function (x, y, obj) {
// Button press animation
tween(self, {
scaleX: 0.95,
scaleY: 0.95
}, {
duration: 100,
easing: tween.easeOut
});
tween(self, {
scaleX: 1,
scaleY: 1
}, {
duration: 100,
easing: tween.bounceOut
});
// Execute action after animation
LK.setTimeout(function () {
self.action();
}, 150);
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2C3E50
});
/****
* Game Code
****/
// Game state management
// Menu elements
var gameState = 'menu';
var menuContainer = new Container();
var gameContainer = new Container();
var optionsContainer = new Container();
var warningContainer = new Container();
// Game variables
var totalClicks = storage.totalClicks || 0;
var currentCharacterId = storage.currentCharacterId || 1;
var characters = [];
var characterSlots = [];
var unlockedCharacters = storage.unlockedCharacters || [1];
// Create menu
function createMenu() {
var menuTitle = new Text2('Anime Clicker Paradise', {
size: 120,
fill: 0xE74C3C
});
menuTitle.anchor.set(0.5, 0.5);
menuTitle.x = 2048 / 2;
menuTitle.y = 800;
menuContainer.addChild(menuTitle);
var playButton = new MenuButton('Play', 0x27AE60, function () {
gameState = 'game';
showGame();
});
playButton.x = 2048 / 2;
playButton.y = 1200;
menuContainer.addChild(playButton);
var optionsButton = new MenuButton('Options', 0x3498DB, function () {
gameState = 'options';
showOptions();
});
optionsButton.x = 2048 / 2;
optionsButton.y = 1400;
menuContainer.addChild(optionsButton);
var warningButton = new MenuButton('Warning', 0xF39C12, function () {
showWarningWindow();
});
warningButton.x = 2048 / 2;
warningButton.y = 1600;
menuContainer.addChild(warningButton);
}
// Create options menu
function createOptions() {
var optionsTitle = new Text2('Options', {
size: 100,
fill: 0xFFFFFF
});
optionsTitle.anchor.set(0.5, 0.5);
optionsTitle.x = 2048 / 2;
optionsTitle.y = 600;
optionsContainer.addChild(optionsTitle);
var resetButton = new MenuButton('Reset Game', 0xE74C3C, function () {
// Clear all saved data
storage.totalClicks = 0;
storage.currentCharacterId = 1;
storage.unlockedCharacters = [1];
// Reset all game variables
totalClicks = 0;
currentCharacterId = 1;
unlockedCharacters = [1];
// Reset score display
LK.setScore(0);
scoreText.setText('0');
clickValueText.setText('+1');
// Reset all character slots to locked state
for (var i = 0; i < characterSlots.length; i++) {
characterSlots[i].isUnlocked = false;
characterSlots[i].children[1].alpha = 0.3; // characterIcon
characterSlots[i].children[2].setText('?'); // lockText
}
// Unlock only the first character
characterSlots[0].unlock();
// Reset active character to first one
setActiveCharacter(1);
// Update all lock texts
for (var i = 0; i < characterSlots.length; i++) {
characterSlots[i].updateLockText();
}
// Flash screen to show reset
LK.effects.flashScreen(0xFF0000, 1500);
// Return to menu after reset
LK.setTimeout(function () {
gameState = 'menu';
showMenu();
}, 1500);
});
resetButton.x = 2048 / 2;
resetButton.y = 1200;
optionsContainer.addChild(resetButton);
var backButton = new MenuButton('Back', 0x95A5A6, function () {
gameState = 'menu';
showMenu();
});
backButton.x = 2048 / 2;
backButton.y = 1600;
optionsContainer.addChild(backButton);
}
function showMenu() {
menuContainer.visible = true;
gameContainer.visible = false;
optionsContainer.visible = false;
}
function showGame() {
menuContainer.visible = false;
gameContainer.visible = true;
optionsContainer.visible = false;
}
function showOptions() {
menuContainer.visible = false;
gameContainer.visible = false;
optionsContainer.visible = true;
}
// Character data
var characterData = [{
id: 1,
points: 1,
unlockAt: 0
}, {
id: 2,
points: 2,
unlockAt: 50
}, {
id: 3,
points: 5,
unlockAt: 200
}, {
id: 4,
points: 10,
unlockAt: 500
}, {
id: 5,
points: 20,
unlockAt: 1000
}, {
id: 6,
points: 35,
unlockAt: 2000
}, {
id: 7,
points: 60,
unlockAt: 4000
}, {
id: 8,
points: 100,
unlockAt: 7500
}, {
id: 9,
points: 175,
unlockAt: 12000
}, {
id: 10,
points: 300,
unlockAt: 20000
}, {
id: 11,
points: 500,
unlockAt: 35000
}, {
id: 12,
points: 850,
unlockAt: 60000
}, {
id: 13,
points: 1400,
unlockAt: 100000
}, {
id: 14,
points: 2500,
unlockAt: 175000
}, {
id: 15,
points: 5000,
unlockAt: 300000
}];
// Initialize all containers
game.addChild(menuContainer);
game.addChild(gameContainer);
game.addChild(optionsContainer);
game.addChild(warningContainer);
// Create warning window
function createWarningWindow() {
// Semi-transparent background overlay
var overlay = warningContainer.addChild(LK.getAsset('characterSlot', {
anchorX: 0,
anchorY: 0,
scaleX: 17,
scaleY: 23
}));
overlay.tint = 0x000000;
overlay.alpha = 0.7;
// Warning window background
var windowBackground = warningContainer.addChild(LK.getAsset('characterSlot', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 8,
scaleY: 4
}));
windowBackground.x = 2048 / 2;
windowBackground.y = 2732 / 2;
windowBackground.tint = 0x34495e;
// Warning text
var warningText = warningContainer.addChild(new Text2('This game is in beta,\nso it may have bugs.', {
size: 60,
fill: 0xFFFFFF
}));
warningText.anchor.set(0.5, 0.5);
warningText.x = 2048 / 2;
warningText.y = 2732 / 2 - 50;
// OK button to close window
var okButton = new MenuButton('OK', 0x27AE60, function () {
hideWarningWindow();
});
okButton.x = 2048 / 2;
okButton.y = 2732 / 2 + 100;
warningContainer.addChild(okButton);
}
function showWarningWindow() {
warningContainer.visible = true;
// Animate window appearance
warningContainer.alpha = 0;
tween(warningContainer, {
alpha: 1
}, {
duration: 300,
easing: tween.easeOut
});
}
function hideWarningWindow() {
// Animate window disappearance
tween(warningContainer, {
alpha: 0
}, {
duration: 200,
easing: tween.easeIn,
onFinish: function onFinish() {
warningContainer.visible = false;
}
});
}
// Create menu and options
createMenu();
createOptions();
createWarningWindow();
// Set initial container visibility
warningContainer.visible = false;
// UI Elements for game
var scoreText = new Text2(totalClicks.toString(), {
size: 80,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
var clickValueText = new Text2('+1', {
size: 60,
fill: 0xF1C40F
});
clickValueText.anchor.set(0.5, 0.5);
clickValueText.x = 2048 / 2;
clickValueText.y = 800;
clickValueText.alpha = 0;
gameContainer.addChild(clickValueText);
var titleText = new Text2('Anime Clicker Paradise', {
size: 50,
fill: 0xE74C3C
});
titleText.anchor.set(0.5, 0);
titleText.y = 100;
// Create characters
for (var i = 0; i < characterData.length; i++) {
var charData = characterData[i];
var character = new AnimeCharacter(charData.id, charData.points);
character.x = 2048 / 2;
character.y = 1200;
character.visible = false;
characters.push(character);
gameContainer.addChild(character);
}
// Create character selection slots
var slotsPerRow = 5;
var slotSpacing = 140;
var rowSpacing = 150;
var startY = 2100;
var totalRows = Math.ceil(characterData.length / slotsPerRow);
var slotStartX = (2048 - slotsPerRow * slotSpacing) / 2 + 70;
for (var i = 0; i < characterData.length; i++) {
var charData = characterData[i];
var slot = new CharacterSlot(charData.id, charData.unlockAt);
var row = Math.floor(i / slotsPerRow);
var col = i % slotsPerRow;
var rowWidth = Math.min(characterData.length - row * slotsPerRow, slotsPerRow);
var rowStartX = (2048 - rowWidth * slotSpacing) / 2 + 70;
slot.x = rowStartX + col * slotSpacing;
slot.y = startY + row * rowSpacing;
characterSlots.push(slot);
gameContainer.addChild(slot);
}
// Add GUI elements only when in game state
function updateGUI() {
if (gameState === 'game') {
if (scoreText.parent !== LK.gui.top) {
LK.gui.top.addChild(scoreText);
}
if (titleText.parent !== LK.gui.top) {
LK.gui.top.addChild(titleText);
}
} else {
if (scoreText.parent) {
scoreText.parent.removeChild(scoreText);
}
if (titleText.parent) {
titleText.parent.removeChild(titleText);
}
}
}
function setActiveCharacter(characterId) {
// Hide all characters
for (var i = 0; i < characters.length; i++) {
characters[i].visible = false;
characters[i].setActive(false);
}
// Show and activate selected character
var character = characters[characterId - 1];
character.visible = true;
character.setActive(true);
currentCharacterId = characterId;
// Update click value display
clickValueText.setText('+' + character.pointValue);
// Save progress
storage.currentCharacterId = currentCharacterId;
}
function checkUnlocks() {
for (var i = 0; i < characterData.length; i++) {
var charData = characterData[i];
if (totalClicks >= charData.unlockAt && unlockedCharacters.indexOf(charData.id) === -1) {
unlockedCharacters.push(charData.id);
characterSlots[i].unlock();
}
}
// Update lock text on all slots
for (var i = 0; i < characterSlots.length; i++) {
characterSlots[i].updateLockText();
}
// Save progress
storage.totalClicks = totalClicks;
storage.unlockedCharacters = unlockedCharacters;
}
// Initialize unlocked characters
for (var i = 0; i < unlockedCharacters.length; i++) {
var charId = unlockedCharacters[i];
characterSlots[charId - 1].unlock();
}
// Set initial active character
setActiveCharacter(currentCharacterId);
// Initialize score
LK.setScore(totalClicks);
// Start with menu
showMenu();
// Click value text animation
var clickValueAlpha = 0;
var clickValueFadeTimer = 0;
game.update = function () {
// Update GUI based on state
updateGUI();
// Only run game logic when in game state
if (gameState === 'game') {
// Animate click value text
if (clickValueAlpha > 0) {
clickValueFadeTimer--;
if (clickValueFadeTimer <= 0) {
clickValueAlpha -= 0.02;
if (clickValueAlpha < 0) clickValueAlpha = 0;
clickValueText.alpha = clickValueAlpha;
}
}
// Check for new unlocks periodically
if (LK.ticks % 60 === 0) {
checkUnlocks();
}
}
};
// Show click value when character is clicked (only in game state)
var originalDown = game.down;
game.down = function (x, y, obj) {
if (gameState === 'game') {
clickValueAlpha = 1;
clickValueFadeTimer = 30;
clickValueText.alpha = clickValueAlpha;
}
if (originalDown) {
originalDown(x, y, obj);
}
};
Beautiful anime style girl, with white hair and gray eyes. In-Game asset. 2d. High contrast. No shadows. Pixel art
Make her blush and put on a shy expression
Beautiful anime-style girl with black hair and red eyes. Game image. 2D. High contrast. No shadows. Pixel art.. In-Game asset. 2d. High contrast. No shadows
Make her blush and put on a shy expression
Beautiful anime-style girl with gray hair and light blue eyes. Game image. 2D. High contrast. No shadows. Pixel art.. In-Game asset. 2d. High contrast. No shadows
Make her blush and put on a shy expression