User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'dx')' in or related to this line: 'overlay(animalParts[2].dx + 18, animalParts[2].dy, 10, 18, white, 0.13, "ellipse");' Line Number: 3896
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'dx')' in or related to this line: 'overlay(animalParts[1].dx - 18, animalParts[1].dy, 10, 18, white, 0.13, "ellipse");' Line Number: 3891
User prompt
ekrana tıklayınca çıkan hayvanlar daha gerçekçi daha detaylı olmalı bütün hepsi için daha detaylı ve daha gerçekçi bir görünümleri olmalı lütfen profesyonel ve en iyisi ol
User prompt
ekrana tıklayınca çıkan hayvanları lütfen daha detaylı yap ve daha gerçekci olsun
User prompt
olmamış düzelt
User prompt
ekrana tıklayınca çıkan hayvanlar doğadaki kendi renklerinde çıksın
User prompt
ekrana tıklayınca çıkan hayvanlar için her hayvanın kendine özgü olan birşeylerini belirt anlaşılabilir olmalı
User prompt
ekrana tıklayınca çıkan hayvanlar biraz daha büyük olabilir
User prompt
ekrana tıklayınca çıkan hayvanlara biraz daha detay eklebilirsin
User prompt
ekrana tıklayınca çıkan hayvanlar biraz daha büyük olabilir
User prompt
ekrana tıklanınca çıkan partiküller biraz daha az olabilir
User prompt
hayvanlar daha gerçekçi olsun daha fazla detay ekle daha profesyonel ve en iyisi ol lütfen
User prompt
lütfen hayvanlar yukarda yazılan hayvan ismiyle birebir benzesin profesyonel ol
User prompt
şekiller görünmüyor
User prompt
şekiller lütfen hayvanlara birebir benzesin bunun için assetleri istediğin gibi kullanabilirsin
User prompt
şekiller ekranın hiç bir köşesine deymesin
User prompt
bütün hayvanları daha profesyonel yap
User prompt
çıkan şekiller ekranın sağ,sol,alt,üst köşelerinden çıkmasın
User prompt
her tıklandığında çıkan hayvanı yatay olarak çiz aşırı detaylı bir şekilde
User prompt
yatay olarak çiz bütün hayvanları
User prompt
hayvanların bütün kıvrımları bütün vücudunu çiz
User prompt
çıkan hayvan şekilleri biraz daha büyük olabilir ama ekranın dışına asla çıkmamalı
User prompt
çıkan havayıfişekler biraz azaltılabilir hayvan şekilinin üstünde çıkmasın
User prompt
çıkan hayvan desenleri daha güzel olsun ve daha belirgin olsun. arkaplan bir tık şeffaflaşabilir
User prompt
animasyon daha abartı olsun arkaplan göz kamaştırsın
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // FireworkParticle class for animated firework/particle background var FireworkParticle = Container.expand(function () { var self = Container.call(this); // Pick a random color asset for the particle var colorAssetIds = ['altin', 'bej', 'bordo', 'bronz', 'camgobegi', 'civit_mavisi', 'eflatun', 'fume', 'gri', 'gumus', 'haki', 'kahverengi', 'kirmizi', 'kobalt_mavisi', 'krem', 'lacivert', 'lavanta', 'lila', 'magenta', 'mavi', 'mercan', 'mor', 'nane_yesili', 'pembe', 'sari', 'siyah', 'ten_rengi', 'turkuaz', 'turuncu', 'visne_curugu', 'yesil', 'zeytin_yesili']; var assetId = colorAssetIds[Math.floor(Math.random() * colorAssetIds.length)]; var shapeType = Math.random() < 0.5 ? 'ellipse' : 'box'; // Larger and more varied size var size = 48 + Math.random() * 80; var asset = self.attachAsset(assetId, { shape: shapeType, anchorX: 0.5, anchorY: 0.5, width: size, height: size }); // Initial position, velocity, and alpha self.x = 0; self.y = 0; var angle = Math.random() * Math.PI * 2; // Faster and more energetic var speed = 8 + Math.random() * 12; self.vx = Math.cos(angle) * speed; self.vy = Math.sin(angle) * speed; self.gravity = 0.10 + Math.random() * 0.12; // Longer life for more persistent effect self.life = 40 + Math.floor(Math.random() * 32); self.age = 0; // Brighter and more random alpha asset.alpha = 0.92 + Math.random() * 0.08; asset.rotation = Math.random() * Math.PI * 2; // Add a random scale pulse for extra dazzle var pulse = 1 + Math.random() * 0.5; asset.scale.set(pulse, pulse); // Animate self.update = function () { self.x += self.vx; self.y += self.vy; self.vy += self.gravity; // Flicker alpha for sparkle asset.alpha *= 0.95 + Math.random() * 0.04; // Add a color flash effect if (Math.random() < 0.12) { asset.rotation += (Math.random() - 0.5) * 0.3; asset.scale.x = 1 + Math.random() * 0.7; asset.scale.y = 1 + Math.random() * 0.7; } else { asset.scale.x *= 0.985; asset.scale.y *= 0.985; } self.age++; if (self.age > self.life) { self.destroy(); } }; return self; }); // Pattern class: a container for a randomly generated pattern at a given position. var Pattern = Container.expand(function () { var self = Container.call(this); // Generate a random pattern on creation // Patterns: single shape, cluster, or overlay function randomColor() { // Expanded palette: all visually distinct, vibrant, and basic colors // Turkish color names: beyaz, sarı, turuncu, kırmızı, mor, mavi, yeşil, kahverengi, gri, siyah, pembe, bej, turkuaz, lacivert, bordo, altın, gümüş, bronz, mercan, zeytin yeşili, füme, lila, eflatun, krem, ten rengi, haki, camgöbeği, magenta, çivit mavisi, vişne çürüğü, kobalt mavisi, nane yeşili, lavanta // Full Turkish color palette, all unique and vibrant, including all requested names var colors = [0xffffff, // beyaz 0xffff00, // sarı 0xffa500, // turuncu 0xff0000, // kırmızı 0x800080, // mor 0x0000ff, // mavi 0x008000, // yeşil 0x8b4513, // kahverengi 0x808080, // gri 0x000000, // siyah 0xffb6c1, // pembe 0xf5f5dc, // bej 0x40e0d0, // turkuaz 0x191970, // lacivert 0x800000, // bordo 0xffd700, // altın 0xc0c0c0, // gümüş 0xcd7f32, // bronz 0xff7f50, // mercan 0x808000, // zeytin yeşili 0x545454, // füme 0xb57edc, // lila 0x8f00ff, // eflatun 0xfffdd0, // krem 0xffdab9, // ten rengi (peachpuff) 0x808000, // haki 0x00ced1, // camgöbeği 0xff00ff, // magenta 0x00416a, // çivit mavisi 0x70193d, // vişne çürüğü 0x0047ab, // kobalt mavisi 0x98ff98, // nane yeşili 0xe6e6fa, // lavanta // Extra vibrant and pastel tones for more variety 0xff5e5b, 0xffc857, 0x4ecdc4, 0x3a86ff, 0xffbe0b, 0xfb5607, 0x8338ec, 0xff006e, 0x06d6a0, 0x00ff00, 0x00ffff, 0xff1493, 0x00bfff, 0x9932cc, 0x8b0000, 0x2e8b57, 0xff6347, 0x9acd32, 0x6495ed, 0xdda0dd, 0xb0e0e6, 0xf5deb3, 0xf0e68c, 0xe9967a, 0x48d1cc, 0x9400d3, 0x00ff7f, 0x7b68ee, 0x6a5acd, 0x5f9ea0, 0x8b008b, 0x556b2f, 0x228b22, 0xd2691e, 0xb22222, 0x00008b, 0x008b8b, 0xb8860b, 0xa9a9a9, 0x006400, 0xbdb76b, 0xff8c00, 0x8fbc8f, 0x483d8b, 0x2f4f4f, 0x696969, 0xfffaf0, 0xdcdcdc, 0xf8f8ff, 0xdaa520, 0xadff2f, 0xf0fff0, 0xff69b4, 0xcd5c5c, 0x4b0082, 0xfffff0, 0xfff0f5, 0xfffacd, 0xadd8e6, 0xf08080, 0xe0ffff, 0xfafad2, 0xd3d3d3, 0x90ee90, 0xffa07a, 0x20b2aa, 0x87cefa, 0x778899, 0xb0c4de, 0xffffe0, 0x32cd32, 0xfaf0e6, 0x66cdaa, 0x0000cd, 0xba55d3, 0x9370db, 0x3cb371, 0x00fa9a, 0xc71585, 0xf5fffa, 0xffe4e1, 0xffe4b5, 0xffdead, 0x000080, 0xfdf5e6, 0x6b8e23, 0xff4500, 0xda70d6, 0xeee8aa, 0x98fb98, 0xafeeee, 0xdb7093, 0xffefd5, 0xcd853f, 0xffc0cb, 0x4169e1, 0xfa8072, 0xf4a460, 0xfff5ee, 0xa0522d, 0x87ceeb, 0x708090, 0xfffafa, 0xd2b48c, 0xd8bfd8, 0xee82ee, 0xf5f5f5, 0x9acd32]; // Simulate a gradient by returning an array of two colors sometimes if (Math.random() < 0.3) { var c1 = colors[Math.floor(Math.random() * colors.length)]; var c2 = colors[Math.floor(Math.random() * colors.length)]; return [c1, c2]; } return colors[Math.floor(Math.random() * colors.length)]; } function randomShape() { // Return 'box' or 'ellipse' return Math.random() < 0.5 ? 'box' : 'ellipse'; } function randomSize() { // Return a size between 120 and 400 px return 120 + Math.floor(Math.random() * 280); } function randomRotation() { // Return a random rotation in radians return Math.random() * Math.PI * 2; } function randomAlpha() { // Return a random alpha between 0.7 and 1 return 0.7 + Math.random() * 0.3; } function randomPatternType() { // 0: single, 1: cluster, 2: overlay var r = Math.random(); if (r < 0.5) return 0; if (r < 0.8) return 1; return 2; } // Generate the pattern function generatePattern() { var type = randomPatternType(); if (type === 0) { // Single shape var w = randomSize(); var h = randomSize(); var shape = randomShape(); var color = randomColor(); if (Array.isArray(color)) { // Simulate a gradient by overlaying two shapes with different colors and alpha var asset1 = self.attachAsset({ shape: shape, width: w, height: h, color: color[0], anchorX: 0.5, anchorY: 0.5, fill: color[0] }, {}); asset1.rotation = randomRotation(); asset1.alpha = randomAlpha(); var asset2 = self.attachAsset({ shape: shape, width: w, height: h, color: color[1], anchorX: 0.5, anchorY: 0.5, fill: color[1] }, {}); asset2.rotation = randomRotation(); asset2.alpha = 0.5 + Math.random() * 0.3; } else { var asset = self.attachAsset({ shape: shape, width: w, height: h, color: color, anchorX: 0.5, anchorY: 0.5, fill: color }, {}); asset.rotation = randomRotation(); asset.alpha = randomAlpha(); } } else if (type === 1) { // Cluster: 3-6 shapes in a circle var count = 3 + Math.floor(Math.random() * 4); var radius = 80 + Math.random() * 120; for (var i = 0; i < count; i++) { var angle = Math.PI * 2 / count * i + Math.random() * 0.3; var w = randomSize() * (0.5 + Math.random() * 0.7); var h = randomSize() * (0.5 + Math.random() * 0.7); var shape = randomShape(); var color = randomColor(); if (Array.isArray(color)) { // Simulate a gradient by overlaying two shapes var asset1 = self.attachAsset({ shape: shape, width: w, height: h, color: color[0], anchorX: 0.5, anchorY: 0.5, fill: color[0] }, {}); asset1.x = Math.cos(angle) * radius; asset1.y = Math.sin(angle) * radius; asset1.rotation = randomRotation(); asset1.alpha = randomAlpha(); var asset2 = self.attachAsset({ shape: shape, width: w, height: h, color: color[1], anchorX: 0.5, anchorY: 0.5, fill: color[1] }, {}); asset2.x = Math.cos(angle) * radius; asset2.y = Math.sin(angle) * radius; asset2.rotation = randomRotation(); asset2.alpha = 0.5 + Math.random() * 0.3; } else { var asset = self.attachAsset({ shape: shape, width: w, height: h, color: color, anchorX: 0.5, anchorY: 0.5, fill: color }, {}); asset.x = Math.cos(angle) * radius; asset.y = Math.sin(angle) * radius; asset.rotation = randomRotation(); asset.alpha = randomAlpha(); } } } else { // Overlay: 2-3 shapes stacked with different rotations var overlays = 2 + Math.floor(Math.random() * 2); for (var j = 0; j < overlays; j++) { var w = randomSize() * (0.7 + Math.random() * 0.5); var h = randomSize() * (0.7 + Math.random() * 0.5); var shape = randomShape(); var color = randomColor(); if (Array.isArray(color)) { var asset1 = self.attachAsset({ shape: shape, width: w, height: h, color: color[0], anchorX: 0.5, anchorY: 0.5, fill: color[0] }, {}); asset1.rotation = randomRotation(); asset1.alpha = 0.5 + Math.random() * 0.5; var asset2 = self.attachAsset({ shape: shape, width: w, height: h, color: color[1], anchorX: 0.5, anchorY: 0.5, fill: color[1] }, {}); asset2.rotation = randomRotation(); asset2.alpha = 0.3 + Math.random() * 0.3; } else { var asset = self.attachAsset({ shape: shape, width: w, height: h, color: color, anchorX: 0.5, anchorY: 0.5, fill: color }, {}); asset.rotation = randomRotation(); asset.alpha = 0.5 + Math.random() * 0.5; } } } } generatePattern(); // Pop-in animation self.scale.set(0.2, 0.2); tween(self.scale, { x: 1, y: 1 }, { duration: 350, easing: tween.elasticOut }); // Sparkle and glow effect: animate alpha and scale for shimmer function sparkleEffect(target) { // Animate alpha up and down for shimmer var _sparkleTween = function sparkleTween() { tween(target, { alpha: 1 }, { duration: 180 + Math.random() * 120, easing: tween.sineIn, onComplete: function onComplete() { tween(target, { alpha: 0.7 + Math.random() * 0.3 }, { duration: 180 + Math.random() * 120, easing: tween.sineOut, onComplete: _sparkleTween }); } }); }; _sparkleTween(); // Animate scale for a pulsing glow var _pulseTween = function pulseTween() { tween(target.scale, { x: 1.08, y: 1.08 }, { duration: 320 + Math.random() * 120, easing: tween.sineIn, onComplete: function onComplete() { tween(target.scale, { x: 1, y: 1 }, { duration: 320 + Math.random() * 120, easing: tween.sineOut, onComplete: _pulseTween }); } }); }; _pulseTween(); } // Apply sparkle effect to all children (shapes) of the pattern for (var i = 0; i < self.children.length; i++) { sparkleEffect(self.children[i]); } return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xffffff, backgroundAlpha: 0.82 // Softer, slightly transparent background }); /**** * Game Code ****/ // Store the current name and pattern containers // No score, no timer, no GUI overlays /* We will use only shapes for patterns, with random colors and sizes. No need to predefine assets, as LK will auto-create them as needed. */ // We'll use the tween plugin for simple pop-in animations. var currentNameGroup = null; var currentPatterns = []; // --- Firework background animation --- var fireworkParticles = []; var fireworkBurstInterval = 18; // frames between bursts var lastFireworkTick = 0; function spawnFireworkBurst(cx, cy, count) { for (var i = 0; i < count; i++) { var p = new FireworkParticle(); p.x = cx; p.y = cy; // Place behind everything p.zIndex = -1000; game.addChild(p); fireworkParticles.push(p); } } // Initial burst at random locations for (var i = 0; i < 3; i++) { var fx = 200 + Math.random() * (2048 - 400); var fy = 200 + Math.random() * (2732 - 400); spawnFireworkBurst(fx, fy, 18 + Math.floor(Math.random() * 10)); } // "Tap Me" colorful text at the start var tapMeText = new Text2("Tap Me", { size: 220, fill: 0xFFFFFF, font: "Arial Black" }); tapMeText.anchor.set(0.5, 0.5); tapMeText.x = 2048 / 2; tapMeText.y = 2732 / 2 - 100; tapMeText.alpha = 1; game.addChild(tapMeText); // Animate the "Tap Me" text with color cycling and pulsing var tapMeColors = ["#ff5e5b", "#ffc857", "#4ecdc4", "#3a86ff", "#ffbe0b", "#fb5607", "#8338ec", "#ff006e", "#06d6a0", "#ff0099"]; var tapMeColorIdx = 0; var tapMePulseUp = true; var tapMePulseVal = 1; var tapMePulseSpeed = 0.012; game.update = function () { // --- Firework background update --- // Reduce firework burst frequency and avoid animal area var animalAreaX = 2048 / 2; var animalAreaY = 2732 / 2 + 100; var animalAreaW = 420; var animalAreaH = 420; if (LK.ticks - lastFireworkTick > fireworkBurstInterval * 2.2) { lastFireworkTick = LK.ticks; // Fewer bursts per interval, each with fewer particles var burstCount = 1 + Math.floor(Math.random() * 2); for (var b = 0; b < burstCount; b++) { var fx, fy, tries = 0; do { fx = 80 + Math.random() * (2048 - 160); fy = 80 + Math.random() * (2732 - 160); tries++; } while (fx > animalAreaX - animalAreaW / 2 && fx < animalAreaX + animalAreaW / 2 && fy > animalAreaY - animalAreaH / 2 && fy < animalAreaY + animalAreaH / 2 && tries < 8); var count = 12 + Math.floor(Math.random() * 8); // fewer particles per burst spawnFireworkBurst(fx, fy, count); } } // Add random "super burst" for extra dazzle, but never over animal if (Math.random() < 0.012) { var fx, fy, tries = 0; do { fx = 200 + Math.random() * (2048 - 400); fy = 200 + Math.random() * (2732 - 400); tries++; } while (fx > animalAreaX - animalAreaW / 2 && fx < animalAreaX + animalAreaW / 2 && fy > animalAreaY - animalAreaH / 2 && fy < animalAreaY + animalAreaH / 2 && tries < 8); spawnFireworkBurst(fx, fy, 24 + Math.floor(Math.random() * 12)); } // Update and clean up firework particles for (var i = fireworkParticles.length - 1; i >= 0; i--) { var p = fireworkParticles[i]; if (typeof p.update === "function") p.update(); if (p.destroyed) { fireworkParticles.splice(i, 1); } } // Color cycle if (LK.ticks % 18 === 0 && tapMeText && tapMeText.setStyle) { tapMeColorIdx = (tapMeColorIdx + 1) % tapMeColors.length; tapMeText.setStyle({ fill: tapMeColors[tapMeColorIdx] }); } // Pulse if (tapMeText) { if (tapMePulseUp) { tapMePulseVal += tapMePulseSpeed; if (tapMePulseVal > 1.13) tapMePulseUp = false; } else { tapMePulseVal -= tapMePulseSpeed; if (tapMePulseVal < 0.87) tapMePulseUp = true; } tapMeText.scale.set(tapMePulseVal, tapMePulseVal); } }; // Helper: don't allow patterns in the top-left 100x100 px (menu area) function isInMenuArea(x, y) { return x < 100 && y < 100; } // List of fun, random, vibrant names var nameList = ["LUNA", "PIXEL", "NOVA", "SPARK", "BLAZE", "AURA", "VIVID", "ZEST", "GLOW", "TWIST", "DREAM", "FLASH", "PRISM", "BUBBLE", "SHINE", "VIBE", "JAZZ", "BLOSSOM", "BOLT", "WAVE"]; // Helper: pick a random name function getRandomName() { return nameList[Math.floor(Math.random() * nameList.length)]; } // Helper: get a vibrant color for text function getVibrantColor() { var colors = ["#ff5e5b", "#ffc857", "#4ecdc4", "#3a86ff", "#ffbe0b", "#fb5607", "#8338ec", "#ff006e", "#06d6a0", "#ff0099"]; return colors[Math.floor(Math.random() * colors.length)]; } // Create the "Clear" button (Text2 object) var clearBtn = new Text2("Clear", { size: 100, fill: "#222", font: "Arial Black" }); clearBtn.anchor.set(0.5, 0.5); // Place the button at the top right, with margin clearBtn.x = 2048 - 200; clearBtn.y = 120; clearBtn.interactive = true; clearBtn.buttonMode = true; game.addChild(clearBtn); // On tap/click anywhere, show a random color asset at that location (removing the previous one) game.down = function (x, y, obj) { // Don't allow patterns in menu area or on the clear button if (isInMenuArea(x, y)) return; // If tap is on the clear button, ignore (handled separately) var btnBounds = clearBtn.getBounds(); if (x >= clearBtn.x + btnBounds.x && x <= clearBtn.x + btnBounds.x + btnBounds.width && y >= clearBtn.y + btnBounds.y && y <= clearBtn.y + btnBounds.y + btnBounds.height) { return; } // Prevent firework bursts from spawning over the animal shape var animalAreaX = 2048 / 2; var animalAreaY = 2732 / 2 + 100; var animalAreaW = 420; var animalAreaH = 420; function isOverAnimalArea(px, py) { return px > animalAreaX - animalAreaW / 2 && px < animalAreaX + animalAreaW / 2 && py > animalAreaY - animalAreaH / 2 && py < animalAreaY + animalAreaH / 2; } // Only spawn tap burst if not over animal if (!isOverAnimalArea(x, y)) { spawnFireworkBurst(x, y, 32 + Math.floor(Math.random() * 24)); } // Add a few extra bursts around the tap for extra dazzle, but not over animal for (var i = 0; i < 2 + Math.floor(Math.random() * 2); i++) { var angle = Math.random() * Math.PI * 2; var dist = 80 + Math.random() * 120; var fx = x + Math.cos(angle) * dist; var fy = y + Math.sin(angle) * dist; if (!isOverAnimalArea(fx, fy)) { spawnFireworkBurst(fx, fy, 18 + Math.floor(Math.random() * 12)); } } // Remove "Tap Me" text if present if (tapMeText) { tapMeText.destroy(); tapMeText = null; } // Remove previous patterns and name if exist if (currentPatterns && currentPatterns.length) { for (var i = 0; i < currentPatterns.length; i++) { currentPatterns[i].destroy(); } currentPatterns = []; } if (currentNameGroup) { currentNameGroup.destroy(); currentNameGroup = null; } // List of all color asset ids var colorAssetIds = ['altin', 'bej', 'bordo', 'bronz', 'camgobegi', 'civit_mavisi', 'eflatun', 'fume', 'gri', 'gumus', 'haki', 'kahverengi', 'kirmizi', 'kobalt_mavisi', 'krem', 'lacivert', 'lavanta', 'lila', 'magenta', 'mavi', 'mercan', 'mor', 'nane_yesili', 'pembe', 'sari', 'siyah', 'ten_rengi', 'turkuaz', 'turuncu', 'visne_curugu', 'yesil', 'zeytin_yesili']; // Animal shape definitions: each is an array of {dx, dy, scale, colorIdx} for each part // For brevity, most animals are represented by a simple body plan: head, body, 2 ears/fins/wings, 2 eyes, tail/limb if needed // For more complex animals, you can expand the part list as needed var animalShapes = [ // Dog [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 100, scale: 1.4, colorIdx: null }, { dx: -60, dy: -50, scale: 0.6, colorIdx: null }, { dx: 60, dy: -50, scale: 0.6, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 80, dy: 140, scale: 0.5, colorIdx: null }], // Cat [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -55, dy: -65, scale: 0.5, colorIdx: null }, { dx: 55, dy: -65, scale: 0.5, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 70, dy: 120, scale: 0.5, colorIdx: null }], // Horse [{ dx: 0, dy: 0, scale: 1.3, colorIdx: null }, { dx: 0, dy: 120, scale: 1.7, colorIdx: null }, { dx: -70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 70, dy: -80, scale: 0.5, colorIdx: null }, { dx: -30, dy: 30, scale: 0.22, colorIdx: 2 }, { dx: 30, dy: 30, scale: 0.22, colorIdx: 2 }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Elephant [{ dx: 0, dy: 0, scale: 1.5, colorIdx: null }, { dx: 0, dy: 130, scale: 1.8, colorIdx: null }, { dx: -90, dy: -90, scale: 0.7, colorIdx: null }, { dx: 90, dy: -90, scale: 0.7, colorIdx: null }, { dx: 0, dy: 60, scale: 0.4, colorIdx: null }, { dx: -40, dy: 40, scale: 0.22, colorIdx: 2 }, { dx: 40, dy: 40, scale: 0.22, colorIdx: 2 }], // Lion [{ dx: 0, dy: 0, scale: 1.2, colorIdx: null }, { dx: 0, dy: 110, scale: 1.5, colorIdx: null }, { dx: -60, dy: -70, scale: 0.5, colorIdx: null }, { dx: 60, dy: -70, scale: 0.5, colorIdx: null }, { dx: -25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 0, dy: 200, scale: 0.6, colorIdx: null }], // Tiger [{ dx: 0, dy: 0, scale: 1.2, colorIdx: null }, { dx: 0, dy: 110, scale: 1.5, colorIdx: null }, { dx: -60, dy: -70, scale: 0.5, colorIdx: null }, { dx: 60, dy: -70, scale: 0.5, colorIdx: null }, { dx: -25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 0, dy: 200, scale: 0.6, colorIdx: null }], // Bear [{ dx: 0, dy: 0, scale: 1.3, colorIdx: null }, { dx: 0, dy: 120, scale: 1.7, colorIdx: null }, { dx: -70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 70, dy: -80, scale: 0.5, colorIdx: null }, { dx: -30, dy: 30, scale: 0.22, colorIdx: 2 }, { dx: 30, dy: 30, scale: 0.22, colorIdx: 2 }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Whale [{ dx: 0, dy: 0, scale: 1.5, colorIdx: null }, { dx: 0, dy: 120, scale: 2.0, colorIdx: null }, { dx: -100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 200, scale: 0.5, colorIdx: null }], // Dolphin [{ dx: 0, dy: 0, scale: 1.2, colorIdx: null }, { dx: 0, dy: 100, scale: 1.5, colorIdx: null }, { dx: -60, dy: 0, scale: 0.5, colorIdx: null }, { dx: 60, dy: 0, scale: 0.5, colorIdx: null }, { dx: 0, dy: 180, scale: 0.4, colorIdx: null }], // Monkey [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -55, dy: -65, scale: 0.5, colorIdx: null }, { dx: 55, dy: -65, scale: 0.5, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 70, dy: 120, scale: 0.5, colorIdx: null }], // Bat [{ dx: 0, dy: 0, scale: 1.0, colorIdx: null }, { dx: 0, dy: 80, scale: 1.2, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 80, dy: 0, scale: 0.7, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }], // Deer [{ dx: 0, dy: 0, scale: 1.2, colorIdx: null }, { dx: 0, dy: 110, scale: 1.5, colorIdx: null }, { dx: -60, dy: -70, scale: 0.5, colorIdx: null }, { dx: 60, dy: -70, scale: 0.5, colorIdx: null }, { dx: -25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 0, dy: 200, scale: 0.6, colorIdx: null }], // Wolf [{ dx: 0, dy: 0, scale: 1.2, colorIdx: null }, { dx: 0, dy: 110, scale: 1.5, colorIdx: null }, { dx: -60, dy: -70, scale: 0.5, colorIdx: null }, { dx: 60, dy: -70, scale: 0.5, colorIdx: null }, { dx: -25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 0, dy: 200, scale: 0.6, colorIdx: null }], // Fox [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -55, dy: -65, scale: 0.5, colorIdx: null }, { dx: 55, dy: -65, scale: 0.5, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 70, dy: 120, scale: 0.5, colorIdx: null }], // Rabbit [{ dx: 0, dy: 0, scale: 1.0, colorIdx: null }, { dx: 0, dy: 90, scale: 1.2, colorIdx: null }, { dx: -30, dy: -90, scale: 0.4, colorIdx: null }, { dx: 30, dy: -90, scale: 0.4, colorIdx: null }, { dx: -18, dy: 10, scale: 0.18, colorIdx: 2 }, { dx: 18, dy: 10, scale: 0.18, colorIdx: 2 }], // Kangaroo [{ dx: 0, dy: 0, scale: 1.2, colorIdx: null }, { dx: 0, dy: 110, scale: 1.5, colorIdx: null }, { dx: -60, dy: -70, scale: 0.5, colorIdx: null }, { dx: 60, dy: -70, scale: 0.5, colorIdx: null }, { dx: -25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 20, scale: 0.22, colorIdx: 2 }, { dx: 0, dy: 200, scale: 0.6, colorIdx: null }], // Human [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -55, dy: -65, scale: 0.5, colorIdx: null }, { dx: 55, dy: -65, scale: 0.5, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }], // Eagle [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Owl [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -55, dy: -65, scale: 0.5, colorIdx: null }, { dx: 55, dy: -65, scale: 0.5, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }], // Sparrow [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Penguin [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -55, dy: -65, scale: 0.5, colorIdx: null }, { dx: 55, dy: -65, scale: 0.5, colorIdx: null }, { dx: -25, dy: 10, scale: 0.22, colorIdx: 2 }, { dx: 25, dy: 10, scale: 0.22, colorIdx: 2 }], // Ostrich [{ dx: 0, dy: 0, scale: 1.3, colorIdx: null }, { dx: 0, dy: 120, scale: 1.7, colorIdx: null }, { dx: -70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 70, dy: -80, scale: 0.5, colorIdx: null }, { dx: -30, dy: 30, scale: 0.22, colorIdx: 2 }, { dx: 30, dy: 30, scale: 0.22, colorIdx: 2 }], // Parrot [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Pigeon [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Hummingbird [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Duck [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Swan [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Crow [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Robin [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Albatross [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Flamingo [{ dx: 0, dy: 40, scale: 1.1, colorIdx: null }, { dx: 0, dy: -60, scale: 0.7, colorIdx: null }, { dx: 0, dy: -90, scale: 0.22, colorIdx: 4 }, { dx: -60, dy: 30, scale: 0.7, colorIdx: null }, { dx: 60, dy: 80, scale: 0.5, colorIdx: null }], // Snake [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Lizard [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Crocodile [{ dx: 0, dy: 0, scale: 1.3, colorIdx: null }, { dx: 0, dy: 120, scale: 1.7, colorIdx: null }, { dx: -70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Alligator [{ dx: 0, dy: 0, scale: 1.3, colorIdx: null }, { dx: 0, dy: 120, scale: 1.7, colorIdx: null }, { dx: -70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Turtle [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Tortoise [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Chameleon [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Gecko [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Komodo Dragon [{ dx: 0, dy: 0, scale: 1.3, colorIdx: null }, { dx: 0, dy: 120, scale: 1.7, colorIdx: null }, { dx: -70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 70, dy: -80, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Cobra [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Python [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Frog [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Toad [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Salamander [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Newt [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Caecilian [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Axolotl [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: -40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 40, dy: 180, scale: 0.5, colorIdx: null }, { dx: 0, dy: 220, scale: 0.7, colorIdx: null }], // Shark [{ dx: 0, dy: 0, scale: 1.5, colorIdx: null }, { dx: 0, dy: 120, scale: 2.0, colorIdx: null }, { dx: -100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 200, scale: 0.5, colorIdx: null }], // Salmon [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: -60, scale: 0.4, colorIdx: null }, { dx: 40, dy: -10, scale: 0.18, colorIdx: 2 }], // Tuna [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: -60, scale: 0.4, colorIdx: null }, { dx: 40, dy: -10, scale: 0.18, colorIdx: 2 }], // Clownfish [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: -60, scale: 0.4, colorIdx: null }, { dx: 40, dy: -10, scale: 0.18, colorIdx: 2 }], // Goldfish [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: -60, scale: 0.4, colorIdx: null }, { dx: 40, dy: -10, scale: 0.18, colorIdx: 2 }], // Eel [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Seahorse [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: 0, dy: 90, scale: 1.3, colorIdx: null }, { dx: 0, dy: 180, scale: 1.0, colorIdx: null }, { dx: 0, dy: 270, scale: 0.7, colorIdx: null }, { dx: 0, dy: 360, scale: 0.5, colorIdx: null }], // Trout [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: -60, scale: 0.4, colorIdx: null }, { dx: 40, dy: -10, scale: 0.18, colorIdx: 2 }], // Cod [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: -60, scale: 0.4, colorIdx: null }, { dx: 40, dy: -10, scale: 0.18, colorIdx: 2 }], // Barracuda [{ dx: 0, dy: 0, scale: 1.1, colorIdx: null }, { dx: -80, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: -60, scale: 0.4, colorIdx: null }, { dx: 40, dy: -10, scale: 0.18, colorIdx: 2 }], // Stingray [{ dx: 0, dy: 0, scale: 1.5, colorIdx: null }, { dx: 0, dy: 120, scale: 2.0, colorIdx: null }, { dx: -100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 200, scale: 0.5, colorIdx: null }], // Manta Ray [{ dx: 0, dy: 0, scale: 1.5, colorIdx: null }, { dx: 0, dy: 120, scale: 2.0, colorIdx: null }, { dx: -100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 100, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 200, scale: 0.5, colorIdx: null }], // Ant [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Bee [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Butterfly [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: -40, dy: 0, scale: 0.5, colorIdx: null }, { dx: 40, dy: 0, scale: 0.5, colorIdx: null }], // Moth [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: -40, dy: 0, scale: 0.5, colorIdx: null }, { dx: 40, dy: 0, scale: 0.5, colorIdx: null }], // Beetle [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Fly [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Mosquito [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Grasshopper [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Dragonfly [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: -40, dy: 0, scale: 0.5, colorIdx: null }, { dx: 40, dy: 0, scale: 0.5, colorIdx: null }], // Ladybug [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Cockroach [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }, { dx: 0, dy: 80, scale: 0.3, colorIdx: null }], // Spider [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: -30, dy: 30, scale: 0.3, colorIdx: null }, { dx: 30, dy: 30, scale: 0.3, colorIdx: null }], // Scorpion [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: -30, dy: 30, scale: 0.3, colorIdx: null }, { dx: 30, dy: 30, scale: 0.3, colorIdx: null }], // Tick [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Mite [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Tarantula [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: -30, dy: 30, scale: 0.3, colorIdx: null }, { dx: 30, dy: 30, scale: 0.3, colorIdx: null }], // Black Widow [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: -30, dy: 30, scale: 0.3, colorIdx: null }, { dx: 30, dy: 30, scale: 0.3, colorIdx: null }], // Crab [{ dx: 0, dy: 0, scale: 0.8, colorIdx: null }, { dx: -40, dy: 0, scale: 0.4, colorIdx: null }, { dx: 40, dy: 0, scale: 0.4, colorIdx: null }], // Lobster [{ dx: 0, dy: 0, scale: 0.8, colorIdx: null }, { dx: -40, dy: 0, scale: 0.4, colorIdx: null }, { dx: 40, dy: 0, scale: 0.4, colorIdx: null }], // Shrimp [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }], // Prawn [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }], // Crayfish [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }], // Barnacle [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Krill [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Snail [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }], // Slug [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }], // Octopus [{ dx: 0, dy: 0, scale: 0.8, colorIdx: null }, { dx: -40, dy: 40, scale: 0.4, colorIdx: null }, { dx: 40, dy: 40, scale: 0.4, colorIdx: null }], // Squid [{ dx: 0, dy: 0, scale: 0.8, colorIdx: null }, { dx: -40, dy: 40, scale: 0.4, colorIdx: null }, { dx: 40, dy: 40, scale: 0.4, colorIdx: null }], // Clam [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Oyster [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Mussel [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Scallop [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Nautilus [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }], // Earthworm [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }], // Leech [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Tapeworm [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Roundworm [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Starfish (Sea Star) [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }], // Sea Urchin [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Sea Cucumber [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }], // Sand Dollar [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Jellyfish [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }, { dx: 0, dy: 40, scale: 0.5, colorIdx: null }], // Coral [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }], // Sea Anemone [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }], // Hydra [{ dx: 0, dy: 0, scale: 0.5, colorIdx: null }], // Bath Sponge [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }], // Sea Sponge [{ dx: 0, dy: 0, scale: 0.7, colorIdx: null }]]; // Animal English names, in the same order as animalShapes var animalEnglishNames = ["Dog", "Cat", "Horse", "Elephant", "Lion", "Tiger", "Bear", "Whale", "Dolphin", "Monkey", "Bat", "Deer", "Wolf", "Fox", "Rabbit", "Kangaroo", "Human", "Eagle", "Owl", "Sparrow", "Penguin", "Ostrich", "Parrot", "Pigeon", "Hummingbird", "Duck", "Swan", "Crow", "Robin", "Albatross", "Flamingo", "Snake", "Lizard", "Crocodile", "Alligator", "Turtle", "Tortoise", "Chameleon", "Gecko", "Komodo Dragon", "Cobra", "Python", "Frog", "Toad", "Salamander", "Newt", "Caecilian", "Axolotl", "Shark", "Salmon", "Tuna", "Clownfish", "Goldfish", "Eel", "Seahorse", "Trout", "Cod", "Barracuda", "Stingray", "Manta Ray", "Ant", "Bee", "Butterfly", "Moth", "Beetle", "Fly", "Mosquito", "Grasshopper", "Dragonfly", "Ladybug", "Cockroach", "Spider", "Scorpion", "Tick", "Mite", "Tarantula", "Black Widow", "Crab", "Lobster", "Shrimp", "Prawn", "Crayfish", "Barnacle", "Krill", "Snail", "Slug", "Octopus", "Squid", "Clam", "Oyster", "Mussel", "Scallop", "Nautilus", "Earthworm", "Leech", "Tapeworm", "Roundworm", "Starfish (Sea Star)", "Sea Urchin", "Sea Cucumber", "Sand Dollar", "Jellyfish", "Coral", "Sea Anemone", "Hydra", "Bath Sponge", "Sea Sponge"]; // Pick a random animal shape and its English name var animalIdx = Math.floor(Math.random() * animalShapes.length); var animal = animalShapes[animalIdx]; var animalName = animalEnglishNames[animalIdx]; // Show the animal name at the top (destroy previous if exists) if (currentNameGroup) { currentNameGroup.destroy(); currentNameGroup = null; } currentNameGroup = new Container(); var nameText = new Text2(animalName, { size: 180, fill: getVibrantColor(), font: "Arial Black" }); nameText.anchor.set(0.5, 0); nameText.x = 2048 / 2; nameText.y = 40; currentNameGroup.addChild(nameText); game.addChild(currentNameGroup); // Pick a random base color for the animal var baseColorIdx = Math.floor(Math.random() * colorAssetIds.length); // Optionally pick a second color for details var detailColorIdx = Math.floor(Math.random() * colorAssetIds.length); // --- Calculate max scale for animal so it never goes outside the screen --- // Find the bounding box of the animal parts at scale 1 var minX = 0, maxX = 0, minY = 0, maxY = 0; for (var i = 0; i < animal.length; i++) { var part = animal[i]; var w = 100 * part.scale; var h = 100 * part.scale; var px = part.dx; var py = part.dy; // For tail/limb, use longer h if (i === animal.length - 1 && animal.length > 4) { h = 160 * part.scale; w = 48 * part.scale; } // For eyes, use smaller if (typeof part.colorIdx === "number" && part.colorIdx === 2) { w = h = 32 * part.scale; } // Compute corners var left = px - w / 2; var right = px + w / 2; var top = py - h / 2; var bottom = py + h / 2; if (i === 0) { minX = left; maxX = right; minY = top; maxY = bottom; } else { if (left < minX) minX = left; if (right > maxX) maxX = right; if (top < minY) minY = top; if (bottom > maxY) maxY = bottom; } } // Center point for animal var centerX = 2048 / 2; var centerY = 2732 / 2 + 100; // visually below the name // Compute max scale so animal fits in screen (with 120px margin to never touch any corner) var marginX = 120, marginY = 120; var maxW = maxX - minX; var maxH = maxY - minY; var scaleX = (2048 - 2 * marginX) / maxW; var scaleY = (2732 - 2 * marginY - 220) / maxH; // leave space for name var maxScale = Math.min(scaleX, scaleY, 2.2); // limit to 2.2x for aesthetics // Clamp centerX and centerY so that the animal never goes outside the screen or touches any corner var animalDrawW = maxW * maxScale; var animalDrawH = maxH * maxScale; var minCenterX = marginX + animalDrawW / 2; var maxCenterX = 2048 - marginX - animalDrawW / 2; var minCenterY = marginY + animalDrawH / 2 + 100; // +100 for name area var maxCenterY = 2732 - marginY - animalDrawH / 2; centerX = Math.max(minCenterX, Math.min(centerX, maxCenterX)); centerY = Math.max(minCenterY, Math.min(centerY, maxCenterY)); // Helper for animal part drawing function drawAnimalPart(opts) { // opts: {shape, color, dx, dy, w, h, alpha, z, outline, assetIdOverride} var assetId = opts.assetIdOverride || colorAssetIds[opts.color % colorAssetIds.length]; var asset = LK.getAsset(assetId, { shape: opts.shape, anchorX: 0.5, anchorY: 0.5 }); asset.x = centerX + opts.dx * maxScale; asset.y = centerY + opts.dy * maxScale; asset.width = opts.w * maxScale; asset.height = opts.h * maxScale; asset.alpha = typeof opts.alpha === "number" ? opts.alpha : 1; if (opts.outline) { asset.lineWidth = opts.outline.width; asset.lineColor = opts.outline.color; } if (typeof opts.z === "number") asset.zIndex = opts.z; game.addChild(asset); currentPatterns.push(asset); return asset; } // Professional animal rendering: draw all body parts, with horizontal orientation, and extra details var outline = { width: 8, color: 0x222222 }; var main = baseColorIdx, detail = detailColorIdx; var black = colorAssetIds.indexOf("siyah"); var white = colorAssetIds.indexOf("beyaz") >= 0 ? colorAssetIds.indexOf("beyaz") : black; var animalParts = animalShapes[animalIdx]; // --- Even more realistic, professional, and detailed animal rendering --- // Helper: get animal-specific color and part logic, with advanced gradients and subtle shading function getAnimalDetails(animalName) { var details = {}; if (animalName === "Dog") { details.mainColorIdx = colorAssetIds.indexOf("kahverengi"); details.detailColorIdx = colorAssetIds.indexOf("bej"); details.noseColorIdx = black; details.eyeColorIdx = black; details.earColorIdx = colorAssetIds.indexOf("kahverengi"); details.tailColorIdx = colorAssetIds.indexOf("bej"); details.mouthColorIdx = black; details.legColorIdx = colorAssetIds.indexOf("bej"); details.pawColorIdx = black; details.bodyShape = "ellipse"; details.headShape = "ellipse"; details.earShape = "box"; details.tailShape = "ellipse"; details.legShape = "box"; details.pawShape = "ellipse"; details.hasWhiskers = false; details.hasSnout = true; details.hasMuzzle = true; details.hasEyebrows = true; details.hasTongue = true; details.tongueColorIdx = colorAssetIds.indexOf("pembe"); details.gradientBody = [colorAssetIds.indexOf("kahverengi"), colorAssetIds.indexOf("bej")]; details.gradientHead = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("kahverengi")]; details.gradientTail = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("kahverengi")]; details.gradientLeg = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("kahverengi")]; details.gradientEar = [colorAssetIds.indexOf("kahverengi"), colorAssetIds.indexOf("bej")]; } else if (animalName === "Cat") { details.mainColorIdx = colorAssetIds.indexOf("gri"); details.detailColorIdx = colorAssetIds.indexOf("bej"); details.noseColorIdx = colorAssetIds.indexOf("pembe"); details.eyeColorIdx = black; details.earColorIdx = colorAssetIds.indexOf("gri"); details.tailColorIdx = colorAssetIds.indexOf("bej"); details.mouthColorIdx = black; details.legColorIdx = colorAssetIds.indexOf("bej"); details.pawColorIdx = black; details.bodyShape = "ellipse"; details.headShape = "ellipse"; details.earShape = "box"; details.tailShape = "ellipse"; details.legShape = "box"; details.pawShape = "ellipse"; details.hasWhiskers = true; details.hasSnout = false; details.hasMuzzle = true; details.hasEyebrows = false; details.hasTongue = false; details.gradientBody = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")]; details.gradientHead = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")]; details.gradientTail = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")]; details.gradientLeg = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")]; details.gradientEar = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")]; } else if (animalName === "Elephant") { details.mainColorIdx = colorAssetIds.indexOf("gri"); details.detailColorIdx = colorAssetIds.indexOf("bej"); details.noseColorIdx = colorAssetIds.indexOf("gri"); details.eyeColorIdx = black; details.earColorIdx = colorAssetIds.indexOf("gri"); details.tailColorIdx = colorAssetIds.indexOf("bej"); details.mouthColorIdx = black; details.legColorIdx = colorAssetIds.indexOf("gri"); details.pawColorIdx = colorAssetIds.indexOf("bej"); details.bodyShape = "ellipse"; details.headShape = "ellipse"; details.earShape = "ellipse"; details.tailShape = "ellipse"; details.legShape = "box"; details.pawShape = "ellipse"; details.hasWhiskers = false; details.hasSnout = true; details.hasMuzzle = false; details.hasEyebrows = false; details.hasTongue = false; details.hasTrunk = true; details.trunkColorIdx = colorAssetIds.indexOf("gri"); details.gradientBody = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")]; details.gradientHead = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")]; details.gradientTail = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")]; details.gradientLeg = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")]; details.gradientEar = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")]; } else { details.mainColorIdx = main; details.detailColorIdx = detail; details.noseColorIdx = black; details.eyeColorIdx = black; details.earColorIdx = detail; details.tailColorIdx = detail; details.mouthColorIdx = black; details.legColorIdx = detail; details.pawColorIdx = black; details.bodyShape = "ellipse"; details.headShape = "ellipse"; details.earShape = "box"; details.tailShape = "ellipse"; details.legShape = "box"; details.pawShape = "ellipse"; details.hasWhiskers = false; details.hasSnout = false; details.hasMuzzle = false; details.hasEyebrows = false; details.hasTongue = false; details.gradientBody = [main, detail]; details.gradientHead = [detail, main]; details.gradientTail = [detail, main]; details.gradientLeg = [detail, main]; details.gradientEar = [detail, main]; } return details; } var animalDetails = getAnimalDetails(animalName); // --- Calculate body and head dimensions for horizontal orientation --- var bodyZ = 10; var bodyPart = animalParts[1] || animalParts[0]; var headPart = animalParts[0]; var bodyLength = 220 * (bodyPart && bodyPart.scale ? bodyPart.scale : 1.2) * maxScale; var bodyHeight = 120 * (bodyPart && bodyPart.scale ? bodyPart.scale : 1.2) * maxScale; // Helper for gradient simulation: overlay two shapes with different colors and alpha function drawGradientPart(opts, gradientColors, alpha, z) { var asset1 = drawAnimalPart({ shape: opts.shape, color: gradientColors[0], dx: opts.dx, dy: opts.dy, w: opts.w, h: opts.h, alpha: alpha, z: z, outline: opts.outline }); var asset2 = drawAnimalPart({ shape: opts.shape, color: gradientColors[1], dx: opts.dx + opts.w * 0.08, dy: opts.dy + opts.h * 0.08, w: opts.w * 0.98, h: opts.h * 0.98, alpha: alpha * 0.7, z: z + 0.01, outline: undefined }); return [asset1, asset2]; } // Draw body (horizontal ellipse) with gradient and subtle shading var bodyAssets = drawGradientPart({ shape: animalDetails.bodyShape, dx: 0, dy: 0, w: bodyLength, h: bodyHeight, outline: outline }, animalDetails.gradientBody, 1, bodyZ); currentPatterns = currentPatterns.concat(bodyAssets); // Add body shadow (soft, offset, semi-transparent) var bodyShadow = drawAnimalPart({ shape: animalDetails.bodyShape, color: black, dx: 18, dy: 22, w: bodyLength * 1.08, h: bodyHeight * 1.08, alpha: 0.13, z: bodyZ - 1 }); currentPatterns.push(bodyShadow); // Add body highlight (soft, white, top left) var bodyHighlight = drawAnimalPart({ shape: animalDetails.bodyShape, color: white, dx: -bodyLength * 0.18, dy: -bodyHeight * 0.22, w: bodyLength * 0.45, h: bodyHeight * 0.45, alpha: 0.11, z: bodyZ + 1 }); currentPatterns.push(bodyHighlight); // Draw head (ellipse, at left end) with gradient var headW = 120 * (headPart && headPart.scale ? headPart.scale : 1.1) * maxScale; var headH = 110 * (headPart && headPart.scale ? headPart.scale : 1.1) * maxScale; var headDx = -bodyLength / 2 + headW / 2 - 12; var headDy = 0; var headZ = bodyZ + 2; var headAssets = drawGradientPart({ shape: animalDetails.headShape, dx: headDx, dy: headDy, w: headW, h: headH, outline: outline }, animalDetails.gradientHead, 1, headZ); currentPatterns = currentPatterns.concat(headAssets); // Head shadow var headShadow = drawAnimalPart({ shape: animalDetails.headShape, color: black, dx: headDx + 10, dy: headDy + 14, w: headW * 1.08, h: headH * 1.08, alpha: 0.15, z: headZ - 0.5 }); currentPatterns.push(headShadow); // Head highlight var headHighlight = drawAnimalPart({ shape: animalDetails.headShape, color: white, dx: headDx - 12, dy: headDy - 18, w: headW * 0.55, h: headH * 0.55, alpha: 0.12, z: headZ + 0.5 }); currentPatterns.push(headHighlight); // Draw tail (ellipse or box, at right end) with gradient var tailPart = animalParts[animalParts.length - 1]; var tailW = 60 * (tailPart && tailPart.scale ? tailPart.scale : 0.7) * maxScale; var tailH = 120 * (tailPart && tailPart.scale ? tailPart.scale : 0.7) * maxScale; var tailDx = bodyLength / 2 - tailW / 2 + 18; var tailDy = 0; var tailZ = bodyZ + 1.5; var tailAssets = drawGradientPart({ shape: animalDetails.tailShape, dx: tailDx, dy: tailDy, w: tailW, h: tailH, outline: outline }, animalDetails.gradientTail, 0.95, tailZ); currentPatterns = currentPatterns.concat(tailAssets); // Draw legs (4 legs, boxes, spaced along body) with gradient for (var l = 0; l < 4; l++) { var legDx = -bodyLength / 3 + l * (bodyLength / 2.2); var legDy = bodyHeight / 2 + 32; var legW = 28 * maxScale; var legH = 90 * maxScale; var legZ = bodyZ - 0.2 + l * 0.01; var legAssets = drawGradientPart({ shape: animalDetails.legShape, dx: legDx, dy: legDy, w: legW, h: legH, outline: outline }, animalDetails.gradientLeg, 0.93, legZ); currentPatterns = currentPatterns.concat(legAssets); // Leg shadow var legShadow = drawAnimalPart({ shape: animalDetails.legShape, color: black, dx: legDx + 6, dy: legDy + 12, w: legW * 1.08, h: legH * 1.08, alpha: 0.11, z: legZ - 0.1 }); currentPatterns.push(legShadow); } // Draw ears (2, on head, boxes or ellipses) with gradient for (var e = 0; e < 2; e++) { var earDx = headDx - 18 + e * 36; var earDy = -headH / 2 + 18; var earW = 32 * maxScale; var earH = 60 * maxScale; var earZ = headZ + 0.2 + e * 0.01; var earAssets = drawGradientPart({ shape: animalDetails.earShape, dx: earDx, dy: earDy, w: earW, h: earH, outline: outline }, animalDetails.gradientEar, 0.95, earZ); currentPatterns = currentPatterns.concat(earAssets); // Ear highlight var earHighlight = drawAnimalPart({ shape: animalDetails.earShape, color: white, dx: earDx - 6, dy: earDy - 8, w: earW * 0.5, h: earH * 0.5, alpha: 0.15, z: earZ + 0.1 }); currentPatterns.push(earHighlight); } // Draw eyes (2, on head, ellipses) for (var eye = 0; eye < 2; eye++) { var eyeDx = headDx + 18 + eye * 22; var eyeDy = -18 + eye * 8; var eyeW = 22 * maxScale; var eyeH = 22 * maxScale; var eyeZ = headZ + 2 + eye * 0.01; var eyeAsset = drawAnimalPart({ shape: "ellipse", color: animalDetails.eyeColorIdx, dx: eyeDx, dy: eyeDy, w: eyeW, h: eyeH, alpha: 0.98, z: eyeZ }); currentPatterns.push(eyeAsset); // Eye highlight var eyeHighlight = drawAnimalPart({ shape: "ellipse", color: white, dx: eyeDx - 4, dy: eyeDy - 4, w: eyeW * 0.35, h: eyeH * 0.35, alpha: 0.7, z: eyeZ + 0.1 }); currentPatterns.push(eyeHighlight); } // Draw nose (small ellipse, on head) var noseDx = headDx + 38; var noseDy = 12; var noseW = 18 * maxScale; var noseH = 12 * maxScale; var noseZ = headZ + 1.5; var noseAsset = drawAnimalPart({ shape: "ellipse", color: animalDetails.noseColorIdx, dx: noseDx, dy: noseDy, w: noseW, h: noseH, alpha: 0.85, z: noseZ }); currentPatterns.push(noseAsset); // Draw mouth (small box, under nose) var mouthDx = headDx + 38; var mouthDy = 28; var mouthW = 22 * maxScale; var mouthH = 7 * maxScale; var mouthZ = headZ + 1.6; var mouthAsset = drawAnimalPart({ shape: "box", color: animalDetails.mouthColorIdx, dx: mouthDx, dy: mouthDy, w: mouthW, h: mouthH, alpha: 0.7, z: mouthZ }); currentPatterns.push(mouthAsset); // Draw body fur/feather/scale overlays (multiple semi-transparent ellipses along the body) for (var f = 0; f < 6; f++) { var furDx = -bodyLength / 2 + (f + 0.5) * (bodyLength / 6); var furDy = Math.sin(f * 1.2) * bodyHeight * 0.18; var furW = bodyLength * 0.18; var furH = bodyHeight * 0.45; var furZ = bodyZ + 0.3 + f * 0.01; var furAsset = drawAnimalPart({ shape: "ellipse", color: (animalDetails.mainColorIdx + f * 2) % colorAssetIds.length, dx: furDx, dy: furDy, w: furW, h: furH, alpha: 0.13 + 0.07 * Math.abs(Math.sin(f)), z: furZ }); currentPatterns.push(furAsset); } // Draw body curves (overlays for 3D effect) for (var c = 0; c < 3; c++) { var curveDx = 0; var curveDy = (c - 1) * bodyHeight * 0.18; var curveW = bodyLength * (0.85 - c * 0.08); var curveH = bodyHeight * (0.65 - c * 0.09); var curveZ = bodyZ + 0.5 + c * 0.01; var curveAsset = drawAnimalPart({ shape: "ellipse", color: animalDetails.mainColorIdx, dx: curveDx, dy: curveDy, w: curveW, h: curveH, alpha: 0.09 + 0.05 * (2 - c), z: curveZ }); currentPatterns.push(curveAsset); } // Optionally, draw claws or paws at the end of each leg for (var l = 0; l < 4; l++) { var legDx = -bodyLength / 3 + l * (bodyLength / 2.2); var legDy = bodyHeight / 2 + 32 + legH / 2 + 10; var pawW = 22 * maxScale; var pawH = 16 * maxScale; var pawZ = bodyZ + 0.1 + l * 0.01; var pawAsset = drawAnimalPart({ shape: animalDetails.pawShape, color: animalDetails.pawColorIdx, dx: legDx, dy: legDy, w: pawW, h: pawH, alpha: 0.8, z: pawZ }); currentPatterns.push(pawAsset); } // Optionally, draw a belly highlight var bellyHighlight = drawAnimalPart({ shape: "ellipse", color: white, dx: 0, dy: bodyHeight * 0.18, w: bodyLength * 0.45, h: bodyHeight * 0.35, alpha: 0.11, z: bodyZ + 1.2 }); currentPatterns.push(bellyHighlight); // Optionally, draw a back highlight var backHighlight = drawAnimalPart({ shape: "ellipse", color: white, dx: 0, dy: -bodyHeight * 0.18, w: bodyLength * 0.35, h: bodyHeight * 0.22, alpha: 0.09, z: bodyZ + 1.3 }); currentPatterns.push(backHighlight); // Optionally, draw a tail tip highlight var tailTipHighlight = drawAnimalPart({ shape: "ellipse", color: white, dx: tailDx + tailW * 0.18, dy: tailDy, w: tailW * 0.45, h: tailH * 0.22, alpha: 0.13, z: tailZ + 0.2 }); currentPatterns.push(tailTipHighlight); // Optionally, draw whiskers (3 lines per side, as thin boxes) if (animalDetails.hasWhiskers) { for (var w = 0; w < 3; w++) { var whiskerY = mouthDy - 8 + w * 8; var whiskerLen = 38 * maxScale; var whiskerW = whiskerLen; var whiskerH = 4 * maxScale; var whiskerZ = headZ + 2.2 + w * 0.01; // Left var whiskerL = drawAnimalPart({ shape: "box", color: black, dx: mouthDx - 12 - whiskerLen / 2, dy: whiskerY, w: whiskerW, h: whiskerH, alpha: 0.5, z: whiskerZ }); currentPatterns.push(whiskerL); // Right var whiskerR = drawAnimalPart({ shape: "box", color: black, dx: mouthDx + 12 + whiskerLen / 2, dy: whiskerY, w: whiskerW, h: whiskerH, alpha: 0.5, z: whiskerZ }); currentPatterns.push(whiskerR); } } // Optionally, draw tongue for dog if (animalDetails.hasTongue) { var tongueDx = mouthDx; var tongueDy = mouthDy + 12; var tongueW = 18 * maxScale; var tongueH = 16 * maxScale; var tongueZ = mouthZ + 0.2; var tongueAsset = drawAnimalPart({ shape: "ellipse", color: animalDetails.tongueColorIdx, dx: tongueDx, dy: tongueDy, w: tongueW, h: tongueH, alpha: 0.8, z: tongueZ }); currentPatterns.push(tongueAsset); } // Optionally, draw trunk for elephant if (animalDetails.hasTrunk) { for (var t = 0; t < 4; t++) { var trunkDx = headDx + 60 + t * 18; var trunkDy = 12 + t * 10; var trunkW = 18 * maxScale * (1 - t * 0.13); var trunkH = 28 * maxScale * (1 - t * 0.09); var trunkZ = headZ + 1.7 + t * 0.01; var trunkAsset = drawAnimalPart({ shape: "ellipse", color: animalDetails.trunkColorIdx, dx: trunkDx, dy: trunkDy, w: trunkW, h: trunkH, alpha: 0.9, z: trunkZ }); currentPatterns.push(trunkAsset); } } // Optionally, draw snout for dog if (animalDetails.hasSnout) { var snoutDx = headDx + 32; var snoutDy = 10; var snoutW = 32 * maxScale; var snoutH = 22 * maxScale; var snoutZ = headZ + 1.3; var snoutAsset = drawAnimalPart({ shape: "ellipse", color: animalDetails.detailColorIdx, dx: snoutDx, dy: snoutDy, w: snoutW, h: snoutH, alpha: 0.9, z: snoutZ }); currentPatterns.push(snoutAsset); } // Optionally, draw muzzle for dog/cat if (animalDetails.hasMuzzle) { var muzzleDx = headDx + 38; var muzzleDy = 18; var muzzleW = 22 * maxScale; var muzzleH = 14 * maxScale; var muzzleZ = headZ + 1.4; var muzzleAsset = drawAnimalPart({ shape: "ellipse", color: white, dx: muzzleDx, dy: muzzleDy, w: muzzleW, h: muzzleH, alpha: 0.7, z: muzzleZ }); currentPatterns.push(muzzleAsset); } // Optionally, draw eyebrows for dog if (animalDetails.hasEyebrows) { for (var b = 0; b < 2; b++) { var browDx = headDx + 18 + b * 22; var browDy = -32 + b * 8; var browW = 16 * maxScale; var browH = 4 * maxScale; var browZ = headZ + 2.3 + b * 0.01; var browAsset = drawAnimalPart({ shape: "box", color: black, dx: browDx, dy: browDy, w: browW, h: browH, alpha: 0.7, z: browZ }); currentPatterns.push(browAsset); } } }; // Handle "Clear" button tap: remove the patterns and name clearBtn.down = function (x, y, obj) { if (currentPatterns && currentPatterns.length) { for (var i = 0; i < currentPatterns.length; i++) { currentPatterns[i].destroy(); } currentPatterns = []; } if (currentNameGroup) { currentNameGroup.destroy(); currentNameGroup = null; } }; // No dragging or move/up handlers needed, as only one name is shown at a time; // Turkish color names: beyaz, sarı, turuncu, kırmızı, mor, mavi, yeşil, kahverengi, gri, siyah, pembe, bej, turkuaz, lacivert, bordo, altın, gümüş, bronz, mercan, zeytin yeşili, füme, lila, eflatun, krem, ten rengi, haki, camgöbeği, magenta, çivit mavisi, vişne çürüğü, kobalt mavisi, nane yeşili, lavanta
===================================================================
--- original.js
+++ change.js
@@ -388,15 +388,15 @@
/****
* Game Code
****/
-// We'll use the tween plugin for simple pop-in animations.
+// Store the current name and pattern containers
+// No score, no timer, no GUI overlays
/*
We will use only shapes for patterns, with random colors and sizes.
No need to predefine assets, as LK will auto-create them as needed.
*/
-// No score, no timer, no GUI overlays
-// Store the current name and pattern containers
+// We'll use the tween plugin for simple pop-in animations.
var currentNameGroup = null;
var currentPatterns = [];
// --- Firework background animation ---
var fireworkParticles = [];
@@ -2985,14 +2985,11 @@
detail = detailColorIdx;
var black = colorAssetIds.indexOf("siyah");
var white = colorAssetIds.indexOf("beyaz") >= 0 ? colorAssetIds.indexOf("beyaz") : black;
var animalParts = animalShapes[animalIdx];
- // --- Draw animal with professional, highly detailed, horizontally accurate rendering matching the animal name ---
- // Helper: get animal-specific color and part logic
+ // --- Even more realistic, professional, and detailed animal rendering ---
+ // Helper: get animal-specific color and part logic, with advanced gradients and subtle shading
function getAnimalDetails(animalName) {
- // You can expand this for more animals and more detail
- // Returns {mainColorIdx, detailColorIdx, partOverrides: [{shape, color, dx, dy, w, h, ...}], extraParts: [...]}
- // For now, just a few examples for demonstration
var details = {};
if (animalName === "Dog") {
details.mainColorIdx = colorAssetIds.indexOf("kahverengi");
details.detailColorIdx = colorAssetIds.indexOf("bej");
@@ -3014,8 +3011,13 @@
details.hasMuzzle = true;
details.hasEyebrows = true;
details.hasTongue = true;
details.tongueColorIdx = colorAssetIds.indexOf("pembe");
+ details.gradientBody = [colorAssetIds.indexOf("kahverengi"), colorAssetIds.indexOf("bej")];
+ details.gradientHead = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("kahverengi")];
+ details.gradientTail = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("kahverengi")];
+ details.gradientLeg = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("kahverengi")];
+ details.gradientEar = [colorAssetIds.indexOf("kahverengi"), colorAssetIds.indexOf("bej")];
} else if (animalName === "Cat") {
details.mainColorIdx = colorAssetIds.indexOf("gri");
details.detailColorIdx = colorAssetIds.indexOf("bej");
details.noseColorIdx = colorAssetIds.indexOf("pembe");
@@ -3035,8 +3037,13 @@
details.hasSnout = false;
details.hasMuzzle = true;
details.hasEyebrows = false;
details.hasTongue = false;
+ details.gradientBody = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")];
+ details.gradientHead = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")];
+ details.gradientTail = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")];
+ details.gradientLeg = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")];
+ details.gradientEar = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")];
} else if (animalName === "Elephant") {
details.mainColorIdx = colorAssetIds.indexOf("gri");
details.detailColorIdx = colorAssetIds.indexOf("bej");
details.noseColorIdx = colorAssetIds.indexOf("gri");
@@ -3058,10 +3065,14 @@
details.hasEyebrows = false;
details.hasTongue = false;
details.hasTrunk = true;
details.trunkColorIdx = colorAssetIds.indexOf("gri");
+ details.gradientBody = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")];
+ details.gradientHead = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")];
+ details.gradientTail = [colorAssetIds.indexOf("bej"), colorAssetIds.indexOf("gri")];
+ details.gradientLeg = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")];
+ details.gradientEar = [colorAssetIds.indexOf("gri"), colorAssetIds.indexOf("bej")];
} else {
- // Default: use random colors
details.mainColorIdx = main;
details.detailColorIdx = detail;
details.noseColorIdx = black;
details.eyeColorIdx = black;
@@ -3080,8 +3091,13 @@
details.hasSnout = false;
details.hasMuzzle = false;
details.hasEyebrows = false;
details.hasTongue = false;
+ details.gradientBody = [main, detail];
+ details.gradientHead = [detail, main];
+ details.gradientTail = [detail, main];
+ details.gradientLeg = [detail, main];
+ details.gradientEar = [detail, main];
}
return details;
}
var animalDetails = getAnimalDetails(animalName);
@@ -3090,72 +3106,92 @@
var bodyPart = animalParts[1] || animalParts[0];
var headPart = animalParts[0];
var bodyLength = 220 * (bodyPart && bodyPart.scale ? bodyPart.scale : 1.2) * maxScale;
var bodyHeight = 120 * (bodyPart && bodyPart.scale ? bodyPart.scale : 1.2) * maxScale;
- // Draw body (horizontal ellipse)
- var bodyAsset = drawAnimalPart({
+ // Helper for gradient simulation: overlay two shapes with different colors and alpha
+ function drawGradientPart(opts, gradientColors, alpha, z) {
+ var asset1 = drawAnimalPart({
+ shape: opts.shape,
+ color: gradientColors[0],
+ dx: opts.dx,
+ dy: opts.dy,
+ w: opts.w,
+ h: opts.h,
+ alpha: alpha,
+ z: z,
+ outline: opts.outline
+ });
+ var asset2 = drawAnimalPart({
+ shape: opts.shape,
+ color: gradientColors[1],
+ dx: opts.dx + opts.w * 0.08,
+ dy: opts.dy + opts.h * 0.08,
+ w: opts.w * 0.98,
+ h: opts.h * 0.98,
+ alpha: alpha * 0.7,
+ z: z + 0.01,
+ outline: undefined
+ });
+ return [asset1, asset2];
+ }
+ // Draw body (horizontal ellipse) with gradient and subtle shading
+ var bodyAssets = drawGradientPart({
shape: animalDetails.bodyShape,
- color: animalDetails.mainColorIdx,
dx: 0,
dy: 0,
w: bodyLength,
h: bodyHeight,
- alpha: 1,
- z: bodyZ,
outline: outline
- });
- currentPatterns.push(bodyAsset);
- // Add body shadow
+ }, animalDetails.gradientBody, 1, bodyZ);
+ currentPatterns = currentPatterns.concat(bodyAssets);
+ // Add body shadow (soft, offset, semi-transparent)
var bodyShadow = drawAnimalPart({
shape: animalDetails.bodyShape,
color: black,
dx: 18,
dy: 22,
w: bodyLength * 1.08,
h: bodyHeight * 1.08,
- alpha: 0.16,
+ alpha: 0.13,
z: bodyZ - 1
});
currentPatterns.push(bodyShadow);
- // Add body highlight
+ // Add body highlight (soft, white, top left)
var bodyHighlight = drawAnimalPart({
shape: animalDetails.bodyShape,
color: white,
dx: -bodyLength * 0.18,
dy: -bodyHeight * 0.22,
w: bodyLength * 0.45,
h: bodyHeight * 0.45,
- alpha: 0.13,
+ alpha: 0.11,
z: bodyZ + 1
});
currentPatterns.push(bodyHighlight);
- // Draw head (ellipse, at left end)
+ // Draw head (ellipse, at left end) with gradient
var headW = 120 * (headPart && headPart.scale ? headPart.scale : 1.1) * maxScale;
var headH = 110 * (headPart && headPart.scale ? headPart.scale : 1.1) * maxScale;
var headDx = -bodyLength / 2 + headW / 2 - 12;
var headDy = 0;
var headZ = bodyZ + 2;
- var headAsset = drawAnimalPart({
+ var headAssets = drawGradientPart({
shape: animalDetails.headShape,
- color: animalDetails.mainColorIdx,
dx: headDx,
dy: headDy,
w: headW,
h: headH,
- alpha: 1,
- z: headZ,
outline: outline
- });
- currentPatterns.push(headAsset);
+ }, animalDetails.gradientHead, 1, headZ);
+ currentPatterns = currentPatterns.concat(headAssets);
// Head shadow
var headShadow = drawAnimalPart({
shape: animalDetails.headShape,
color: black,
dx: headDx + 10,
dy: headDy + 14,
w: headW * 1.08,
h: headH * 1.08,
- alpha: 0.18,
+ alpha: 0.15,
z: headZ - 0.5
});
currentPatterns.push(headShadow);
// Head highlight
@@ -3165,91 +3201,82 @@
dx: headDx - 12,
dy: headDy - 18,
w: headW * 0.55,
h: headH * 0.55,
- alpha: 0.13,
+ alpha: 0.12,
z: headZ + 0.5
});
currentPatterns.push(headHighlight);
- // Draw tail (ellipse or box, at right end)
+ // Draw tail (ellipse or box, at right end) with gradient
var tailPart = animalParts[animalParts.length - 1];
var tailW = 60 * (tailPart && tailPart.scale ? tailPart.scale : 0.7) * maxScale;
var tailH = 120 * (tailPart && tailPart.scale ? tailPart.scale : 0.7) * maxScale;
var tailDx = bodyLength / 2 - tailW / 2 + 18;
var tailDy = 0;
var tailZ = bodyZ + 1.5;
- var tailAsset = drawAnimalPart({
+ var tailAssets = drawGradientPart({
shape: animalDetails.tailShape,
- color: animalDetails.tailColorIdx,
dx: tailDx,
dy: tailDy,
w: tailW,
h: tailH,
- alpha: 0.95,
- z: tailZ,
outline: outline
- });
- currentPatterns.push(tailAsset);
- // Draw legs (4 legs, boxes, spaced along body)
+ }, animalDetails.gradientTail, 0.95, tailZ);
+ currentPatterns = currentPatterns.concat(tailAssets);
+ // Draw legs (4 legs, boxes, spaced along body) with gradient
for (var l = 0; l < 4; l++) {
var legDx = -bodyLength / 3 + l * (bodyLength / 2.2);
var legDy = bodyHeight / 2 + 32;
var legW = 28 * maxScale;
var legH = 90 * maxScale;
var legZ = bodyZ - 0.2 + l * 0.01;
- var legAsset = drawAnimalPart({
+ var legAssets = drawGradientPart({
shape: animalDetails.legShape,
- color: animalDetails.legColorIdx,
dx: legDx,
dy: legDy,
w: legW,
h: legH,
- alpha: 0.93,
- z: legZ,
outline: outline
- });
- currentPatterns.push(legAsset);
+ }, animalDetails.gradientLeg, 0.93, legZ);
+ currentPatterns = currentPatterns.concat(legAssets);
// Leg shadow
var legShadow = drawAnimalPart({
shape: animalDetails.legShape,
color: black,
dx: legDx + 6,
dy: legDy + 12,
w: legW * 1.08,
h: legH * 1.08,
- alpha: 0.13,
+ alpha: 0.11,
z: legZ - 0.1
});
currentPatterns.push(legShadow);
}
- // Draw ears (2, on head, boxes or ellipses)
+ // Draw ears (2, on head, boxes or ellipses) with gradient
for (var e = 0; e < 2; e++) {
var earDx = headDx - 18 + e * 36;
var earDy = -headH / 2 + 18;
var earW = 32 * maxScale;
var earH = 60 * maxScale;
var earZ = headZ + 0.2 + e * 0.01;
- var earAsset = drawAnimalPart({
+ var earAssets = drawGradientPart({
shape: animalDetails.earShape,
- color: animalDetails.earColorIdx,
dx: earDx,
dy: earDy,
w: earW,
h: earH,
- alpha: 0.95,
- z: earZ,
outline: outline
- });
- currentPatterns.push(earAsset);
+ }, animalDetails.gradientEar, 0.95, earZ);
+ currentPatterns = currentPatterns.concat(earAssets);
// Ear highlight
var earHighlight = drawAnimalPart({
shape: animalDetails.earShape,
color: white,
dx: earDx - 6,
dy: earDy - 8,
w: earW * 0.5,
h: earH * 0.5,
- alpha: 0.18,
+ alpha: 0.15,
z: earZ + 0.1
});
currentPatterns.push(earHighlight);
}
@@ -3465,9 +3492,8 @@
currentPatterns.push(tongueAsset);
}
// Optionally, draw trunk for elephant
if (animalDetails.hasTrunk) {
- // Trunk is a series of ellipses
for (var t = 0; t < 4; t++) {
var trunkDx = headDx + 60 + t * 18;
var trunkDy = 12 + t * 10;
var trunkW = 18 * maxScale * (1 - t * 0.13);