/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
// Initialize assets for play button
var Anomaly = Container.expand(function () {
var self = Container.call(this);
// Use a dedicated anomaly asset for visual distinction
var anomalyGraphics = self.attachAsset('anomalyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.2,
scaleY: 1.2
});
// Animate the anomaly asset with a pulsing effect using tween
tween(anomalyGraphics, {
scaleX: 1.4,
scaleY: 1.4
}, {
duration: 600,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(anomalyGraphics, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 600,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Loop the pulse
if (self.parent) {
// Only pulse if still in scene
tween(anomalyGraphics, {
scaleX: 1.4,
scaleY: 1.4
}, {
duration: 600,
easing: tween.easeInOut,
onFinish: arguments.callee
});
}
}
});
}
});
var anomalyType = null;
var anomalyStartTime = LK.ticks;
var anomalyDuration = 1200; // 20 seconds at 60 FPS
self.getAnomalyType = function () {
return anomalyType;
};
self.setAnomalyType = function (type) {
anomalyType = type;
};
self.isExpired = function () {
return LK.ticks - anomalyStartTime >= anomalyDuration;
};
self.getTimeRemaining = function () {
return Math.max(0, anomalyDuration - (LK.ticks - anomalyStartTime));
};
self.setInteractive = function (interactive) {
self.interactive = interactive;
anomalyGraphics.interactive = interactive;
}; //{E_new}
return self;
});
var Sushi = Container.expand(function () {
var self = Container.call(this);
var equippedSkinColor = 0xffa500;
var equippedSkinAssetId = 'sushi';
var equippedSkinId = storage.equippedSkin || 'default';
var isSpecialGoldenSushi = false;
var randomChance = Math.random() < 0.001;
var isEvery100th = totalSushiSpawned > 0 && totalSushiSpawned % 100 === 0;
if (randomChance || isEvery100th) {
isSpecialGoldenSushi = true;
equippedSkinColor = 0xFFD700;
}
for (var skinIdx = 0; skinIdx < availableSkins.length; skinIdx++) {
if (availableSkins[skinIdx].id === equippedSkinId) {
equippedSkinColor = availableSkins[skinIdx].color;
if (availableSkins[skinIdx].assetId) {
equippedSkinAssetId = availableSkins[skinIdx].assetId;
}
break;
}
}
var sushiGraphics = self.attachAsset(equippedSkinAssetId, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2.5,
scaleY: 2.5
});
if (isWandAnomalyActive) {
sushiGraphics.tint = 0x9D4EDD;
} else if (isSpecialGoldenSushi && !equippedSkinAssetId.includes('BattlePass')) {
sushiGraphics.tint = 0xFFD700;
}
self.speed = 5;
self.caught = false;
self.lastY = self.y;
self.interactive = true;
self.buttonMode = true;
self.down = function (x, y, obj) {
if (!self.caught) {
self.caught = true;
totalSushiCaught += 1;
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
var expGain = isWandAnomalyActive ? 30 : isSpecialGoldenSushi ? 75 : 1;
storage.battlePassExp += expGain;
var expNeededForLevel = 200;
var levelUpOccurred = false;
while (storage.battlePassExp >= expNeededForLevel && storage.battlePassLevel < 250) {
storage.battlePassExp -= expNeededForLevel;
storage.battlePassLevel += 1;
levelUpOccurred = true;
var unlockedLevel = storage.battlePassLevel;
if (unlockedLevel === 10 || unlockedLevel === 15 || unlockedLevel === 20 || unlockedLevel === 25 || unlockedLevel === 30) {
var rewardSkinIndex = unlockedLevel / 5 - 1;
var rewardSkins = ['gold', 'purple', 'cyan', 'lime', 'pink'];
if (rewardSkins[rewardSkinIndex]) {
storage.unlockedBattlePassSkins[rewardSkins[rewardSkinIndex]] = true;
storage.sushiSkins[rewardSkins[rewardSkinIndex]] = true;
}
}
}
if (levelUpOccurred && gameState === 'playing') {
refreshWardrobeDisplay();
}
self.destroy();
}
};
self.update = function () {
self.lastY = self.y;
if (self.isSidesMode) {
// Sides mode: move in 8 directions away from center
self.x += self.sidesVelocityX;
self.y += self.sidesVelocityY;
} else {
// Normal mode: move downward
self.y += self.speed;
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Game state - MUST be defined before game.update
// Anomaly visual asset (purple glowing button style)
var gameMode = 'normal'; // 'normal' or 'sides'
var gameState = 'menu'; // 'menu', 'playing', or 'settings'
var currentDifficulty = 'medium'; // 'easy', 'medium', 'hard', or 'extremo'
var sushiSpawnRate = 60; // ticks between spawns
var isMenuMusicPlaying = false;
var isBattleMusicPlaying = false;
// Initialize default equipped skin if not set
if (!storage.equippedSkin) {
storage.equippedSkin = 'default';
}
if (!storage.sushiSkins) {
storage.sushiSkins = {};
}
if (!storage.unlockedBattlePassSkins) {
storage.unlockedBattlePassSkins = {};
}
// Create game background
var gameBackground = LK.getAsset('gameBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366
});
game.addChild(gameBackground);
// Create danger line at bottom
// Initialize assets for play button
var dangerLine = LK.getAsset('dangerLine', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2500
});
game.addChild(dangerLine); //{p_end}
// Score display
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Battle Pass display with button styling
var battlePassButtonBg = LK.getAsset('expButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 230
});
game.addChild(battlePassButtonBg);
var battlePassTxt = new Text2('Lvl ' + storage.battlePassLevel + ' ' + storage.battlePassExp + '/200', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
battlePassTxt.anchor.set(0.5, 0.5);
battlePassTxt.x = 1024;
battlePassTxt.y = 230;
game.addChild(battlePassTxt);
//{w_end}
// Game variables
var sushiArray = [];
var sushiSpawnTimer = null;
var totalSushiSpawned = 0;
var totalSushiCaught = 0;
var currentAnomaly = null;
var anomalySpawnChance = 0.0002; // Very low probability
var anomalyActive = false;
var originalSushiSpeedMultiplier = 1;
var lastSwordAnomalySushiCount = 0;
var anomalyText = new Text2('', {
size: 60,
fill: 0xFF00FF
});
anomalyText.anchor.set(0.5, 0.5);
anomalyText.x = 1850;
anomalyText.y = 150;
game.addChild(anomalyText);
var isHeartAnomalyActive = false;
var heartAnomalyFilter = null;
var isWandAnomalyActive = false;
// In-game shop offers container
var gameShopContainer = new Container();
game.addChild(gameShopContainer);
gameShopContainer.visible = false;
// In-game shop title
var gameShopTitle = new Text2('Shop', {
size: 120,
fill: 0xFF6B6B
});
gameShopTitle.anchor.set(0.5, 0.5);
gameShopTitle.x = 1024;
gameShopTitle.y = 300;
gameShopContainer.addChild(gameShopTitle);
// In-game shop close button
var gameShopCloseButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1898,
y: 2582
});
gameShopContainer.addChild(gameShopCloseButtonBg);
var gameShopCloseButtonText = new Text2('✕', {
size: 80,
fill: 0xFFFFFF
});
gameShopCloseButtonText.anchor.set(0.5, 0.5);
gameShopCloseButtonText.x = 1898;
gameShopCloseButtonText.y = 2582;
gameShopContainer.addChild(gameShopCloseButtonText);
gameShopCloseButtonBg.interactive = true;
gameShopCloseButtonBg.down = function (x, y, obj) {
gameShopContainer.visible = false;
};
// Game update loop
game.update = function () {
// Handle music playback based on game state
if (gameState === 'menu' && !isMenuMusicPlaying) {
LK.playMusic('menuMusic', {
loop: true
});
isMenuMusicPlaying = true;
isBattleMusicPlaying = false;
} else if (gameState === 'playing' && !isBattleMusicPlaying) {
LK.playMusic('battleMusic', {
loop: true
});
isBattleMusicPlaying = true;
isMenuMusicPlaying = false;
} else if (gameState !== 'menu' && gameState !== 'playing' && isMenuMusicPlaying) {
LK.stopMusic();
isMenuMusicPlaying = false;
isBattleMusicPlaying = false;
}
if (gameState === 'playing') {
dangerLine.visible = true;
// Sword anomaly disabled - do not trigger
// if (!anomalyActive && totalSushiSpawned > 0 && totalSushiSpawned >= lastSwordAnomalySushiCount + 150) {
// lastSwordAnomalySushiCount = totalSushiSpawned;
// currentAnomaly = new Anomaly();
// currentAnomaly.x = 1850;
// currentAnomaly.y = 150;
// game.addChild(currentAnomaly);
// anomalyActive = true;
// currentAnomaly.setAnomalyType('sword');
// sushiSpawnRate = Math.floor(sushiSpawnRate / 2);
// anomalyText.setText('⚔️SWORD⚔️');
// }
// Handle anomaly expiration
if (currentAnomaly !== null && currentAnomaly.isExpired()) {
// Restore original game state
if (currentAnomaly.getAnomalyType() === 'speed') {
originalSushiSpeedMultiplier = 1;
} else if (currentAnomaly.getAnomalyType() === 'dangerLine') {
dangerLine.y = 2500;
} else if (currentAnomaly.getAnomalyType() === 'sword') {
var baseSpawnRate = currentDifficulty === 'easy' ? 90 : currentDifficulty === 'medium' ? 60 : currentDifficulty === 'hard' ? 40 : currentDifficulty === 'extremo' ? 25 : 12;
sushiSpawnRate = baseSpawnRate;
} else if (currentAnomaly.getAnomalyType() === 'heart') {
isHeartAnomalyActive = false;
if (heartAnomalyFilter !== null) {
tween(heartAnomalyFilter, {
alpha: 0
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
if (heartAnomalyFilter !== null && heartAnomalyFilter.parent) {
game.removeChild(heartAnomalyFilter);
heartAnomalyFilter = null;
}
}
});
}
} else if (currentAnomaly.getAnomalyType() === 'wand') {
originalSushiSpeedMultiplier = 1;
isWandAnomalyActive = false;
}
currentAnomaly.destroy();
game.removeChild(currentAnomaly);
currentAnomaly = null;
anomalyActive = false;
anomalyText.setText('');
}
// Attempt to spawn anomaly every 200 sushis caught
if (!anomalyActive && totalSushiCaught > 0 && totalSushiCaught % 200 === 0) {
currentAnomaly = new Anomaly();
currentAnomaly.x = 1850;
currentAnomaly.y = 150;
game.addChild(currentAnomaly);
anomalyActive = true;
var anomalyTypeRoll = Math.random();
var selectedAnomalyType = anomalyTypeRoll < 0.25 ? 'speed' : anomalyTypeRoll < 0.50 ? 'bomb' : anomalyTypeRoll < 0.75 ? 'dangerLine' : 'wand';
currentAnomaly.setAnomalyType(selectedAnomalyType);
// Apply anomaly effect
if (selectedAnomalyType === 'speed') {
originalSushiSpeedMultiplier = 3;
anomalyText.setText('⚡SPEED⚡');
} else if (selectedAnomalyType === 'bomb') {
anomalyText.setText('💣BOMB💣');
// Trigger bomb effect on all current sushi
for (var bombIdx = sushiArray.length - 1; bombIdx >= 0; bombIdx--) {
var sushiToBomb = sushiArray[bombIdx];
if (!sushiToBomb.caught) {
LK.effects.flashObject(sushiToBomb, 0xFF6B00, 300);
sushiToBomb.caught = true;
sushiToBomb.destroy();
sushiArray.splice(bombIdx, 1);
}
}
} else if (selectedAnomalyType === 'dangerLine') {
dangerLine.y = 1200;
anomalyText.setText('☠️DANGER☠️');
} else if (selectedAnomalyType === 'wand') {
originalSushiSpeedMultiplier = 0.5;
anomalyText.setText('✨WAND✨');
isWandAnomalyActive = true;
currentAnomaly.setInteractive(false);
}
}
// Calculate difficulty-based speed multiplier for sides mode
var sidesSpeedMultiplier = currentDifficulty === 'easy' ? 0.6 : currentDifficulty === 'medium' ? 1.0 : currentDifficulty === 'hard' ? 1.4 : currentDifficulty === 'extremo' ? 2.0 : 2.8;
// Spawn sushi periodically
if (LK.ticks % sushiSpawnRate === 0) {
totalSushiSpawned += 1;
var newSushi = new Sushi();
if (gameMode === 'sides') {
// Sides mode: spawn from center, move in 8 directions
newSushi.x = 1024;
newSushi.y = 1366;
newSushi.isSidesMode = true;
var directionIndex = Math.floor(Math.random() * 8);
var directions = [{
vx: 0,
vy: -4
},
// North
{
vx: -2.83,
vy: -2.83
},
// Northwest
{
vx: 4,
vy: 0
},
// East
{
vx: 2.83,
vy: -2.83
},
// Northeast
{
vx: -4,
vy: 0
},
// West
{
vx: -2.83,
vy: 2.83
},
// Southwest
{
vx: 0,
vy: 4
},
// South
{
vx: 2.83,
vy: 2.83
} // Southeast
];
var selectedDirection = directions[directionIndex];
newSushi.sidesVelocityX = selectedDirection.vx * sidesSpeedMultiplier;
newSushi.sidesVelocityY = selectedDirection.vy * sidesSpeedMultiplier;
newSushi.sidesDirection = directionIndex;
} else {
// Normal mode: spawn from top
newSushi.x = Math.random() * 1800 + 100;
newSushi.y = -100;
newSushi.isSidesMode = false;
}
newSushi.lastY = newSushi.y;
var baseSpeed = currentDifficulty === 'easy' ? 3 : currentDifficulty === 'medium' ? 5 : currentDifficulty === 'hard' ? 8 : currentDifficulty === 'extremo' ? 12 : 24;
newSushi.speed = baseSpeed * originalSushiSpeedMultiplier;
if (anomalyActive && currentAnomaly && currentAnomaly.getAnomalyType() === 'sword') {
newSushi.scaleX = 1.5;
newSushi.scaleY = 1.5;
}
sushiArray.push(newSushi);
game.addChild(newSushi);
}
// Update and check sushi
for (var i = sushiArray.length - 1; i >= 0; i--) {
var sushi = sushiArray[i];
if (sushi.isSidesMode) {
// Sides mode: check if sushi reaches any edge boundary
if (sushi.x < 50 || sushi.x > 1998 || sushi.y < 50 || sushi.y > 2682) {
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
}
} else {
// Normal mode: check if sushi reaches the bottom danger line
if (sushi.lastY <= 2500 && sushi.y > 2500) {
if (!isHeartAnomalyActive) {
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
}
}
}
}
battlePassTxt.setText('Lvl ' + storage.battlePassLevel + ' ' + storage.battlePassExp + '/200');
battlePassButtonBg.x = battlePassTxt.x;
battlePassButtonBg.y = battlePassTxt.y;
} else {
//{1k_new}
dangerLine.visible = false;
// Reset anomaly when leaving gameplay
if (currentAnomaly !== null) {
currentAnomaly.destroy();
game.removeChild(currentAnomaly);
currentAnomaly = null;
anomalyActive = false;
originalSushiSpeedMultiplier = 1;
dangerLine.y = 2500;
anomalyText.setText('');
}
}
};
// Create main menu UI
var menuContainer = new Container();
game.addChild(menuContainer);
// Menu title
var titleAsset = LK.getAsset('cazaDeSushisTitle', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 700
});
menuContainer.addChild(titleAsset);
// Play button - Start Game
var playButtonBg = LK.getAsset('playButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1800,
scaleX: 5.5,
scaleY: 1.8
});
menuContainer.addChild(playButtonBg);
var playButtonText = new Text2('', {
size: 100,
fill: 0xFFFFFF
});
playButtonText.anchor.set(0.5, 0.5);
playButtonText.x = 1024;
playButtonText.y = 1800;
menuContainer.addChild(playButtonText);
// Create mode selection container
var modeSelectionContainer = new Container();
game.addChild(modeSelectionContainer);
modeSelectionContainer.visible = false;
var modeSelectionTitle = new Text2('Select Mode', {
size: 150,
fill: 0xFFFFFF
});
modeSelectionTitle.anchor.set(0.5, 0.5);
modeSelectionTitle.x = 1024;
modeSelectionTitle.y = 600;
modeSelectionContainer.addChild(modeSelectionTitle);
// Normal mode button
var normalModeButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1200,
scaleX: 2.2,
scaleY: 1.5
});
modeSelectionContainer.addChild(normalModeButtonBg);
var normalModeButtonText = new Text2('NORMAL MODE', {
size: 90,
fill: 0x000000,
fontWeight: 'bold'
});
normalModeButtonText.anchor.set(0.5, 0.5);
normalModeButtonText.x = 1024;
normalModeButtonText.y = 1200;
modeSelectionContainer.addChild(normalModeButtonText);
normalModeButtonBg.interactive = true;
normalModeButtonBg.down = function (x, y, obj) {
gameMode = 'normal';
gameState = 'playing';
modeSelectionContainer.visible = false;
menuContainer.visible = false;
gameMenuButtonBg.visible = true;
gameMenuButtonText.visible = true;
gameBackButtonBg.visible = true;
gameBackButtonText.visible = true;
};
// Sides mode button
var sidesModeButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1550,
scaleX: 2.2,
scaleY: 1.5
});
modeSelectionContainer.addChild(sidesModeButtonBg);
var sidesModeButtonText = new Text2('SIDES MODE', {
size: 90,
fill: 0x000000,
fontWeight: 'bold'
});
sidesModeButtonText.anchor.set(0.5, 0.5);
sidesModeButtonText.x = 1024;
sidesModeButtonText.y = 1550;
modeSelectionContainer.addChild(sidesModeButtonText);
sidesModeButtonBg.interactive = true;
sidesModeButtonBg.down = function (x, y, obj) {
gameMode = 'sides';
gameState = 'playing';
modeSelectionContainer.visible = false;
menuContainer.visible = false;
gameMenuButtonBg.visible = true;
gameMenuButtonText.visible = true;
gameBackButtonBg.visible = true;
gameBackButtonText.visible = true;
};
// Mode selection back button
var modeSelectionBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
});
modeSelectionContainer.addChild(modeSelectionBackButtonBg);
var modeSelectionBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
modeSelectionBackButtonText.anchor.set(0.5, 0.5);
modeSelectionBackButtonText.x = 150;
modeSelectionBackButtonText.y = 2582;
modeSelectionContainer.addChild(modeSelectionBackButtonText);
modeSelectionBackButtonBg.interactive = true;
modeSelectionBackButtonBg.down = function (x, y, obj) {
gameState = 'menu';
modeSelectionContainer.visible = false;
menuContainer.visible = true;
};
// Make play button interactive
playButtonBg.interactive = true;
playButtonBg.down = function (x, y, obj) {
gameState = 'modeSelection';
menuContainer.visible = false;
modeSelectionContainer.visible = true;
};
// Settings button
var settingsButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2150,
scaleX: 1.6,
scaleY: 1.6
});
menuContainer.addChild(settingsButtonBg);
var settingsButtonText = new Text2('⚙️', {
size: 120,
fill: 0xFFFFFF
});
settingsButtonText.anchor.set(0.5, 0.5);
settingsButtonText.x = 1024;
settingsButtonText.y = 2150;
menuContainer.addChild(settingsButtonText);
settingsButtonBg.interactive = true;
settingsButtonBg.down = function (x, y, obj) {
gameState = 'settings';
menuContainer.visible = false;
settingsMenuContainer.visible = true;
};
// Shop button
var shopButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1900
});
menuContainer.addChild(shopButtonBg);
var shopButtonText = new Text2('🛍️', {
size: 80,
fill: 0xFFFFFF
});
shopButtonText.anchor.set(0.5, 0.5);
shopButtonText.x = 1024;
shopButtonText.y = 1900;
menuContainer.addChild(shopButtonText);
shopButtonBg.interactive = false;
shopButtonBg.visible = false;
shopButtonText.visible = false;
// Settings menu container
var settingsMenuContainer = new Container();
game.addChild(settingsMenuContainer);
settingsMenuContainer.visible = false;
// Shop menu container
var shopMenuContainer = new Container();
game.addChild(shopMenuContainer);
shopMenuContainer.visible = false;
var shopTitle = new Text2('Shop', {
size: 180,
fill: 0xFF6B6B
});
shopTitle.anchor.set(0.5, 0.5);
shopTitle.x = 1024;
shopTitle.y = 400;
shopMenuContainer.addChild(shopTitle);
// Shop back button (bottom-left)
var shopBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
});
shopMenuContainer.addChild(shopBackButtonBg);
var shopBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
shopBackButtonText.anchor.set(0.5, 0.5);
shopBackButtonText.x = 150;
shopBackButtonText.y = 2582;
shopMenuContainer.addChild(shopBackButtonText);
shopBackButtonBg.interactive = true;
shopBackButtonBg.down = function (x, y, obj) {
gameState = 'menu';
shopMenuContainer.visible = false;
menuContainer.visible = true;
};
// Wardrobe button
var wardrobeButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2150
});
menuContainer.addChild(wardrobeButtonBg);
var wardrobeButtonText = new Text2('👕', {
size: 80,
fill: 0xFFFFFF
});
wardrobeButtonText.anchor.set(0.5, 0.5);
wardrobeButtonText.x = 150;
wardrobeButtonText.y = 150;
menuContainer.addChild(wardrobeButtonText);
wardrobeButtonBg.interactive = false;
// Wardrobe menu container
var wardrobeMenuContainer = new Container();
game.addChild(wardrobeMenuContainer);
wardrobeMenuContainer.visible = false;
var wardrobeTitle = new Text2('Wardrobe', {
size: 180,
fill: 0xFF6B6B
});
wardrobeTitle.anchor.set(0.5, 0.5);
wardrobeTitle.x = 1024;
wardrobeTitle.y = 300;
wardrobeMenuContainer.addChild(wardrobeTitle);
// Initialize sushi skins in storage if not exists
if (!storage.sushiSkins) {
storage.sushiSkins = {};
}
if (!storage.equippedSkin) {
storage.equippedSkin = 'default';
}
// Available skins with their costs and colors
var availableSkins = [{
id: 'default',
name: 'Default',
color: 0xffa500,
cost: 0,
assetId: 'sushi'
}, {
id: 'gold',
name: 'Gold (BP Lvl 10)',
color: 0xFFD700,
cost: 0,
assetId: 'sushiBattlePass1'
}, {
id: 'purple',
name: 'Purple (BP Lvl 15)',
color: 0x9D4EDD,
cost: 0,
assetId: 'sushiBattlePass2'
}, {
id: 'cyan',
name: 'Cyan (BP Lvl 20)',
color: 0x00F5FF,
cost: 0,
assetId: 'sushiBattlePass3'
}, {
id: 'lime',
name: 'Lime',
color: 0x00FF00,
cost: 750
}, {
id: 'pink',
name: 'Pink',
color: 0xFF1493,
cost: 1000
}, {
id: 'silver',
name: 'Silver',
color: 0xC0C0C0,
cost: 1500
}];
// Wardrobe scroll container for skins grid
var wardrobeSkinContainer = new Container();
wardrobeMenuContainer.addChild(wardrobeSkinContainer);
wardrobeSkinContainer.x = 200;
wardrobeSkinContainer.y = 600;
wardrobeSkinContainer.width = 1648;
wardrobeSkinContainer.height = 1400;
wardrobeSkinContainer.interactive = true;
var wardrobeSkinMask = new Container();
wardrobeSkinMask.x = 200;
wardrobeSkinMask.y = 600;
var maskGraphic = LK.getAsset('playButtonBg', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0,
scaleX: 2.06,
scaleY: 1.75
});
wardrobeSkinMask.addChild(maskGraphic);
game.addChild(wardrobeSkinMask);
wardrobeSkinContainer.mask = maskGraphic;
var wardrobeScrollOffset = 0;
var wardrobeMaxScroll = 0;
function displayWardrobeSkins() {
wardrobeSkinContainer.removeChildren();
var unlockedSkins = [];
for (var u = 0; u < availableSkins.length; u++) {
var checkSkin = availableSkins[u];
if (checkSkin.id === 'default' || storage.sushiSkins[checkSkin.id]) {
unlockedSkins.push(checkSkin);
}
}
var skinsPerRow = 3;
var skinBoxSize = 200;
var skinGap = 100;
var skinX = 0;
var skinY = wardrobeScrollOffset;
for (var s = 0; s < unlockedSkins.length; s++) {
var skin = unlockedSkins[s];
var colIndex = s % skinsPerRow;
var rowIndex = Math.floor(s / skinsPerRow);
skinX = colIndex * (skinBoxSize + skinGap) + 50;
skinY = rowIndex * (skinBoxSize + skinGap) + wardrobeScrollOffset;
var skinBox = LK.getAsset('playButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: skinX,
y: skinY,
scaleX: 1.5,
scaleY: 1.5
});
wardrobeSkinContainer.addChild(skinBox);
var isEquippedSkin = storage.equippedSkin === skin.id;
var isBattlePassReward = skin.id === 'gold' || skin.id === 'purple' || skin.id === 'cyan' || skin.id === 'lime' || skin.id === 'pink';
var requiredBPLevel = skin.id === 'gold' ? 10 : skin.id === 'purple' ? 15 : skin.id === 'cyan' ? 20 : skin.id === 'lime' ? 25 : skin.id === 'pink' ? 30 : 0;
var isUnlocked = skin.id === 'default' || storage.sushiSkins[skin.id];
if (isEquippedSkin) {
skinBox.tint = 0x00FF00;
} else if (isBattlePassReward && !isUnlocked && storage.battlePassLevel < requiredBPLevel) {
skinBox.tint = 0x555555;
} else {
skinBox.tint = 0x333333;
}
var assetIdToUse = skin.assetId || 'sushi';
var sushiAsset = LK.getAsset(assetIdToUse, {
anchorX: 0.5,
anchorY: 0.5,
x: skinX,
y: skinY,
scaleX: 2,
scaleY: 2
});
if (!skin.assetId) {
sushiAsset.tint = skin.color;
}
wardrobeSkinContainer.addChild(sushiAsset);
var isEquipped = storage.equippedSkin === skin.id;
var statusSymbol = isEquipped ? '✓' : '';
var isBattlePassSkin = skin.id === 'gold' || skin.id === 'purple' || skin.id === 'cyan' || skin.id === 'lime' || skin.id === 'pink';
var requiredLevel = skin.id === 'gold' ? 10 : skin.id === 'purple' ? 15 : skin.id === 'cyan' ? 20 : skin.id === 'lime' ? 25 : skin.id === 'pink' ? 30 : 0;
var levelInfo = isBattlePassSkin && requiredLevel > 0 ? ' [Lvl ' + requiredLevel + ']' : '';
var skinLabel = new Text2(skin.name + levelInfo + '\n' + statusSymbol, {
size: 50,
fill: 0xFFFFFF
});
skinLabel.anchor.set(0.5, 0.5);
skinLabel.x = skinX;
skinLabel.y = skinY + 120;
wardrobeSkinContainer.addChild(skinLabel);
skinBox.interactive = true;
skinBox.skinId = skin.id;
sushiAsset.interactive = true;
sushiAsset.skinId = skin.id;
var skinBoxDown = function skinBoxDown(x, y, obj) {
var clickedSkinId = this.skinId;
if (storage.sushiSkins[clickedSkinId] || clickedSkinId === 'default') {
storage.equippedSkin = clickedSkinId;
displayWardrobeSkins();
}
};
skinBox.skinId = skin.id;
skinBox.down = skinBoxDown;
sushiAsset.skinId = skin.id;
sushiAsset.down = skinBoxDown;
}
wardrobeMaxScroll = Math.max(0, Math.ceil(unlockedSkins.length / 3) * 300 - 1400);
}
displayWardrobeSkins();
wardrobeMenuContainer.move = function (x, y, obj) {
var scrollAmount = 100;
};
wardrobeMenuContainer.down = function (x, y, obj) {
wardrobeLastY = y;
};
wardrobeMenuContainer.up = function (x, y, obj) {};
var wardrobeLastY = 0;
function refreshWardrobeDisplay() {
displayWardrobeSkins();
}
// Wardrobe back button
var wardrobeBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
}); //{3b_new}
wardrobeMenuContainer.addChild(wardrobeBackButtonBg);
var wardrobeBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
wardrobeBackButtonText.anchor.set(0.5, 0.5);
wardrobeBackButtonText.x = 150;
wardrobeBackButtonText.y = 2582;
wardrobeMenuContainer.addChild(wardrobeBackButtonText);
wardrobeBackButtonBg.interactive = true;
wardrobeBackButtonBg.down = function (x, y, obj) {
gameState = 'menu';
wardrobeMenuContainer.visible = false;
menuContainer.visible = true;
};
var settingsTitle = new Text2('Difficulty', {
size: 180,
fill: 0x9D4EDD,
fontWeight: 'bold' //{4k_new}
});
settingsTitle.anchor.set(0.5, 0.5);
settingsTitle.x = 1024;
settingsTitle.y = 600;
settingsMenuContainer.addChild(settingsTitle);
// Easy button
var easyButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1100,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(easyButtonBg);
var easyButtonText = new Text2('EASY', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
easyButtonText.anchor.set(0.5, 0.5);
easyButtonText.x = 1024;
easyButtonText.y = 1100;
settingsMenuContainer.addChild(easyButtonText);
easyButtonBg.interactive = true;
easyButtonBg.down = function (x, y, obj) {
currentDifficulty = 'easy';
sushiSpawnRate = 90;
returnToMenu();
};
// Medium button
var mediumButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1350,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(mediumButtonBg);
var mediumButtonText = new Text2('MEDIUM', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
mediumButtonText.anchor.set(0.5, 0.5);
mediumButtonText.x = 1024;
mediumButtonText.y = 1350;
settingsMenuContainer.addChild(mediumButtonText);
mediumButtonBg.interactive = true;
mediumButtonBg.down = function (x, y, obj) {
currentDifficulty = 'medium';
sushiSpawnRate = 60;
returnToMenu();
};
// Hard button
var hardButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1600,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(hardButtonBg);
var hardButtonText = new Text2('HARD', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
hardButtonText.anchor.set(0.5, 0.5);
hardButtonText.x = 1024;
hardButtonText.y = 1600;
settingsMenuContainer.addChild(hardButtonText);
hardButtonBg.interactive = true;
hardButtonBg.down = function (x, y, obj) {
currentDifficulty = 'hard';
sushiSpawnRate = 40;
returnToMenu();
};
// Extremo button
var extremoButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1850,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(extremoButtonBg);
var extremoButtonText = new Text2('EXTREMO', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
extremoButtonText.anchor.set(0.5, 0.5);
extremoButtonText.x = 1024;
extremoButtonText.y = 1850;
settingsMenuContainer.addChild(extremoButtonText);
extremoButtonBg.interactive = true;
extremoButtonBg.down = function (x, y, obj) {
currentDifficulty = 'extremo';
sushiSpawnRate = 25;
returnToMenu();
};
// Insano button
var insanoButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2100,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(insanoButtonBg);
var insanoButtonText = new Text2('INSANO', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
insanoButtonText.anchor.set(0.5, 0.5);
insanoButtonText.x = 1024;
insanoButtonText.y = 2100;
settingsMenuContainer.addChild(insanoButtonText);
insanoButtonBg.interactive = true;
insanoButtonBg.down = function (x, y, obj) {
currentDifficulty = 'insano';
sushiSpawnRate = 12;
returnToMenu();
};
// Back button
var backButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
}); //{3W_new}
settingsMenuContainer.addChild(backButtonBg);
var backButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
backButtonText.anchor.set(0.5, 0.5);
backButtonText.x = 150;
backButtonText.y = 2582;
settingsMenuContainer.addChild(backButtonText);
backButtonBg.interactive = true;
backButtonBg.down = function (x, y, obj) {
returnToMenu();
};
// In-game menu button
var gameMenuButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1898,
y: 2582
});
game.addChild(gameMenuButtonBg);
gameMenuButtonBg.visible = false;
var gameMenuButtonText = new Text2('≡', {
size: 80,
fill: 0xFFFFFF
});
gameMenuButtonText.anchor.set(0.5, 0.5);
gameMenuButtonText.x = 1898;
gameMenuButtonText.y = 2582;
game.addChild(gameMenuButtonText);
gameMenuButtonText.visible = false;
gameMenuButtonBg.alpha = 0;
gameMenuButtonBg.interactive = true;
gameMenuButtonBg.down = function (x, y, obj) {
if (gameState === 'playing') {
if (gameShopContainer.visible) {
gameShopContainer.visible = false;
} else {
gameShopContainer.visible = true;
}
}
};
// Game back to menu button (bottom-left during gameplay)
var gameBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
});
game.addChild(gameBackButtonBg);
gameBackButtonBg.visible = false;
var gameBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
gameBackButtonText.anchor.set(0.5, 0.5);
gameBackButtonText.x = 150;
gameBackButtonText.y = 2582;
game.addChild(gameBackButtonText);
gameBackButtonText.visible = false;
gameBackButtonBg.interactive = true;
gameBackButtonBg.visible = false;
gameBackButtonBg.down = function (x, y, obj) {
if (gameState === 'playing') {
gameState = 'menu';
menuContainer.visible = true;
gameMenuButtonBg.visible = false;
gameMenuButtonText.visible = false;
gameBackButtonBg.visible = false;
gameBackButtonText.visible = false;
gameShopContainer.visible = false;
sushiArray = [];
}
};
var lastTouchY = 0;
function returnToMenu() {
gameState = 'menu';
gameMode = 'normal';
settingsMenuContainer.visible = false;
shopMenuContainer.visible = false;
modeSelectionContainer.visible = false;
menuContainer.visible = true;
gameMenuButtonBg.visible = false;
gameMenuButtonText.visible = false;
gameBackButtonBg.visible = false;
gameBackButtonText.visible = false;
// Reset anomaly system
if (currentAnomaly !== null) {
currentAnomaly.destroy();
game.removeChild(currentAnomaly);
currentAnomaly = null;
anomalyActive = false;
originalSushiSpeedMultiplier = 1;
dangerLine.y = 2500;
anomalyText.setText('');
isHeartAnomalyActive = false;
if (heartAnomalyFilter !== null && heartAnomalyFilter.parent) {
game.removeChild(heartAnomalyFilter);
heartAnomalyFilter = null;
}
isWandAnomalyActive = false;
}
totalSushiCaught = 0;
}
game.move = function (x, y, obj) {
if (gameState === 'wardrobe' && wardrobeSkinContainer) {
if (lastTouchY !== 0) {
var deltaY = y - lastTouchY;
wardrobeScrollOffset += deltaY * 0.5;
wardrobeScrollOffset = Math.max(-wardrobeMaxScroll, Math.min(0, wardrobeScrollOffset));
displayWardrobeSkins();
}
lastTouchY = y;
}
};
game.down = function (x, y, obj) {
lastTouchY = y;
};
game.up = function (x, y, obj) {
lastTouchY = 0;
}; /****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
// Initialize assets for play button
var Anomaly = Container.expand(function () {
var self = Container.call(this);
// Use a dedicated anomaly asset for visual distinction
var anomalyGraphics = self.attachAsset('anomalyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.2,
scaleY: 1.2
});
// Animate the anomaly asset with a pulsing effect using tween
tween(anomalyGraphics, {
scaleX: 1.4,
scaleY: 1.4
}, {
duration: 600,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(anomalyGraphics, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 600,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Loop the pulse
if (self.parent) {
// Only pulse if still in scene
tween(anomalyGraphics, {
scaleX: 1.4,
scaleY: 1.4
}, {
duration: 600,
easing: tween.easeInOut,
onFinish: arguments.callee
});
}
}
});
}
});
var anomalyType = null;
var anomalyStartTime = LK.ticks;
var anomalyDuration = 1200; // 20 seconds at 60 FPS
self.getAnomalyType = function () {
return anomalyType;
};
self.setAnomalyType = function (type) {
anomalyType = type;
};
self.isExpired = function () {
return LK.ticks - anomalyStartTime >= anomalyDuration;
};
self.getTimeRemaining = function () {
return Math.max(0, anomalyDuration - (LK.ticks - anomalyStartTime));
};
self.setInteractive = function (interactive) {
self.interactive = interactive;
anomalyGraphics.interactive = interactive;
}; //{E_new}
return self;
});
var Sushi = Container.expand(function () {
var self = Container.call(this);
var equippedSkinColor = 0xffa500;
var equippedSkinAssetId = 'sushi';
var equippedSkinId = storage.equippedSkin || 'default';
var isSpecialGoldenSushi = false;
var randomChance = Math.random() < 0.001;
var isEvery100th = totalSushiSpawned > 0 && totalSushiSpawned % 100 === 0;
if (randomChance || isEvery100th) {
isSpecialGoldenSushi = true;
equippedSkinColor = 0xFFD700;
}
for (var skinIdx = 0; skinIdx < availableSkins.length; skinIdx++) {
if (availableSkins[skinIdx].id === equippedSkinId) {
equippedSkinColor = availableSkins[skinIdx].color;
if (availableSkins[skinIdx].assetId) {
equippedSkinAssetId = availableSkins[skinIdx].assetId;
}
break;
}
}
var sushiGraphics = self.attachAsset(equippedSkinAssetId, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2.5,
scaleY: 2.5
});
if (isWandAnomalyActive) {
sushiGraphics.tint = 0x9D4EDD;
} else if (isSpecialGoldenSushi && !equippedSkinAssetId.includes('BattlePass')) {
sushiGraphics.tint = 0xFFD700;
}
self.speed = 5;
self.caught = false;
self.lastY = self.y;
self.interactive = true;
self.buttonMode = true;
self.down = function (x, y, obj) {
if (!self.caught) {
self.caught = true;
totalSushiCaught += 1;
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
var expGain = isWandAnomalyActive ? 30 : isSpecialGoldenSushi ? 75 : 1;
storage.battlePassExp += expGain;
var expNeededForLevel = 200;
var levelUpOccurred = false;
while (storage.battlePassExp >= expNeededForLevel && storage.battlePassLevel < 250) {
storage.battlePassExp -= expNeededForLevel;
storage.battlePassLevel += 1;
levelUpOccurred = true;
var unlockedLevel = storage.battlePassLevel;
if (unlockedLevel === 10 || unlockedLevel === 15 || unlockedLevel === 20 || unlockedLevel === 25 || unlockedLevel === 30) {
var rewardSkinIndex = unlockedLevel / 5 - 1;
var rewardSkins = ['gold', 'purple', 'cyan', 'lime', 'pink'];
if (rewardSkins[rewardSkinIndex]) {
storage.unlockedBattlePassSkins[rewardSkins[rewardSkinIndex]] = true;
storage.sushiSkins[rewardSkins[rewardSkinIndex]] = true;
}
}
}
if (levelUpOccurred && gameState === 'playing') {
refreshWardrobeDisplay();
}
self.destroy();
}
};
self.update = function () {
self.lastY = self.y;
if (self.isSidesMode) {
// Sides mode: move in 8 directions away from center
self.x += self.sidesVelocityX;
self.y += self.sidesVelocityY;
} else {
// Normal mode: move downward
self.y += self.speed;
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Game state - MUST be defined before game.update
// Anomaly visual asset (purple glowing button style)
var gameMode = 'normal'; // 'normal' or 'sides'
var gameState = 'menu'; // 'menu', 'playing', or 'settings'
var currentDifficulty = 'medium'; // 'easy', 'medium', 'hard', or 'extremo'
var sushiSpawnRate = 60; // ticks between spawns
var isMenuMusicPlaying = false;
var isBattleMusicPlaying = false;
// Initialize default equipped skin if not set
if (!storage.equippedSkin) {
storage.equippedSkin = 'default';
}
if (!storage.sushiSkins) {
storage.sushiSkins = {};
}
if (!storage.unlockedBattlePassSkins) {
storage.unlockedBattlePassSkins = {};
}
// Create game background
var gameBackground = LK.getAsset('gameBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366
});
game.addChild(gameBackground);
// Create danger line at bottom
// Initialize assets for play button
var dangerLine = LK.getAsset('dangerLine', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2500
});
game.addChild(dangerLine); //{p_end}
// Score display
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Battle Pass display with button styling
var battlePassButtonBg = LK.getAsset('expButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 230
});
game.addChild(battlePassButtonBg);
var battlePassTxt = new Text2('Lvl ' + storage.battlePassLevel + ' ' + storage.battlePassExp + '/200', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
battlePassTxt.anchor.set(0.5, 0.5);
battlePassTxt.x = 1024;
battlePassTxt.y = 230;
game.addChild(battlePassTxt);
//{w_end}
// Game variables
var sushiArray = [];
var sushiSpawnTimer = null;
var totalSushiSpawned = 0;
var totalSushiCaught = 0;
var currentAnomaly = null;
var anomalySpawnChance = 0.0002; // Very low probability
var anomalyActive = false;
var originalSushiSpeedMultiplier = 1;
var lastSwordAnomalySushiCount = 0;
var anomalyText = new Text2('', {
size: 60,
fill: 0xFF00FF
});
anomalyText.anchor.set(0.5, 0.5);
anomalyText.x = 1850;
anomalyText.y = 150;
game.addChild(anomalyText);
var isHeartAnomalyActive = false;
var heartAnomalyFilter = null;
var isWandAnomalyActive = false;
// In-game shop offers container
var gameShopContainer = new Container();
game.addChild(gameShopContainer);
gameShopContainer.visible = false;
// In-game shop title
var gameShopTitle = new Text2('Shop', {
size: 120,
fill: 0xFF6B6B
});
gameShopTitle.anchor.set(0.5, 0.5);
gameShopTitle.x = 1024;
gameShopTitle.y = 300;
gameShopContainer.addChild(gameShopTitle);
// In-game shop close button
var gameShopCloseButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1898,
y: 2582
});
gameShopContainer.addChild(gameShopCloseButtonBg);
var gameShopCloseButtonText = new Text2('✕', {
size: 80,
fill: 0xFFFFFF
});
gameShopCloseButtonText.anchor.set(0.5, 0.5);
gameShopCloseButtonText.x = 1898;
gameShopCloseButtonText.y = 2582;
gameShopContainer.addChild(gameShopCloseButtonText);
gameShopCloseButtonBg.interactive = true;
gameShopCloseButtonBg.down = function (x, y, obj) {
gameShopContainer.visible = false;
};
// Game update loop
game.update = function () {
// Handle music playback based on game state
if (gameState === 'menu' && !isMenuMusicPlaying) {
LK.playMusic('menuMusic', {
loop: true
});
isMenuMusicPlaying = true;
isBattleMusicPlaying = false;
} else if (gameState === 'playing' && !isBattleMusicPlaying) {
LK.playMusic('battleMusic', {
loop: true
});
isBattleMusicPlaying = true;
isMenuMusicPlaying = false;
} else if (gameState !== 'menu' && gameState !== 'playing' && isMenuMusicPlaying) {
LK.stopMusic();
isMenuMusicPlaying = false;
isBattleMusicPlaying = false;
}
if (gameState === 'playing') {
dangerLine.visible = true;
// Sword anomaly disabled - do not trigger
// if (!anomalyActive && totalSushiSpawned > 0 && totalSushiSpawned >= lastSwordAnomalySushiCount + 150) {
// lastSwordAnomalySushiCount = totalSushiSpawned;
// currentAnomaly = new Anomaly();
// currentAnomaly.x = 1850;
// currentAnomaly.y = 150;
// game.addChild(currentAnomaly);
// anomalyActive = true;
// currentAnomaly.setAnomalyType('sword');
// sushiSpawnRate = Math.floor(sushiSpawnRate / 2);
// anomalyText.setText('⚔️SWORD⚔️');
// }
// Handle anomaly expiration
if (currentAnomaly !== null && currentAnomaly.isExpired()) {
// Restore original game state
if (currentAnomaly.getAnomalyType() === 'speed') {
originalSushiSpeedMultiplier = 1;
} else if (currentAnomaly.getAnomalyType() === 'dangerLine') {
dangerLine.y = 2500;
} else if (currentAnomaly.getAnomalyType() === 'sword') {
var baseSpawnRate = currentDifficulty === 'easy' ? 90 : currentDifficulty === 'medium' ? 60 : currentDifficulty === 'hard' ? 40 : currentDifficulty === 'extremo' ? 25 : 12;
sushiSpawnRate = baseSpawnRate;
} else if (currentAnomaly.getAnomalyType() === 'heart') {
isHeartAnomalyActive = false;
if (heartAnomalyFilter !== null) {
tween(heartAnomalyFilter, {
alpha: 0
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
if (heartAnomalyFilter !== null && heartAnomalyFilter.parent) {
game.removeChild(heartAnomalyFilter);
heartAnomalyFilter = null;
}
}
});
}
} else if (currentAnomaly.getAnomalyType() === 'wand') {
originalSushiSpeedMultiplier = 1;
isWandAnomalyActive = false;
}
currentAnomaly.destroy();
game.removeChild(currentAnomaly);
currentAnomaly = null;
anomalyActive = false;
anomalyText.setText('');
}
// Attempt to spawn anomaly every 200 sushis caught
if (!anomalyActive && totalSushiCaught > 0 && totalSushiCaught % 200 === 0) {
currentAnomaly = new Anomaly();
currentAnomaly.x = 1850;
currentAnomaly.y = 150;
game.addChild(currentAnomaly);
anomalyActive = true;
var anomalyTypeRoll = Math.random();
var selectedAnomalyType = anomalyTypeRoll < 0.25 ? 'speed' : anomalyTypeRoll < 0.50 ? 'bomb' : anomalyTypeRoll < 0.75 ? 'dangerLine' : 'wand';
currentAnomaly.setAnomalyType(selectedAnomalyType);
// Apply anomaly effect
if (selectedAnomalyType === 'speed') {
originalSushiSpeedMultiplier = 3;
anomalyText.setText('⚡SPEED⚡');
} else if (selectedAnomalyType === 'bomb') {
anomalyText.setText('💣BOMB💣');
// Trigger bomb effect on all current sushi
for (var bombIdx = sushiArray.length - 1; bombIdx >= 0; bombIdx--) {
var sushiToBomb = sushiArray[bombIdx];
if (!sushiToBomb.caught) {
LK.effects.flashObject(sushiToBomb, 0xFF6B00, 300);
sushiToBomb.caught = true;
sushiToBomb.destroy();
sushiArray.splice(bombIdx, 1);
}
}
} else if (selectedAnomalyType === 'dangerLine') {
dangerLine.y = 1200;
anomalyText.setText('☠️DANGER☠️');
} else if (selectedAnomalyType === 'wand') {
originalSushiSpeedMultiplier = 0.5;
anomalyText.setText('✨WAND✨');
isWandAnomalyActive = true;
currentAnomaly.setInteractive(false);
}
}
// Calculate difficulty-based speed multiplier for sides mode
var sidesSpeedMultiplier = currentDifficulty === 'easy' ? 0.6 : currentDifficulty === 'medium' ? 1.0 : currentDifficulty === 'hard' ? 1.4 : currentDifficulty === 'extremo' ? 2.0 : 2.8;
// Spawn sushi periodically
if (LK.ticks % sushiSpawnRate === 0) {
totalSushiSpawned += 1;
var newSushi = new Sushi();
if (gameMode === 'sides') {
// Sides mode: spawn from center, move in 8 directions
newSushi.x = 1024;
newSushi.y = 1366;
newSushi.isSidesMode = true;
var directionIndex = Math.floor(Math.random() * 8);
var directions = [{
vx: 0,
vy: -4
},
// North
{
vx: -2.83,
vy: -2.83
},
// Northwest
{
vx: 4,
vy: 0
},
// East
{
vx: 2.83,
vy: -2.83
},
// Northeast
{
vx: -4,
vy: 0
},
// West
{
vx: -2.83,
vy: 2.83
},
// Southwest
{
vx: 0,
vy: 4
},
// South
{
vx: 2.83,
vy: 2.83
} // Southeast
];
var selectedDirection = directions[directionIndex];
newSushi.sidesVelocityX = selectedDirection.vx * sidesSpeedMultiplier;
newSushi.sidesVelocityY = selectedDirection.vy * sidesSpeedMultiplier;
newSushi.sidesDirection = directionIndex;
} else {
// Normal mode: spawn from top
newSushi.x = Math.random() * 1800 + 100;
newSushi.y = -100;
newSushi.isSidesMode = false;
}
newSushi.lastY = newSushi.y;
var baseSpeed = currentDifficulty === 'easy' ? 3 : currentDifficulty === 'medium' ? 5 : currentDifficulty === 'hard' ? 8 : currentDifficulty === 'extremo' ? 12 : 24;
newSushi.speed = baseSpeed * originalSushiSpeedMultiplier;
if (anomalyActive && currentAnomaly && currentAnomaly.getAnomalyType() === 'sword') {
newSushi.scaleX = 1.5;
newSushi.scaleY = 1.5;
}
sushiArray.push(newSushi);
game.addChild(newSushi);
}
// Update and check sushi
for (var i = sushiArray.length - 1; i >= 0; i--) {
var sushi = sushiArray[i];
if (sushi.isSidesMode) {
// Sides mode: check if sushi reaches any edge boundary
if (sushi.x < 50 || sushi.x > 1998 || sushi.y < 50 || sushi.y > 2682) {
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
}
} else {
// Normal mode: check if sushi reaches the bottom danger line
if (sushi.lastY <= 2500 && sushi.y > 2500) {
if (!isHeartAnomalyActive) {
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
}
}
}
}
battlePassTxt.setText('Lvl ' + storage.battlePassLevel + ' ' + storage.battlePassExp + '/200');
battlePassButtonBg.x = battlePassTxt.x;
battlePassButtonBg.y = battlePassTxt.y;
} else {
//{1k_new}
dangerLine.visible = false;
// Reset anomaly when leaving gameplay
if (currentAnomaly !== null) {
currentAnomaly.destroy();
game.removeChild(currentAnomaly);
currentAnomaly = null;
anomalyActive = false;
originalSushiSpeedMultiplier = 1;
dangerLine.y = 2500;
anomalyText.setText('');
}
}
};
// Create main menu UI
var menuContainer = new Container();
game.addChild(menuContainer);
// Menu title
var titleAsset = LK.getAsset('cazaDeSushisTitle', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 700
});
menuContainer.addChild(titleAsset);
// Play button - Start Game
var playButtonBg = LK.getAsset('playButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1800,
scaleX: 5.5,
scaleY: 1.8
});
menuContainer.addChild(playButtonBg);
var playButtonText = new Text2('', {
size: 100,
fill: 0xFFFFFF
});
playButtonText.anchor.set(0.5, 0.5);
playButtonText.x = 1024;
playButtonText.y = 1800;
menuContainer.addChild(playButtonText);
// Create mode selection container
var modeSelectionContainer = new Container();
game.addChild(modeSelectionContainer);
modeSelectionContainer.visible = false;
var modeSelectionTitle = new Text2('Select Mode', {
size: 150,
fill: 0xFFFFFF
});
modeSelectionTitle.anchor.set(0.5, 0.5);
modeSelectionTitle.x = 1024;
modeSelectionTitle.y = 600;
modeSelectionContainer.addChild(modeSelectionTitle);
// Normal mode button
var normalModeButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1200,
scaleX: 2.2,
scaleY: 1.5
});
modeSelectionContainer.addChild(normalModeButtonBg);
var normalModeButtonText = new Text2('NORMAL MODE', {
size: 90,
fill: 0x000000,
fontWeight: 'bold'
});
normalModeButtonText.anchor.set(0.5, 0.5);
normalModeButtonText.x = 1024;
normalModeButtonText.y = 1200;
modeSelectionContainer.addChild(normalModeButtonText);
normalModeButtonBg.interactive = true;
normalModeButtonBg.down = function (x, y, obj) {
gameMode = 'normal';
gameState = 'playing';
modeSelectionContainer.visible = false;
menuContainer.visible = false;
gameMenuButtonBg.visible = true;
gameMenuButtonText.visible = true;
gameBackButtonBg.visible = true;
gameBackButtonText.visible = true;
};
// Sides mode button
var sidesModeButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1550,
scaleX: 2.2,
scaleY: 1.5
});
modeSelectionContainer.addChild(sidesModeButtonBg);
var sidesModeButtonText = new Text2('SIDES MODE', {
size: 90,
fill: 0x000000,
fontWeight: 'bold'
});
sidesModeButtonText.anchor.set(0.5, 0.5);
sidesModeButtonText.x = 1024;
sidesModeButtonText.y = 1550;
modeSelectionContainer.addChild(sidesModeButtonText);
sidesModeButtonBg.interactive = true;
sidesModeButtonBg.down = function (x, y, obj) {
gameMode = 'sides';
gameState = 'playing';
modeSelectionContainer.visible = false;
menuContainer.visible = false;
gameMenuButtonBg.visible = true;
gameMenuButtonText.visible = true;
gameBackButtonBg.visible = true;
gameBackButtonText.visible = true;
};
// Mode selection back button
var modeSelectionBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
});
modeSelectionContainer.addChild(modeSelectionBackButtonBg);
var modeSelectionBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
modeSelectionBackButtonText.anchor.set(0.5, 0.5);
modeSelectionBackButtonText.x = 150;
modeSelectionBackButtonText.y = 2582;
modeSelectionContainer.addChild(modeSelectionBackButtonText);
modeSelectionBackButtonBg.interactive = true;
modeSelectionBackButtonBg.down = function (x, y, obj) {
gameState = 'menu';
modeSelectionContainer.visible = false;
menuContainer.visible = true;
};
// Make play button interactive
playButtonBg.interactive = true;
playButtonBg.down = function (x, y, obj) {
gameState = 'modeSelection';
menuContainer.visible = false;
modeSelectionContainer.visible = true;
};
// Settings button
var settingsButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2150,
scaleX: 1.6,
scaleY: 1.6
});
menuContainer.addChild(settingsButtonBg);
var settingsButtonText = new Text2('⚙️', {
size: 120,
fill: 0xFFFFFF
});
settingsButtonText.anchor.set(0.5, 0.5);
settingsButtonText.x = 1024;
settingsButtonText.y = 2150;
menuContainer.addChild(settingsButtonText);
settingsButtonBg.interactive = true;
settingsButtonBg.down = function (x, y, obj) {
gameState = 'settings';
menuContainer.visible = false;
settingsMenuContainer.visible = true;
};
// Shop button
var shopButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1900
});
menuContainer.addChild(shopButtonBg);
var shopButtonText = new Text2('🛍️', {
size: 80,
fill: 0xFFFFFF
});
shopButtonText.anchor.set(0.5, 0.5);
shopButtonText.x = 1024;
shopButtonText.y = 1900;
menuContainer.addChild(shopButtonText);
shopButtonBg.interactive = false;
shopButtonBg.visible = false;
shopButtonText.visible = false;
// Settings menu container
var settingsMenuContainer = new Container();
game.addChild(settingsMenuContainer);
settingsMenuContainer.visible = false;
// Shop menu container
var shopMenuContainer = new Container();
game.addChild(shopMenuContainer);
shopMenuContainer.visible = false;
var shopTitle = new Text2('Shop', {
size: 180,
fill: 0xFF6B6B
});
shopTitle.anchor.set(0.5, 0.5);
shopTitle.x = 1024;
shopTitle.y = 400;
shopMenuContainer.addChild(shopTitle);
// Shop back button (bottom-left)
var shopBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
});
shopMenuContainer.addChild(shopBackButtonBg);
var shopBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
shopBackButtonText.anchor.set(0.5, 0.5);
shopBackButtonText.x = 150;
shopBackButtonText.y = 2582;
shopMenuContainer.addChild(shopBackButtonText);
shopBackButtonBg.interactive = true;
shopBackButtonBg.down = function (x, y, obj) {
gameState = 'menu';
shopMenuContainer.visible = false;
menuContainer.visible = true;
};
// Wardrobe button
var wardrobeButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2150
});
menuContainer.addChild(wardrobeButtonBg);
var wardrobeButtonText = new Text2('👕', {
size: 80,
fill: 0xFFFFFF
});
wardrobeButtonText.anchor.set(0.5, 0.5);
wardrobeButtonText.x = 150;
wardrobeButtonText.y = 150;
menuContainer.addChild(wardrobeButtonText);
wardrobeButtonBg.interactive = false;
// Wardrobe menu container
var wardrobeMenuContainer = new Container();
game.addChild(wardrobeMenuContainer);
wardrobeMenuContainer.visible = false;
var wardrobeTitle = new Text2('Wardrobe', {
size: 180,
fill: 0xFF6B6B
});
wardrobeTitle.anchor.set(0.5, 0.5);
wardrobeTitle.x = 1024;
wardrobeTitle.y = 300;
wardrobeMenuContainer.addChild(wardrobeTitle);
// Initialize sushi skins in storage if not exists
if (!storage.sushiSkins) {
storage.sushiSkins = {};
}
if (!storage.equippedSkin) {
storage.equippedSkin = 'default';
}
// Available skins with their costs and colors
var availableSkins = [{
id: 'default',
name: 'Default',
color: 0xffa500,
cost: 0,
assetId: 'sushi'
}, {
id: 'gold',
name: 'Gold (BP Lvl 10)',
color: 0xFFD700,
cost: 0,
assetId: 'sushiBattlePass1'
}, {
id: 'purple',
name: 'Purple (BP Lvl 15)',
color: 0x9D4EDD,
cost: 0,
assetId: 'sushiBattlePass2'
}, {
id: 'cyan',
name: 'Cyan (BP Lvl 20)',
color: 0x00F5FF,
cost: 0,
assetId: 'sushiBattlePass3'
}, {
id: 'lime',
name: 'Lime',
color: 0x00FF00,
cost: 750
}, {
id: 'pink',
name: 'Pink',
color: 0xFF1493,
cost: 1000
}, {
id: 'silver',
name: 'Silver',
color: 0xC0C0C0,
cost: 1500
}];
// Wardrobe scroll container for skins grid
var wardrobeSkinContainer = new Container();
wardrobeMenuContainer.addChild(wardrobeSkinContainer);
wardrobeSkinContainer.x = 200;
wardrobeSkinContainer.y = 600;
wardrobeSkinContainer.width = 1648;
wardrobeSkinContainer.height = 1400;
wardrobeSkinContainer.interactive = true;
var wardrobeSkinMask = new Container();
wardrobeSkinMask.x = 200;
wardrobeSkinMask.y = 600;
var maskGraphic = LK.getAsset('playButtonBg', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0,
scaleX: 2.06,
scaleY: 1.75
});
wardrobeSkinMask.addChild(maskGraphic);
game.addChild(wardrobeSkinMask);
wardrobeSkinContainer.mask = maskGraphic;
var wardrobeScrollOffset = 0;
var wardrobeMaxScroll = 0;
function displayWardrobeSkins() {
wardrobeSkinContainer.removeChildren();
var unlockedSkins = [];
for (var u = 0; u < availableSkins.length; u++) {
var checkSkin = availableSkins[u];
if (checkSkin.id === 'default' || storage.sushiSkins[checkSkin.id]) {
unlockedSkins.push(checkSkin);
}
}
var skinsPerRow = 3;
var skinBoxSize = 200;
var skinGap = 100;
var skinX = 0;
var skinY = wardrobeScrollOffset;
for (var s = 0; s < unlockedSkins.length; s++) {
var skin = unlockedSkins[s];
var colIndex = s % skinsPerRow;
var rowIndex = Math.floor(s / skinsPerRow);
skinX = colIndex * (skinBoxSize + skinGap) + 50;
skinY = rowIndex * (skinBoxSize + skinGap) + wardrobeScrollOffset;
var skinBox = LK.getAsset('playButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: skinX,
y: skinY,
scaleX: 1.5,
scaleY: 1.5
});
wardrobeSkinContainer.addChild(skinBox);
var isEquippedSkin = storage.equippedSkin === skin.id;
var isBattlePassReward = skin.id === 'gold' || skin.id === 'purple' || skin.id === 'cyan' || skin.id === 'lime' || skin.id === 'pink';
var requiredBPLevel = skin.id === 'gold' ? 10 : skin.id === 'purple' ? 15 : skin.id === 'cyan' ? 20 : skin.id === 'lime' ? 25 : skin.id === 'pink' ? 30 : 0;
var isUnlocked = skin.id === 'default' || storage.sushiSkins[skin.id];
if (isEquippedSkin) {
skinBox.tint = 0x00FF00;
} else if (isBattlePassReward && !isUnlocked && storage.battlePassLevel < requiredBPLevel) {
skinBox.tint = 0x555555;
} else {
skinBox.tint = 0x333333;
}
var assetIdToUse = skin.assetId || 'sushi';
var sushiAsset = LK.getAsset(assetIdToUse, {
anchorX: 0.5,
anchorY: 0.5,
x: skinX,
y: skinY,
scaleX: 2,
scaleY: 2
});
if (!skin.assetId) {
sushiAsset.tint = skin.color;
}
wardrobeSkinContainer.addChild(sushiAsset);
var isEquipped = storage.equippedSkin === skin.id;
var statusSymbol = isEquipped ? '✓' : '';
var isBattlePassSkin = skin.id === 'gold' || skin.id === 'purple' || skin.id === 'cyan' || skin.id === 'lime' || skin.id === 'pink';
var requiredLevel = skin.id === 'gold' ? 10 : skin.id === 'purple' ? 15 : skin.id === 'cyan' ? 20 : skin.id === 'lime' ? 25 : skin.id === 'pink' ? 30 : 0;
var levelInfo = isBattlePassSkin && requiredLevel > 0 ? ' [Lvl ' + requiredLevel + ']' : '';
var skinLabel = new Text2(skin.name + levelInfo + '\n' + statusSymbol, {
size: 50,
fill: 0xFFFFFF
});
skinLabel.anchor.set(0.5, 0.5);
skinLabel.x = skinX;
skinLabel.y = skinY + 120;
wardrobeSkinContainer.addChild(skinLabel);
skinBox.interactive = true;
skinBox.skinId = skin.id;
sushiAsset.interactive = true;
sushiAsset.skinId = skin.id;
var skinBoxDown = function skinBoxDown(x, y, obj) {
var clickedSkinId = this.skinId;
if (storage.sushiSkins[clickedSkinId] || clickedSkinId === 'default') {
storage.equippedSkin = clickedSkinId;
displayWardrobeSkins();
}
};
skinBox.skinId = skin.id;
skinBox.down = skinBoxDown;
sushiAsset.skinId = skin.id;
sushiAsset.down = skinBoxDown;
}
wardrobeMaxScroll = Math.max(0, Math.ceil(unlockedSkins.length / 3) * 300 - 1400);
}
displayWardrobeSkins();
wardrobeMenuContainer.move = function (x, y, obj) {
var scrollAmount = 100;
};
wardrobeMenuContainer.down = function (x, y, obj) {
wardrobeLastY = y;
};
wardrobeMenuContainer.up = function (x, y, obj) {};
var wardrobeLastY = 0;
function refreshWardrobeDisplay() {
displayWardrobeSkins();
}
// Wardrobe back button
var wardrobeBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
}); //{3b_new}
wardrobeMenuContainer.addChild(wardrobeBackButtonBg);
var wardrobeBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
wardrobeBackButtonText.anchor.set(0.5, 0.5);
wardrobeBackButtonText.x = 150;
wardrobeBackButtonText.y = 2582;
wardrobeMenuContainer.addChild(wardrobeBackButtonText);
wardrobeBackButtonBg.interactive = true;
wardrobeBackButtonBg.down = function (x, y, obj) {
gameState = 'menu';
wardrobeMenuContainer.visible = false;
menuContainer.visible = true;
};
var settingsTitle = new Text2('Difficulty', {
size: 180,
fill: 0x9D4EDD,
fontWeight: 'bold' //{4k_new}
});
settingsTitle.anchor.set(0.5, 0.5);
settingsTitle.x = 1024;
settingsTitle.y = 600;
settingsMenuContainer.addChild(settingsTitle);
// Easy button
var easyButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1100,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(easyButtonBg);
var easyButtonText = new Text2('EASY', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
easyButtonText.anchor.set(0.5, 0.5);
easyButtonText.x = 1024;
easyButtonText.y = 1100;
settingsMenuContainer.addChild(easyButtonText);
easyButtonBg.interactive = true;
easyButtonBg.down = function (x, y, obj) {
currentDifficulty = 'easy';
sushiSpawnRate = 90;
returnToMenu();
};
// Medium button
var mediumButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1350,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(mediumButtonBg);
var mediumButtonText = new Text2('MEDIUM', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
mediumButtonText.anchor.set(0.5, 0.5);
mediumButtonText.x = 1024;
mediumButtonText.y = 1350;
settingsMenuContainer.addChild(mediumButtonText);
mediumButtonBg.interactive = true;
mediumButtonBg.down = function (x, y, obj) {
currentDifficulty = 'medium';
sushiSpawnRate = 60;
returnToMenu();
};
// Hard button
var hardButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1600,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(hardButtonBg);
var hardButtonText = new Text2('HARD', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
hardButtonText.anchor.set(0.5, 0.5);
hardButtonText.x = 1024;
hardButtonText.y = 1600;
settingsMenuContainer.addChild(hardButtonText);
hardButtonBg.interactive = true;
hardButtonBg.down = function (x, y, obj) {
currentDifficulty = 'hard';
sushiSpawnRate = 40;
returnToMenu();
};
// Extremo button
var extremoButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1850,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(extremoButtonBg);
var extremoButtonText = new Text2('EXTREMO', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
extremoButtonText.anchor.set(0.5, 0.5);
extremoButtonText.x = 1024;
extremoButtonText.y = 1850;
settingsMenuContainer.addChild(extremoButtonText);
extremoButtonBg.interactive = true;
extremoButtonBg.down = function (x, y, obj) {
currentDifficulty = 'extremo';
sushiSpawnRate = 25;
returnToMenu();
};
// Insano button
var insanoButtonBg = LK.getAsset('difficultyButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2100,
scaleX: 2.2,
scaleY: 1.5
});
settingsMenuContainer.addChild(insanoButtonBg);
var insanoButtonText = new Text2('INSANO', {
size: 80,
fill: 0x000000,
fontWeight: 'bold'
});
insanoButtonText.anchor.set(0.5, 0.5);
insanoButtonText.x = 1024;
insanoButtonText.y = 2100;
settingsMenuContainer.addChild(insanoButtonText);
insanoButtonBg.interactive = true;
insanoButtonBg.down = function (x, y, obj) {
currentDifficulty = 'insano';
sushiSpawnRate = 12;
returnToMenu();
};
// Back button
var backButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
}); //{3W_new}
settingsMenuContainer.addChild(backButtonBg);
var backButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
backButtonText.anchor.set(0.5, 0.5);
backButtonText.x = 150;
backButtonText.y = 2582;
settingsMenuContainer.addChild(backButtonText);
backButtonBg.interactive = true;
backButtonBg.down = function (x, y, obj) {
returnToMenu();
};
// In-game menu button
var gameMenuButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 1898,
y: 2582
});
game.addChild(gameMenuButtonBg);
gameMenuButtonBg.visible = false;
var gameMenuButtonText = new Text2('≡', {
size: 80,
fill: 0xFFFFFF
});
gameMenuButtonText.anchor.set(0.5, 0.5);
gameMenuButtonText.x = 1898;
gameMenuButtonText.y = 2582;
game.addChild(gameMenuButtonText);
gameMenuButtonText.visible = false;
gameMenuButtonBg.alpha = 0;
gameMenuButtonBg.interactive = true;
gameMenuButtonBg.down = function (x, y, obj) {
if (gameState === 'playing') {
if (gameShopContainer.visible) {
gameShopContainer.visible = false;
} else {
gameShopContainer.visible = true;
}
}
};
// Game back to menu button (bottom-left during gameplay)
var gameBackButtonBg = LK.getAsset('settingsButtonBg', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 2582
});
game.addChild(gameBackButtonBg);
gameBackButtonBg.visible = false;
var gameBackButtonText = new Text2('←', {
size: 80,
fill: 0xFFFFFF
});
gameBackButtonText.anchor.set(0.5, 0.5);
gameBackButtonText.x = 150;
gameBackButtonText.y = 2582;
game.addChild(gameBackButtonText);
gameBackButtonText.visible = false;
gameBackButtonBg.interactive = true;
gameBackButtonBg.visible = false;
gameBackButtonBg.down = function (x, y, obj) {
if (gameState === 'playing') {
gameState = 'menu';
menuContainer.visible = true;
gameMenuButtonBg.visible = false;
gameMenuButtonText.visible = false;
gameBackButtonBg.visible = false;
gameBackButtonText.visible = false;
gameShopContainer.visible = false;
sushiArray = [];
}
};
var lastTouchY = 0;
function returnToMenu() {
gameState = 'menu';
gameMode = 'normal';
settingsMenuContainer.visible = false;
shopMenuContainer.visible = false;
modeSelectionContainer.visible = false;
menuContainer.visible = true;
gameMenuButtonBg.visible = false;
gameMenuButtonText.visible = false;
gameBackButtonBg.visible = false;
gameBackButtonText.visible = false;
// Reset anomaly system
if (currentAnomaly !== null) {
currentAnomaly.destroy();
game.removeChild(currentAnomaly);
currentAnomaly = null;
anomalyActive = false;
originalSushiSpeedMultiplier = 1;
dangerLine.y = 2500;
anomalyText.setText('');
isHeartAnomalyActive = false;
if (heartAnomalyFilter !== null && heartAnomalyFilter.parent) {
game.removeChild(heartAnomalyFilter);
heartAnomalyFilter = null;
}
isWandAnomalyActive = false;
}
totalSushiCaught = 0;
}
game.move = function (x, y, obj) {
if (gameState === 'wardrobe' && wardrobeSkinContainer) {
if (lastTouchY !== 0) {
var deltaY = y - lastTouchY;
wardrobeScrollOffset += deltaY * 0.5;
wardrobeScrollOffset = Math.max(-wardrobeMaxScroll, Math.min(0, wardrobeScrollOffset));
displayWardrobeSkins();
}
lastTouchY = y;
}
};
game.down = function (x, y, obj) {
lastTouchY = y;
};
game.up = function (x, y, obj) {
lastTouchY = 0;
};
Un sushi con cara traviesa. In-Game asset. 2d. High contrast. No shadows
Un botón de jugar de color naranja sushi. In-Game asset. 2d. High contrast. No shadows
Un engranaje de ajustes naranja muy cute. In-Game asset. 2d. High contrast. No shadows
Sushi congelado con cara cute. In-Game asset. 2d. High contrast. No shadows
Sushi con apariencia de santa Claus/papa noel. In-Game asset. 2d. High contrast. No shadows
Un sushi con cara traviesa y con aspecto de elfo navideño. In-Game asset. 2d. High contrast. No shadows
Letrero rectangular pequeño que diga "caza de sushis". In-Game asset. 2d. High contrast. No shadows
Botón rectangular naranja color sushi. In-Game asset. 2d. High contrast. No shadows
Genera una línea horizontal de fuego con detalles ígneos!. In-Game asset. 2d. High contrast. No shadows
Genera una imagen de un sushi con cara de calavera, que sea un botón circular y que se vea muy epico. In-Game asset. 2d. High contrast. No shadows
Un botón rectangular azul. In-Game asset. 2d. High contrast. No shadows