User prompt
я хочу, что-бы враждебные динозавры шли в напровление к игроку
User prompt
сделай так, что-бы музыка играла
User prompt
сделай крестик побольше
User prompt
кнопка "начать игру не работает"
User prompt
добавь меню в игру
User prompt
теперь крестик не работает
User prompt
нужно, что-бы закрывалось, когда нажимал именно на крестик
User prompt
добавь крестик в меню эволюции, на который нужно нажать, когда закрываешь
User prompt
добавь иконки динозавров рядом с ними, что-бы на них надо нажимать, и если динозавр разблокирован, то тогда нужно кликнуть на иконку, и ты станешь другим динозавром ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
удали эту функцию и верни как было
User prompt
когда мы кликнем на надпись динозавра, мы не выйдем, а купим динозавра и будем играть за него ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
управление на wasd/стрелки
User prompt
Добавь деревья на фон
User prompt
Please fix the bug: 'Uncaught TypeError: setTimeout is not a function' in or related to this line: 'setTimeout(function () {' Line Number: 449
User prompt
change the dinosaur selection menu. (Make the text bigger and the selection square longer)
User prompt
добавь меню, где отображаются монеты
User prompt
преврати квадраты в нормальных динозавров
Code edit (1 edits merged)
Please save this source code
User prompt
Dino Evolution Survivor
Initial prompt
Start as a tiny Microceratus and survive in a dangerous world full of predators. Earn coins every 5 seconds to unlock 20 dinosaurs — 8 carnivores, 8 herbivores, and 4 omnivores. Grow stronger, evolve, and become the ultimate prehistoric survivor!
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Hazard = Container.expand(function () { var self = Container.call(this); var graphics = self.attachAsset('hazard', { anchorX: 0.5, anchorY: 0.5 }); self.pulseTimer = 0; self.update = function () { self.pulseTimer += 0.1; graphics.scaleX = 1 + Math.sin(self.pulseTimer) * 0.2; graphics.scaleY = 1 + Math.sin(self.pulseTimer) * 0.2; }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var graphics = self.attachAsset('microceratus', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 3; self.size = 1; self.species = 'microceratus'; self.dragActive = false; self.evolve = function (newSpecies, newSize, newSpeed) { // Remove old graphics self.removeChild(graphics); // Create new graphics based on species var assetId = self.getAssetIdForSpecies(newSpecies); graphics = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5 }); self.species = newSpecies; self.size = newSize; self.speed = newSpeed; graphics.scaleX = newSize; graphics.scaleY = newSize; }; self.getAssetIdForSpecies = function (speciesName) { var speciesMap = { 'T-Rex': 'trex', 'Velociraptor': 'velociraptor', 'Allosaurus': 'allosaurus', 'Spinosaurus': 'spinosaurus', 'Carnotaurus': 'carnotaurus', 'Dilophosaurus': 'dilophosaurus', 'Giganotosaurus': 'giganotosaurus', 'Utahraptor': 'utahraptor', 'Triceratops': 'triceratops', 'Brachiosaurus': 'brachiosaurus', 'Stegosaurus': 'stegosaurus', 'Ankylosaurus': 'ankylosaurus', 'Parasaurolophus': 'parasaurolophus', 'Diplodocus': 'diplodocus', 'Iguanodon': 'iguanodon', 'Apatosaurus': 'apatosaurus', 'Oviraptor': 'oviraptor', 'Ornithomimus': 'ornithomimus', 'Therizinosaurus': 'therizinosaurus', 'Deinonychus': 'deinonychus' }; return speciesMap[speciesName] || 'microceratus'; }; return self; }); var Predator = Container.expand(function (type) { var self = Container.call(this); var assetName = 'predator' + (type || 1); var graphics = self.attachAsset(assetName, { anchorX: 0.5, anchorY: 0.5 }); // Add subtle animation to make predators more lifelike graphics.baseScaleX = graphics.scaleX; graphics.baseScaleY = graphics.scaleY; self.animationTimer = Math.random() * 100; self.speed = Math.random() * 2 + 1; self.direction = Math.random() * Math.PI * 2; self.changeDirectionTimer = 0; self.update = function () { // Add breathing animation self.animationTimer += 0.05; graphics.scaleX = graphics.baseScaleX + Math.sin(self.animationTimer) * 0.05; graphics.scaleY = graphics.baseScaleY + Math.cos(self.animationTimer * 0.8) * 0.03; self.changeDirectionTimer--; if (self.changeDirectionTimer <= 0) { self.direction = Math.random() * Math.PI * 2; self.changeDirectionTimer = 60 + Math.random() * 120; } self.x += Math.cos(self.direction) * self.speed; self.y += Math.sin(self.direction) * self.speed; // Bounce off edges if (self.x < 100 || self.x > 1948) { self.direction = Math.PI - self.direction; } if (self.y < 100 || self.y > 2632) { self.direction = -self.direction; } // Keep in bounds self.x = Math.max(100, Math.min(1948, self.x)); self.y = Math.max(100, Math.min(2632, self.y)); }; return self; }); var Tree = Container.expand(function (treeType) { var self = Container.call(this); var treeAsset = 'tree' + (treeType || 1); var graphics = self.attachAsset(treeAsset, { anchorX: 0.5, anchorY: 1.0 }); // Random scale variation var scale = 0.8 + Math.random() * 0.4; graphics.scaleX = scale; graphics.scaleY = scale; // Subtle swaying animation self.swayTimer = Math.random() * 100; self.swaySpeed = 0.02 + Math.random() * 0.01; self.swayAmount = 0.02 + Math.random() * 0.02; self.update = function () { self.swayTimer += self.swaySpeed; graphics.rotation = Math.sin(self.swayTimer) * self.swayAmount; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x228B22 }); /**** * Game Code ****/ // Game variables var player; var predators = []; var hazards = []; var trees = []; var coins = storage.coins || 0; var survivalTime = 0; var lastCoinTime = 0; var gameRunning = false; var menuOpen = false; var mainMenuOpen = true; // Dinosaur data var dinosaurData = { carnivores: [{ name: 'T-Rex', cost: 100, size: 2.5, speed: 4 }, { name: 'Velociraptor', cost: 50, size: 1.3, speed: 6 }, { name: 'Allosaurus', cost: 80, size: 2.2, speed: 3.5 }, { name: 'Spinosaurus', cost: 120, size: 2.8, speed: 3 }, { name: 'Carnotaurus', cost: 70, size: 2.0, speed: 5 }, { name: 'Dilophosaurus', cost: 40, size: 1.5, speed: 4.5 }, { name: 'Giganotosaurus', cost: 150, size: 3.0, speed: 2.5 }, { name: 'Utahraptor', cost: 60, size: 1.8, speed: 5.5 }], herbivores: [{ name: 'Triceratops', cost: 30, size: 1.8, speed: 2.5 }, { name: 'Brachiosaurus', cost: 90, size: 3.5, speed: 1.5 }, { name: 'Stegosaurus', cost: 45, size: 2.0, speed: 2 }, { name: 'Ankylosaurus', cost: 55, size: 1.7, speed: 1.8 }, { name: 'Parasaurolophus', cost: 35, size: 1.6, speed: 3.5 }, { name: 'Diplodocus', cost: 75, size: 3.0, speed: 2 }, { name: 'Iguanodon', cost: 40, size: 1.9, speed: 3 }, { name: 'Apatosaurus', cost: 85, size: 3.2, speed: 1.8 }], omnivores: [{ name: 'Oviraptor', cost: 25, size: 1.2, speed: 4 }, { name: 'Ornithomimus', cost: 35, size: 1.4, speed: 5 }, { name: 'Therizinosaurus', cost: 65, size: 2.3, speed: 2.8 }, { name: 'Deinonychus', cost: 45, size: 1.6, speed: 4.8 }] }; var unlockedDinosaurs = storage.unlockedDinosaurs || ['microceratus']; // UI Elements var coinsText = new Text2('Coins: 0', { size: 50, fill: '#FFD700' }); coinsText.anchor.set(1, 0); LK.gui.topRight.addChild(coinsText); var timeText = new Text2('Time: 0s', { size: 40, fill: '#FFFFFF' }); timeText.anchor.set(0.5, 0); LK.gui.top.addChild(timeText); var menuButton = LK.getAsset('menuButton', { anchorX: 0.5, anchorY: 0.5, x: 1900, y: 150 }); game.addChild(menuButton); var menuButtonText = new Text2('MENU', { size: 30, fill: '#FFFFFF' }); menuButtonText.anchor.set(0.5, 0.5); menuButtonText.x = 1900; menuButtonText.y = 150; game.addChild(menuButtonText); // Menu system var menuContainer; var menuBackground; function createEvolutionMenu() { menuContainer = new Container(); menuBackground = LK.getAsset('menuButton', { anchorX: 0.5, anchorY: 0.5, scaleX: 8, scaleY: 12, x: 1024, y: 1366 }); menuContainer.addChild(menuBackground); var titleText = new Text2('EVOLUTION MENU', { size: 50, fill: '#FFFFFF' }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 800; menuContainer.addChild(titleText); var menuCoinsText = new Text2('Coins: ' + coins, { size: 45, fill: '#FFD700' }); menuCoinsText.anchor.set(0.5, 0.5); menuCoinsText.x = 1024; menuCoinsText.y = 860; menuContainer.addChild(menuCoinsText); // Create close button (X) var closeButton = new Text2('✕', { size: 60, fill: '#FF6666' }); closeButton.anchor.set(0.5, 0.5); closeButton.x = 1400; closeButton.y = 800; closeButton.isCloseButton = true; menuContainer.addChild(closeButton); var closeText = new Text2('TAP ANYWHERE TO CLOSE', { size: 30, fill: '#CCCCCC' }); closeText.anchor.set(0.5, 0.5); closeText.x = 1024; closeText.y = 1900; menuContainer.addChild(closeText); var yPos = 950; var categories = ['herbivores', 'carnivores', 'omnivores']; categories.forEach(function (category) { var categoryText = new Text2(category.toUpperCase(), { size: 35, fill: '#90EE90' }); categoryText.anchor.set(0.5, 0.5); categoryText.x = 1024; categoryText.y = yPos; menuContainer.addChild(categoryText); yPos += 60; dinosaurData[category].forEach(function (dino, index) { // Create dinosaur icon var dinoIcon = LK.getAsset(player.getAssetIdForSpecies(dino.name), { anchorX: 0.5, anchorY: 0.5, scaleX: 0.8, scaleY: 0.8, x: 924, y: yPos }); dinoIcon.dinoData = dino; dinoIcon.category = category; menuContainer.addChild(dinoIcon); if (unlockedDinosaurs.indexOf(dino.name) !== -1) { var dinoText = new Text2(dino.name + ' (OWNED)', { size: 35, fill: '#00FF00' }); // Make icon fully opaque for owned dinosaurs dinoIcon.alpha = 1.0; } else if (coins >= dino.cost) { var dinoText = new Text2(dino.name + ' - ' + dino.cost + ' coins', { size: 35, fill: '#FFFFFF' }); // Make icon slightly transparent for affordable dinosaurs dinoIcon.alpha = 0.7; } else { var dinoText = new Text2(dino.name + ' - ' + dino.cost + ' coins (LOCKED)', { size: 35, fill: '#888888' }); // Make icon very transparent for locked dinosaurs dinoIcon.alpha = 0.3; } dinoText.anchor.set(0.5, 0.5); dinoText.x = 1124; dinoText.y = yPos; dinoText.dinoData = dino; dinoText.category = category; menuContainer.addChild(dinoText); yPos += 50; }); yPos += 40; }); game.addChild(menuContainer); } function closeEvolutionMenu() { if (menuContainer) { game.removeChild(menuContainer); menuContainer = null; } menuOpen = false; gameRunning = true; } var mainMenuContainer; function createMainMenu() { mainMenuContainer = new Container(); var menuBg = LK.getAsset('mainMenuBg', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366 }); mainMenuContainer.addChild(menuBg); var titleText = new Text2('DINOSAUR SURVIVAL', { size: 80, fill: '#FFFFFF' }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 1000; mainMenuContainer.addChild(titleText); var startButton = LK.getAsset('mainMenuButton', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1250 }); startButton.isStartButton = true; mainMenuContainer.addChild(startButton); var startButtonText = new Text2('START GAME', { size: 50, fill: '#FFFFFF' }); startButtonText.anchor.set(0.5, 0.5); startButtonText.x = 1024; startButtonText.y = 1250; startButtonText.isStartButton = true; mainMenuContainer.addChild(startButtonText); var evolutionButton = LK.getAsset('mainMenuButton', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1380 }); evolutionButton.isEvolutionButton = true; mainMenuContainer.addChild(evolutionButton); var evolutionButtonText = new Text2('EVOLUTION', { size: 50, fill: '#FFFFFF' }); evolutionButtonText.anchor.set(0.5, 0.5); evolutionButtonText.x = 1024; evolutionButtonText.y = 1380; evolutionButtonText.isEvolutionButton = true; mainMenuContainer.addChild(evolutionButtonText); var coinsDisplay = new Text2('Coins: ' + coins, { size: 45, fill: '#FFD700' }); coinsDisplay.anchor.set(0.5, 0.5); coinsDisplay.x = 1024; coinsDisplay.y = 1500; mainMenuContainer.addChild(coinsDisplay); game.addChild(mainMenuContainer); } function closeMainMenu() { if (mainMenuContainer) { game.removeChild(mainMenuContainer); mainMenuContainer = null; } mainMenuOpen = false; gameRunning = true; } function showMainMenu() { gameRunning = false; menuOpen = false; mainMenuOpen = true; closeEvolutionMenu(); createMainMenu(); } // Initialize player player = new Player(); player.x = 1024; player.y = 1366; game.addChild(player); // Create main menu at game start createMainMenu(); // Spawn predators for (var i = 0; i < 4; i++) { var predator = new Predator(Math.floor(Math.random() * 3) + 1); predator.x = Math.random() * 1848 + 100; predator.y = Math.random() * 2532 + 100; predators.push(predator); game.addChild(predator); } // Spawn hazards for (var i = 0; i < 6; i++) { var hazard = new Hazard(); hazard.x = Math.random() * 1848 + 100; hazard.y = Math.random() * 2532 + 100; hazards.push(hazard); game.addChild(hazard); } // Spawn background trees for (var i = 0; i < 15; i++) { var tree = new Tree(Math.floor(Math.random() * 3) + 1); tree.x = Math.random() * 1900 + 74; tree.y = Math.random() * 2500 + 232; trees.push(tree); game.addChild(tree); // Send trees to back so they appear behind other objects game.setChildIndex(tree, 0); } function updateCoinsDisplay() { coinsText.setText('Coins: ' + coins); } function updateTimeDisplay() { var seconds = Math.floor(survivalTime / 60); timeText.setText('Time: ' + seconds + 's'); } updateCoinsDisplay(); // Touch handling for dragging var isDragging = false; game.down = function (x, y, obj) { if (mainMenuOpen) { // Check main menu interactions var localPos = mainMenuContainer.toLocal({ x: x, y: y }); // Check for start button click for (var i = mainMenuContainer.children.length - 1; i >= 0; i--) { var child = mainMenuContainer.children[i]; if (child.isStartButton) { if (localPos.x >= child.x - 200 && localPos.x <= child.x + 200 && localPos.y >= child.y - 40 && localPos.y <= child.y + 40) { closeMainMenu(); return; } } if (child.isEvolutionButton) { if (localPos.x >= child.x - 200 && localPos.x <= child.x + 200 && localPos.y >= child.y - 40 && localPos.y <= child.y + 40) { mainMenuOpen = false; menuOpen = true; game.removeChild(mainMenuContainer); mainMenuContainer = null; createEvolutionMenu(); return; } } } return; } if (menuOpen) { // Check if clicking on a dinosaur in menu var localPos = menuContainer.toLocal({ x: x, y: y }); var clickedChild = null; var isCloseButtonClick = false; // First check for close button click for (var i = menuContainer.children.length - 1; i >= 0; i--) { var child = menuContainer.children[i]; if (child.isCloseButton) { // Check for close button click (hit area around X button) if (localPos.x >= child.x - 30 && localPos.x <= child.x + 30 && localPos.y >= child.y - 30 && localPos.y <= child.y + 30) { isCloseButtonClick = true; break; } } } // If close button was clicked, close menu and return if (isCloseButtonClick) { closeEvolutionMenu(); showMainMenu(); return; } // Then check for dinosaur clicks for (var i = menuContainer.children.length - 1; i >= 0; i--) { var child = menuContainer.children[i]; if (child.dinoData) { // Check for icon clicks (smaller hit area around icon) if (localPos.x > child.x - 60 && localPos.x < child.x + 60 && localPos.y > child.y - 40 && localPos.y < child.y + 40) { clickedChild = child; break; } // Check for text clicks (wider hit area for text) if (localPos.x > child.x - 400 && localPos.x < child.x + 400 && localPos.y > child.y - 30 && localPos.y < child.y + 30) { clickedChild = child; break; } } } if (clickedChild && clickedChild.dinoData) { var dino = clickedChild.dinoData; // If dinosaur is already owned, just transform into it if (unlockedDinosaurs.indexOf(dino.name) !== -1) { player.evolve(dino.name, dino.size, dino.speed); LK.getSound('collect').play(); closeEvolutionMenu(); } else if (coins >= dino.cost) { // Purchase the dinosaur if not owned and can afford it coins -= dino.cost; unlockedDinosaurs.push(dino.name); storage.coins = coins; storage.unlockedDinosaurs = unlockedDinosaurs; // Transform into the newly purchased dinosaur player.evolve(dino.name, dino.size, dino.speed); updateCoinsDisplay(); LK.getSound('collect').play(); closeEvolutionMenu(); } return; } // If clicked somewhere else in menu but not on close button or dinosaur, do nothing return; } // Check menu button var buttonBounds = { left: menuButton.x - 100, right: menuButton.x + 100, top: menuButton.y - 30, bottom: menuButton.y + 30 }; if (x >= buttonBounds.left && x <= buttonBounds.right && y >= buttonBounds.top && y <= buttonBounds.bottom) { showMainMenu(); return; } isDragging = true; player.dragActive = true; }; game.move = function (x, y, obj) { if (isDragging && !menuOpen && player.dragActive) { player.x = Math.max(50, Math.min(1998, x)); player.y = Math.max(50, Math.min(2682, y)); } }; game.up = function (x, y, obj) { isDragging = false; player.dragActive = false; }; game.update = function () { if (!gameRunning || mainMenuOpen) return; survivalTime++; updateTimeDisplay(); // Coin generation every 5 seconds if (survivalTime - lastCoinTime >= 300) { // 60 FPS * 5 seconds coins += Math.floor(player.size); lastCoinTime = survivalTime; storage.coins = coins; updateCoinsDisplay(); LK.getSound('collect').play(); } // Check collisions with predators for (var i = 0; i < predators.length; i++) { var predator = predators[i]; if (player.intersects(predator)) { if (player.size < 2.0) { // Small dinosaurs die to predators LK.effects.flashScreen(0xFF0000, 1000); LK.getSound('danger').play(); LK.showGameOver(); return; } } } // Check collisions with hazards for (var i = 0; i < hazards.length; i++) { var hazard = hazards[i]; if (player.intersects(hazard)) { LK.effects.flashScreen(0xFF0000, 500); LK.getSound('danger').play(); LK.showGameOver(); return; } } // Check win condition (all dinosaurs unlocked) var totalDinosaurs = dinosaurData.carnivores.length + dinosaurData.herbivores.length + dinosaurData.omnivores.length + 1; if (unlockedDinosaurs.length >= totalDinosaurs) { LK.showYouWin(); return; } };
===================================================================
--- original.js
+++ change.js
@@ -151,10 +151,11 @@
var trees = [];
var coins = storage.coins || 0;
var survivalTime = 0;
var lastCoinTime = 0;
-var gameRunning = true;
+var gameRunning = false;
var menuOpen = false;
+var mainMenuOpen = true;
// Dinosaur data
var dinosaurData = {
carnivores: [{
name: 'T-Rex',
@@ -280,9 +281,9 @@
x: 1900,
y: 150
});
game.addChild(menuButton);
-var menuButtonText = new Text2('EVOLVE', {
+var menuButtonText = new Text2('MENU', {
size: 30,
fill: '#FFFFFF'
});
menuButtonText.anchor.set(0.5, 0.5);
@@ -403,13 +404,92 @@
}
menuOpen = false;
gameRunning = true;
}
+var mainMenuContainer;
+function createMainMenu() {
+ mainMenuContainer = new Container();
+ var menuBg = LK.getAsset('mainMenuBg', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1366
+ });
+ mainMenuContainer.addChild(menuBg);
+ var titleText = new Text2('DINOSAUR SURVIVAL', {
+ size: 80,
+ fill: '#FFFFFF'
+ });
+ titleText.anchor.set(0.5, 0.5);
+ titleText.x = 1024;
+ titleText.y = 1000;
+ mainMenuContainer.addChild(titleText);
+ var startButton = LK.getAsset('mainMenuButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1250
+ });
+ startButton.isStartButton = true;
+ mainMenuContainer.addChild(startButton);
+ var startButtonText = new Text2('START GAME', {
+ size: 50,
+ fill: '#FFFFFF'
+ });
+ startButtonText.anchor.set(0.5, 0.5);
+ startButtonText.x = 1024;
+ startButtonText.y = 1250;
+ startButtonText.isStartButton = true;
+ mainMenuContainer.addChild(startButtonText);
+ var evolutionButton = LK.getAsset('mainMenuButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1380
+ });
+ evolutionButton.isEvolutionButton = true;
+ mainMenuContainer.addChild(evolutionButton);
+ var evolutionButtonText = new Text2('EVOLUTION', {
+ size: 50,
+ fill: '#FFFFFF'
+ });
+ evolutionButtonText.anchor.set(0.5, 0.5);
+ evolutionButtonText.x = 1024;
+ evolutionButtonText.y = 1380;
+ evolutionButtonText.isEvolutionButton = true;
+ mainMenuContainer.addChild(evolutionButtonText);
+ var coinsDisplay = new Text2('Coins: ' + coins, {
+ size: 45,
+ fill: '#FFD700'
+ });
+ coinsDisplay.anchor.set(0.5, 0.5);
+ coinsDisplay.x = 1024;
+ coinsDisplay.y = 1500;
+ mainMenuContainer.addChild(coinsDisplay);
+ game.addChild(mainMenuContainer);
+}
+function closeMainMenu() {
+ if (mainMenuContainer) {
+ game.removeChild(mainMenuContainer);
+ mainMenuContainer = null;
+ }
+ mainMenuOpen = false;
+ gameRunning = true;
+}
+function showMainMenu() {
+ gameRunning = false;
+ menuOpen = false;
+ mainMenuOpen = true;
+ closeEvolutionMenu();
+ createMainMenu();
+}
// Initialize player
player = new Player();
player.x = 1024;
player.y = 1366;
game.addChild(player);
+// Create main menu at game start
+createMainMenu();
// Spawn predators
for (var i = 0; i < 4; i++) {
var predator = new Predator(Math.floor(Math.random() * 3) + 1);
predator.x = Math.random() * 1848 + 100;
@@ -445,8 +525,36 @@
updateCoinsDisplay();
// Touch handling for dragging
var isDragging = false;
game.down = function (x, y, obj) {
+ if (mainMenuOpen) {
+ // Check main menu interactions
+ var localPos = mainMenuContainer.toLocal({
+ x: x,
+ y: y
+ });
+ // Check for start button click
+ for (var i = mainMenuContainer.children.length - 1; i >= 0; i--) {
+ var child = mainMenuContainer.children[i];
+ if (child.isStartButton) {
+ if (localPos.x >= child.x - 200 && localPos.x <= child.x + 200 && localPos.y >= child.y - 40 && localPos.y <= child.y + 40) {
+ closeMainMenu();
+ return;
+ }
+ }
+ if (child.isEvolutionButton) {
+ if (localPos.x >= child.x - 200 && localPos.x <= child.x + 200 && localPos.y >= child.y - 40 && localPos.y <= child.y + 40) {
+ mainMenuOpen = false;
+ menuOpen = true;
+ game.removeChild(mainMenuContainer);
+ mainMenuContainer = null;
+ createEvolutionMenu();
+ return;
+ }
+ }
+ }
+ return;
+ }
if (menuOpen) {
// Check if clicking on a dinosaur in menu
var localPos = menuContainer.toLocal({
x: x,
@@ -467,8 +575,9 @@
}
// If close button was clicked, close menu and return
if (isCloseButtonClick) {
closeEvolutionMenu();
+ showMainMenu();
return;
}
// Then check for dinosaur clicks
for (var i = menuContainer.children.length - 1; i >= 0; i--) {
@@ -517,11 +626,9 @@
top: menuButton.y - 30,
bottom: menuButton.y + 30
};
if (x >= buttonBounds.left && x <= buttonBounds.right && y >= buttonBounds.top && y <= buttonBounds.bottom) {
- menuOpen = true;
- gameRunning = false;
- createEvolutionMenu();
+ showMainMenu();
return;
}
isDragging = true;
player.dragActive = true;
@@ -536,9 +643,9 @@
isDragging = false;
player.dragActive = false;
};
game.update = function () {
- if (!gameRunning) return;
+ if (!gameRunning || mainMenuOpen) return;
survivalTime++;
updateTimeDisplay();
// Coin generation every 5 seconds
if (survivalTime - lastCoinTime >= 300) {
A large, heavily armored Ankylosaurus dinosaur standing in a prehistoric forest. Its body is covered with thick, bumpy, dark brown and olive-green armored plates and sharp spikes along its sides and back. The dinosaur has a broad, low head with small eyes and a short snout. Its massive tail ends with a large, club-like bony knob, ready to swing. The scene is lit by soft sunlight filtering through dense ancient conifers, with ferns and cycads on the ground. The texture of the skin is rough and scaly, showing detailed scales and scars from past battles. The overall style is realistic with natural colors and detailed textures, emphasizing the dinosaur’s power and defense.. In-Game asset. 2d. High contrast. No shadows
A large, realistic Apatosaurus dinosaur depicted in a neutral standing pose on a transparent background. It has a long, thick neck and a massive, sturdy body covered in textured grayish-green scales. The dinosaur’s skin shows wrinkles and subtle roughness, with detailed muscle structure beneath. Its long tail extends straight behind, balancing the heavy body. The head is small compared to its body, with gentle eyes and a blunt snout. The overall look is calm but powerful, emphasizing the enormous size and strength of this giant herbivore.. In-Game asset. 2d. High contrast. No shadows
A realistic Brachiosaurus dinosaur standing tall on a transparent background. It has a long neck raised high, with a relatively small head featuring gentle eyes and a rounded snout. The body is massive and bulky, covered with textured grayish-brown scales showing subtle wrinkles and muscle definition. Its front legs are noticeably longer than the hind legs, giving it a distinctive sloping back. The tail is thick and extends straight behind. The skin texture is rough with detailed scales, emphasizing the dinosaur’s grandeur and calm nature.. In-Game asset. 2d. High contrast. No shadows
A fierce Carnotaurus dinosaur depicted in a dynamic neutral pose on a transparent background. It has a slender but muscular body covered with rough, textured reddish-brown and dark gray scales. The head is distinctive with two prominent horns above its eyes and a wide mouth showing sharp teeth. Its arms are tiny and tucked close to the body, while powerful legs end in sharp claws. The skin shows bumps and small scars, emphasizing its predatory nature and agility.. In-Game asset. 2d. High contrast. No shadows
A sleek and agile Deinonychus dinosaur in a neutral pose on a transparent background. It has a slender body covered with dark green and brown textured scales, accented with lighter stripes along its sides. The head is narrow with sharp teeth visible, and bright, alert eyes. Its arms are relatively long with sharp claws, and its legs show the famous sickle-shaped claws on the second toes. The tail is long and flexible for balance. The skin texture is detailed, showing small scales and subtle muscle definition.. In-Game asset. 2d. High contrast. No shadows
A sleek Deinonychus dinosaur covered with dark green and brown feathers, showing a mix of short downy feathers on the body and longer, quill-like feathers on the arms and tail. It has bright, alert eyes and a narrow head with sharp teeth visible. The legs are muscular with the signature sickle-shaped claws. Feathers have a glossy texture, giving the dinosaur a dynamic, bird-like appearance.. In-Game asset. 2d. High contrast. No shadows
A medium-sized Dilophosaurus dinosaur in a standing pose on a transparent background. It has a slender body with light brown and tan scales, featuring distinctive paired crests on top of its head colored in reddish hues. The head is elongated with sharp teeth visible in a slightly open mouth. Its limbs are muscular with sharp claws, and the tail is long and straight. The skin texture shows a mix of small scales and patches of rougher skin, giving a realistic predatory look.. In-Game asset. 2d. High contrast. No shadows
A massive Diplodocus dinosaur shown in a calm standing pose on a transparent background. It has an extremely long neck and tail, with a large bulky body covered in grayish-brown textured scales. The head is small with gentle eyes and a narrow snout. The skin shows wrinkles and rough textures, emphasizing the dinosaur’s massive size and ancient nature. The legs are thick and sturdy, supporting its heavy frame.. In-Game asset. 2d. High contrast. No shadows
A massive Giganotosaurus dinosaur with rough, dark brown and gray scaly skin. It has a large, powerful head with sharp teeth visible in a slightly open mouth. The muscular body shows visible muscle definition and thick, tough skin. The claws are sharp, and the stance is aggressive and dominant.. In-Game asset. 2d. High contrast. No shadows
poisonous plants that look like Vinera muscaria. In-Game asset. 2d. High contrast. No shadows
A medium-sized Iguanodon dinosaur with smooth greenish-gray scales covering its bulky body. It has a distinctive thumb spike on its front limbs. The head is elongated with gentle eyes and a blunt snout. The skin texture is rough with visible scales and wrinkles.. In-Game asset. 2d. High contrast. No shadows
A small Microceratus dinosaur with smooth blue-gray scaly skin. It has a compact body, delicate limbs, and a short tail. The head has a small frill and bright curious eyes. The skin texture is detailed with fine scales, emphasizing its agility and small size.. In-Game asset. 2d. High contrast. No shadows
A slender Ornithomimus dinosaur covered with fine, light gray and brown feathers. It has longer, quill-like feathers on its arms and tail, and softer downy feathers on its body. The head is small and narrow with large, bright eyes and a beak-like mouth. Its long legs are built for speed, ending in sharp claws. The feathers have a natural texture, giving the dinosaur a bird-like, agile appearance.. In-Game asset. 2d. High contrast. No shadows
A realistic Oviraptor dinosaur depicted in a neutral pose on a transparent background. It has smooth, mottled gray and brown scaly skin with visible wrinkles and texture. The head is short and rounded with a prominent crest above its eyes and a strong, curved beak. Its limbs are muscular with sharp claws. The tail is medium length and slightly curved. The skin texture shows detailed scales and natural imperfections, emphasizing a lifelike, agile predator.. In-Game asset. 2d. High contrast. No shadows
A large Parasaurolophus dinosaur with smooth, greenish-brown scaly skin. It has a long, curved cranial crest extending from the back of its head. The body is bulky with thick legs and a long tail. The skin shows detailed scales with subtle shading and wrinkles. The head has gentle eyes and a broad snout.. In-Game asset. 2d. High contrast. No shadows
A realistic dinosaur dinosaur depicted in a neutral standing pose on a transparent background. It has a slender, agile body covered with textured brown and dark gray scales. The head is narrow with sharp teeth visible in a slightly open mouth and bright, alert eyes. Its limbs are muscular with sharp claws, and the tail is long and straight, providing balance. The skin texture shows fine scales and subtle muscle definition, emphasizing its role as an early, fast predator.. In-Game asset. 2d. High contrast. No shadows
A large, realistic Spinosaurus dinosaur with dark navy-blue scaly skin, accented by lighter blue streaks along its sail and limbs. It has a long crocodile-like snout filled with sharp teeth and piercing yellow eyes. The sail on its back is tall and jagged, matching the dark tones of the body. Its tail is wide, flattened, and paddle-like—similar to a newt or salamander’s tail—designed for swimming. The muscular arms have large claws, and the overall posture is slightly hunched as if it’s ready to dive into the water. The skin texture shows rough scales, subtle wrinkles, and scars for a realistic semi-aquatic look.. In-Game asset. 2d. High contrast. No shadows
A large Stegosaurus dinosaur with a bulky body covered in grayish-green rough scaly skin. Its back is lined with two rows of large, reddish plates that gradually taper toward the tail. The tail ends with four long, sharp spikes (thagomizer) for defense. The small head has a beaked mouth and gentle eyes. The skin shows detailed scales and subtle wrinkles, giving it a lifelike prehistoric look.. In-Game asset. 2d. High contrast. No shadows
A realistic Therizinosaurus dinosaur covered in long, shaggy feathers with colors blending dark brown, black, and hints of rusty red. The feathers are especially thick on the neck, back, and arms, giving it a bird-like, primal appearance. Its long, powerful arms end in enormous, curved claws that are glossy and sharp. The small head has a beaked mouth and alert yellow eyes. The legs and tail show patches of scaly skin beneath the feather covering. The stance is slightly hunched, emphasizing its unusual shape and intimidating size.. In-Game asset. 2d. High contrast. No shadows
A massive Tyrannosaurus rex dinosaur depicted in a neutral standing pose on a transparent background. It has a powerful, muscular body covered in rough, dark green and brown scaly skin with visible wrinkles and scars. The head is huge with a wide mouth slightly open, showing rows of sharp teeth and piercing yellow eyes. Its short but strong arms have two clawed fingers, and the thick tail balances the bulky body. The skin texture features detailed scales and subtle shading, emphasizing its predatory strength and dominance.. In-Game asset. 2d. High contrast. No shadows
A large Triceratops dinosaur depicted in a neutral standing pose on a transparent background. It has a bulky, muscular body covered in rough, textured scaly skin with shades of dark brown and olive green. Its massive head features a large bony frill with small bumps and three prominent horns—two long ones above the eyes and a shorter one on the nose. The beak-like mouth is slightly open, and the eyes are calm but alert. The thick legs end in hoof-like claws, and the tail is short and heavy. The skin shows detailed scales, folds, and scars, giving it a lifelike, ancient appearance.. In-Game asset. 2d. High contrast. No shadows
A large, realistic Utahraptor dinosaur covered in dense, shaggy feathers. The plumage is a mix of dark brown, black, and rusty orange along the neck and tail. It has long, powerful legs with a signature sickle-shaped claw on each foot, and feathered arms resembling wings. The head is narrow with a curved snout, sharp teeth visible, and piercing amber eyes. The long tail is covered in sleek feathers, giving balance and a bird-like appearance.. In-Game asset. 2d. High contrast. No shadows
A small and agile Velociraptor dinosaur covered in smooth, sleek feathers in muted tones of gray and tan, with darker stripes along its back. The arms have wing-like feathers, and the long tail is fully feathered for balance. Its narrow head features a slightly curved snout, sharp teeth, and intelligent, bright eyes. The feet have curved sickle-shaped claws, emphasizing its speed and deadly precision. Real style. In-Game asset. 2d. High contrast. No shadows
realystick money. In-Game asset. 2d. High contrast. No shadows
A medium-large Allosaurus dinosaur depicted in a neutral standing pose on a transparent background. Its muscular body is covered with dark gray and earthy brown scaly skin, with subtle scars and wrinkles. The head is narrow and elongated, featuring sharp teeth visible in a slightly open mouth and prominent ridges above the eyes. Its strong legs end with sharp claws, and the long tail extends straight for balance. The skin texture is rough and detailed, giving a lifelike, ancient predator look.. In-Game asset. 2d. High contrast. No shadows
tree. In-Game asset. 2d. High contrast. No shadows
Pine. In-Game asset. 2d. High contrast. No shadows
palm tree. In-Game asset. 2d. High contrast. No shadows