Help
RSS
API
Feed
Maltego
Contact
Domain > toolsdepo.com
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2024-11-19
162.159.153.185
(
ClassC
)
2024-11-21
162.159.153.240
(
ClassC
)
2024-11-28
162.159.152.231
(
ClassC
)
2024-12-02
162.159.153.10
(
ClassC
)
2026-02-16
113.52.132.74
(
ClassC
)
Port 80
HTTP/1.1 301 Moved PermanentlyServer: nginxDate: Mon, 16 Feb 2026 06:59:22 GMTContent-Type: text/htmlContent-Length: 162Connection: keep-aliveLocation: https://toolsdepo.com/Strict-Transport-Security: max-age31536000 html>head>title>301 Moved Permanently/title>/head>body>center>h1>301 Moved Permanently/h1>/center>hr>center>nginx/center>/body>/html>
Port 443
HTTP/1.1 200 OKServer: nginxDate: Mon, 16 Feb 2026 06:59:22 GMTContent-Type: text/htmlContent-Length: 61620Last-Modified: Mon, 14 Jul 2025 06:00:37 GMTConnection: keep-aliveVary: Accept-EncodingETag: 68749d05-f0b4Strict-Transport-Security: max-age31536000Accept-Ranges: bytes !DOCTYPE html>html langzh-CN>head> meta charsetUTF-8> meta nameviewport contentwidthdevice-width, initial-scale1.0> title>恐龙跳跃游戏/title> style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%); display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow: hidden; margin: 0; padding: 0; } .game-container { background: linear-gradient(145deg, #ffffff 0%, #f0f8ff 100%); border-radius: 25px; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6); padding: 30px; position: relative; overflow: hidden; width: 95vw; max-width: 1400px; border: 2px solid rgba(255, 255, 255, 0.3); } .game-header { text-align: center; margin-bottom: 20px; } .game-title { font-size: 2.5em; color: #333; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); } .score-display { font-size: 1.5em; color: #666; margin-bottom: 10px; } .high-score { font-size: 1.2em; color: #888; } #gameCanvas { border: 4px solid #2c3e50; border-radius: 15px; display: block; margin: 0 auto; background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 30%, #98FB98 70%, #90EE90 100%); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3); width: 100%; max-width: 1200px; height: 500px; } .game-controls { text-align: center; margin-top: 20px; } .btn { background: linear-gradient(45deg, #FF6B6B, #FF8E53); color: white; border: none; padding: 15px 30px; font-size: 1.2em; border-radius: 25px; cursor: pointer; margin: 0 10px; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3); } .btn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4); } .btn:active { transform: translateY(-1px); } .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; } .game-over-screen { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.95); padding: 40px; border-radius: 20px; text-align: center; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); display: none; } .game-over-title { font-size: 3em; color: #FF6B6B; margin-bottom: 20px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); } .final-score { font-size: 2em; color: #333; margin-bottom: 30px; } .instructions { background: rgba(255, 255, 255, 0.9); padding: 15px; border-radius: 10px; margin-top: 20px; font-size: 1.1em; color: #666; } .dino-emoji { font-size: 2em; animation: bounce 2s infinite; } @keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } } .particle { position: absolute; width: 4px; height: 4px; background: #FFD700; border-radius: 50%; pointer-events: none; animation: particle-float 3s ease-out forwards; } @keyframes particle-float { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-100px) scale(0); } } @media (max-width: 768px) { .game-container { margin: 10px; padding: 15px; } .game-title { font-size: 2em; } #gameCanvas { width: 100%; height: auto; } } /style>/head>body> div classgame-container> div classgame-header> h1 classgame-title>🦕 恐龙跳跃游戏/h1> div classscore-display> 当前分数: span idcurrentScore>0/span> /div> div classhigh-score> 最高分数: span idhighScore>0/span> /div> /div> canvas idgameCanvas width1200 height500>/canvas> div classgame-controls> button idstartBtn classbtn>🎮 开始游戏/button> button idrestartBtn classbtn styledisplay: none;>🔄 重新开始/button> /div> div classinstructions> p>🎯 使用strong>空格键/strong>或strong>点击/strong>让恐龙跳跃/p> p>🚀 避开仙人掌障碍物,坚持得越久分数越高!/p> p>span classdino-emoji>🦕/span> 准备好开始冒险了吗?/p> /div> div idgameOverScreen classgame-over-screen> div classgame-over-title>游戏结束!/div> div classfinal-score>最终分数: span idfinalScore>0/span>/div> button idplayAgainBtn classbtn>🎮 再玩一次/button> /div> /div> script> // 游戏主要逻辑将在这里实现 class DinoGame { constructor() { this.canvas document.getElementById(gameCanvas); this.ctx this.canvas.getContext(2d); this.gameRunning false; this.gameStarted false; this.score 0; this.highScore localStorage.getItem(dinoHighScore) || 0; // 游戏对象 this.dino { x: 80, y: 400, width: 60, height: 60, jumping: false, jumpHeight: 0, jumpSpeed: 0, grounded: true }; this.obstacles ; this.gameSpeed 8; this.obstacleTimer 0; this.scoreTimer 0; this.backgroundOffset 0; this.init(); } init() { this.updateHighScoreDisplay(); this.setupEventListeners(); this.gameLoop(); } setupEventListeners() { // 开始按钮 document.getElementById(startBtn).addEventListener(click, () > { this.startGame(); }); // 重新开始按钮 document.getElementById(restartBtn).addEventListener(click, () > { this.restartGame(); }); // 再玩一次按钮 document.getElementById(playAgainBtn).addEventListener(click, () > { this.restartGame(); }); // 键盘控制 document.addEventListener(keydown, (e) > { if (e.code Space) { e.preventDefault(); if (this.gameRunning) { this.jump(); } } }); // 点击控制 this.canvas.addEventListener(click, () > { if (this.gameRunning) { this.jump(); } }); } startGame() { this.gameRunning true; this.gameStarted true; this.score 0; this.obstacles ; this.gameSpeed 8; this.obstacleTimer 0; this.scoreTimer 0; this.backgroundOffset 0; // 重置恐龙位置 this.dino.y 400; this.dino.jumping false; this.dino.jumpHeight 0; this.dino.jumpSpeed 0; this.dino.grounded true; // 更新UI document.getElementById(startBtn).style.display none; document.getElementById(restartBtn).style.display inline-block; document.getElementById(gameOverScreen).style.display none; this.updateScore(); } restartGame() { this.startGame(); } jump() { if (this.dino.grounded) { this.dino.jumping true; this.dino.jumpSpeed -16.5; this.dino.grounded false; this.createParticles(this.dino.x + this.dino.width/2, this.dino.y + this.dino.height); } } updatePhysics() { // 恐龙跳跃物理 if (this.dino.jumping) { this.dino.jumpSpeed + 1.3; // 重力 this.dino.y + this.dino.jumpSpeed; if (this.dino.y > 400) { this.dino.y 400; this.dino.jumping false; this.dino.jumpSpeed 0; this.dino.grounded true; } } // 生成障碍物 this.obstacleTimer++; if (this.obstacleTimer > 90 - this.gameSpeed * 2) { this.obstacles.push({ x: this.canvas.width, y: 420, width: 30, height: 80 }); this.obstacleTimer 0; } // 更新背景滚动 this.backgroundOffset + this.gameSpeed * 0.8; // 更新障碍物位置 for (let i this.obstacles.length - 1; i > 0; i--) { this.obstaclesi.x - this.gameSpeed; // 移除屏幕外的障碍物 if (this.obstaclesi.x + this.obstaclesi.width 0) { this.obstacles.splice(i, 1); } } // 检查碰撞 this.checkCollisions(); // 更新分数和游戏速度 this.scoreTimer++; if (this.scoreTimer > 8) { this.score++; this.scoreTimer 0; this.updateScore(); // 每100分增加游戏速度 if (this.score % 100 0) { this.gameSpeed + 0.8; } } } checkCollisions() { const dinoRect { x: this.dino.x + 5, y: this.dino.y + 5, width: this.dino.width - 10, height: this.dino.height - 10 }; for (let obstacle of this.obstacles) { if (dinoRect.x obstacle.x + obstacle.width && dinoRect.x + dinoRect.width > obstacle.x && dinoRect.y obstacle.y + obstacle.height && dinoRect.y + dinoRect.height > obstacle.y) { this.gameOver(); return; } } } gameOver() { this.gameRunning false; // 更新最高分 if (this.score > this.highScore) { this.highScore this.score; localStorage.setItem(dinoHighScore, this.highScore); this.updateHighScoreDisplay(); } // 显示游戏结束画面 document.getElementById(finalScore).textContent this.score; document.getElementById(gameOverScreen).style.display block; // 创建爆炸粒子效果 this.createExplosion(this.dino.x + this.dino.width/2, this.dino.y + this.dino.height/2); } updateScore() { document.getElementById(currentScore).textContent this.score; } updateHighScoreDisplay() { document.getElementById(highScore).textContent this.highScore; } createParticles(x, y) { for (let i 0; i 5; i++) { const particle document.createElement(div); particle.className particle; particle.style.left x + Math.random() * 20 - 10 + px; particle.style.top y + Math.random() * 20 - 10 + px; document.querySelector(.game-container).appendChild(particle); setTimeout(() > { particle.remove(); }, 3000); } } createExplosion(x, y) { for (let i 0; i 15; i++) { const particle document.createElement(div); particle.className particle; particle.style.left x + Math.random() * 40 - 20 + px; particle.style.top y + Math.random() * 40 - 20 + px; particle.style.background #FF6B6B; document.querySelector(.game-container).appendChild(particle); setTimeout(() > { particle.remove(); }, 3000); } } draw() { // 清除画布 this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); // 绘制背景 this.drawBackground(); // 绘制恐龙 this.drawDino(); // 绘制障碍物 this.drawObstacles(); // 绘制地面 this.drawGround(); } drawBackground() { // 绘制远山层(最远,带3D深度效果) const farMountainGradient this.ctx.createLinearGradient(0, 120, 0, 200); farMountainGradient.addColorStop(0, #6B8DD6); farMountainGradient.addColorStop(0.7, #4A90E2); farMountainGradient.addColorStop(1, #2E5A8A); this.ctx.fillStyle farMountainGradient; this.ctx.beginPath(); this.ctx.moveTo(0, 200); this.ctx.lineTo(200, 150); this.ctx.lineTo(400, 180); this.ctx.lineTo(600, 140); this.ctx.lineTo(800, 160); this.ctx.lineTo(1000, 130); this.ctx.lineTo(1200, 170); this.ctx.lineTo(1200, 200); this.ctx.closePath(); this.ctx.fill(); // 远山阴影效果 this.ctx.fillStyle rgba(0, 0, 0, 0.15); this.ctx.beginPath(); this.ctx.moveTo(0, 200); this.ctx.lineTo(200, 150); this.ctx.lineTo(190, 155); this.ctx.lineTo(0, 205); this.ctx.closePath(); this.ctx.fill(); // 绘制3D云朵(多层视差) const cloudOffset1 (this.backgroundOffset * 0.2) % 1600; const cloudOffset2 (this.backgroundOffset * 0.35) % 1400; const cloudOffset3 (this.backgroundOffset * 0.5) % 1200; // 远层云朵 this.draw3DCloud(300 - cloudOffset1, 70, 0.8, 0.3); this.draw3DCloud(700 - cloudOffset1, 90, 1.0, 0.3); this.draw3DCloud(1100 - cloudOffset1, 60, 0.9, 0.3); this.draw3DCloud(1500 - cloudOffset1, 80, 1.1, 0.3); // 中层云朵 this.draw3DCloud(200 - cloudOffset2, 100, 1.2, 0.6); this.draw3DCloud(600 - cloudOffset2, 85, 1.0, 0.6); this.draw3DCloud(1000 - cloudOffset2, 110, 1.3, 0.6); this.draw3DCloud(1400 - cloudOffset2, 95, 1.1, 0.6); // 近层云朵 this.draw3DCloud(150 - cloudOffset3, 120, 1.5, 1.0); this.draw3DCloud(500 - cloudOffset3, 105, 1.4, 1.0); this.draw3DCloud(850 - cloudOffset3, 125, 1.6, 1.0); this.draw3DCloud(1200 - cloudOffset3, 115, 1.3, 1.0); // 绘制3D太阳 this.draw3DSun(1000, 100); // 绘制零星植被 this.drawVegetation(); } draw3DCloud(x, y, scale, opacity) { // 云朵底部阴影 this.ctx.fillStyle `rgba(0, 0, 0, ${opacity * 0.2})`; this.ctx.beginPath(); this.ctx.arc(x + 3, y + 5, 25 * scale, 0, Math.PI * 2); this.ctx.arc(x + 28, y + 5, 35 * scale, 0, Math.PI * 2); this.ctx.arc(x + 53, y + 5, 25 * scale, 0, Math.PI * 2); this.ctx.arc(x + 28, y - 10, 20 * scale, 0, Math.PI * 2); this.ctx.fill(); // 云朵主体渐变 const cloudGradient this.ctx.createRadialGradient(x + 25 * scale, y - 5 * scale, 0, x + 25 * scale, y - 5 * scale, 40 * scale); cloudGradient.addColorStop(0, `rgba(255, 255, 255, ${opacity})`); cloudGradient.addColorStop(0.7, `rgba(240, 248, 255, ${opacity * 0.9})`); cloudGradient.addColorStop(1, `rgba(220, 230, 240, ${opacity * 0.7})`); this.ctx.fillStyle cloudGradient; this.ctx.beginPath(); this.ctx.arc(x, y, 25 * scale, 0, Math.PI * 2); this.ctx.arc(x + 25 * scale, y, 35 * scale, 0, Math.PI * 2); this.ctx.arc(x + 50 * scale, y, 25 * scale, 0, Math.PI * 2); this.ctx.arc(x + 25 * scale, y - 15 * scale, 20 * scale, 0, Math.PI * 2); this.ctx.fill(); // 云朵高光 this.ctx.fillStyle `rgba(255, 255, 255, ${opacity * 0.8})`; this.ctx.beginPath(); this.ctx.arc(x + 15 * scale, y - 8 * scale, 8 * scale, 0, Math.PI * 2); this.ctx.arc(x + 35 * scale, y - 12 * scale, 12 * scale, 0, Math.PI * 2); this.ctx.fill(); } draw3DSun(x, y) { // 远景太阳光 - 大范围柔和光晕 const distantGlow this.ctx.createRadialGradient(x, y, 0, x, y, 200); distantGlow.addColorStop(0, rgba(255, 248, 220, 0.08)); distantGlow.addColorStop(0.3, rgba(255, 235, 180, 0.05)); distantGlow.addColorStop(0.6, rgba(255, 215, 100, 0.03)); distantGlow.addColorStop(1, rgba(255, 215, 100, 0)); this.ctx.fillStyle distantGlow; this.ctx.beginPath(); this.ctx.arc(x, y, 200, 0, Math.PI * 2); this.ctx.fill(); // 中层柔和光晕 const mediumGlow this.ctx.createRadialGradient(x, y, 0, x, y, 120); mediumGlow.addColorStop(0, rgba(255, 245, 200, 0.12)); mediumGlow.addColorStop(0.4, rgba(255, 225, 150, 0.08)); mediumGlow.addColorStop(0.8, rgba(255, 200, 100, 0.04)); mediumGlow.addColorStop(1, rgba(255, 200, 100, 0)); this.ctx.fillStyle mediumGlow; this.ctx.beginPath(); this.ctx.arc(x, y, 120, 0, Math.PI * 2); this.ctx.fill(); // 内层温暖光晕 const innerGlow this.ctx.createRadialGradient(x, y, 0, x, y, 60); innerGlow.addColorStop(0, rgba(255, 250, 220, 0.25)); innerGlow.addColorStop(0.5, rgba(255, 235, 180, 0.18)); innerGlow.addColorStop(0.8, rgba(255, 215, 120, 0.12)); innerGlow.addColorStop(1, rgba(255, 215, 120, 0)); this.ctx.fillStyle innerGlow; this.ctx.beginPath(); this.ctx.arc(x, y, 60, 0, Math.PI * 2); this.ctx.fill(); // 太阳核心 - 非常柔和的光点 const coreGlow this.ctx.createRadialGradient(x, y, 0, x, y, 25); coreGlow.addColorStop(0, rgba(255, 255, 240, 0.4)); coreGlow.addColorStop(0.3, rgba(255, 250, 200, 0.3)); coreGlow.addColorStop(0.7, rgba(255, 240, 160, 0.2)); coreGlow.addColorStop(1, rgba(255, 240, 160, 0)); this.ctx.fillStyle coreGlow; this.ctx.beginPath(); this.ctx.arc(x, y, 25, 0, Math.PI * 2); this.ctx.fill(); // 柔和的放射光线(远景效果) this.ctx.lineCap round; for (let i 0; i 12; i++) { const angle (i * Math.PI * 2) / 12; const startRadius 35; const endRadius 80; // 主光线 - 非常柔和 const gradient this.ctx.createLinearGradient( x + Math.cos(angle) * startRadius, y + Math.sin(angle) * startRadius, x + Math.cos(angle) * endRadius, y + Math.sin(angle) * endRadius ); gradient.addColorStop(0, rgba(255, 248, 200, 0.3)); gradient.addColorStop(0.5, rgba(255, 235, 150, 0.2)); gradient.addColorStop(1, rgba(255, 235, 150, 0)); this.ctx.strokeStyle gradient; this.ctx.lineWidth 4; this.ctx.beginPath(); this.ctx.moveTo(x + Math.cos(angle) * startRadius, y + Math.sin(angle) * startRadius); this.ctx.lineTo(x + Math.cos(angle) * endRadius, y + Math.sin(angle) * endRadius); this.ctx.stroke(); // 更长的次级光线 const secondaryGradient this.ctx.createLinearGradient( x + Math.cos(angle + Math.PI/24) * 45, y + Math.sin(angle + Math.PI/24) * 45, x + Math.cos(angle + Math.PI/24) * 100, y + Math.sin(angle + Math.PI/24) * 100 ); secondaryGradient.addColorStop(0, rgba(255, 245, 180, 0.15)); secondaryGradient.addColorStop(0.7, rgba(255, 230, 130, 0.08)); secondaryGradient.addColorStop(1, rgba(255, 230, 130, 0)); this.ctx.strokeStyle secondaryGradient; this.ctx.lineWidth 2; this.ctx.beginPath(); this.ctx.moveTo(x + Math.cos(angle + Math.PI/24) * 45, y + Math.sin(angle + Math.PI/24) * 45); this.ctx.lineTo(x + Math.cos(angle + Math.PI/24) * 100, y + Math.sin(angle + Math.PI/24) * 100); this.ctx.stroke(); } } drawVegetation() { // 绘制中景树木(在原中景山位置) const treeOffset (this.backgroundOffset * 0.5) % 300; const treePositions 120, 280, 420, 580, 720, 880, 1020, 1180; const treeYPositions 240, 235, 245, 230, 240, 225, 235, 245; // 不同高度 for (let i 0; i treePositions.length; i++) { const x treePositionsi - treeOffset; if (x > -60 && x this.canvas.width + 60) { // 随机大小和类型 const scale 0.8 + (i % 4) * 0.2; const treeType i % 3; this.drawRealisticTree(x, treeYPositionsi, scale, treeType); } } // 绘制中景杂草丛(在原中景山位置) const grassOffset (this.backgroundOffset * 0.7) % 180; const grassPositions 80, 160, 240, 320, 400, 480, 560, 640, 720, 800, 880, 960, 1040, 1120; const grassYPositions 250, 245, 255, 248, 252, 240, 250, 246, 254, 248, 242, 250, 244, 252; for (let i 0; i grassPositions.length; i++) { const x grassPositionsi - grassOffset; if (x > -40 && x this.canvas.width + 40) { const scale 0.6 + (i % 3) * 0.3; const grassType i % 2; this.drawRealisticGrass(x, grassYPositionsi, scale, grassType); } } } drawRealisticTree(x, y, scale, type) { // 使用固定的分形结构,基于位置生成确定性的变化 const seed Math.floor(x / 100) + Math.floor(y / 100) + type; const trunkWidth 4 + (seed % 3) * 0.5; // 固定的树干宽度变化 const trunkHeight 35 + (seed % 5) * 2; // 固定的树干高度变化 // 树干阴影 this.ctx.fillStyle rgba(0, 0, 0, 0.4); this.ctx.fillRect(x - trunkWidth * scale + 3, y + 3, trunkWidth * 2 * scale, trunkHeight * scale); // 树干 const trunkGradient this.ctx.createLinearGradient(x - trunkWidth * scale, y, x + trunkWidth * scale, y); trunkGradient.addColorStop(0, #654321); trunkGradient.addColorStop(0.3, #8B4513); trunkGradient.addColorStop(0.7, #A0522D); trunkGradient.addColorStop(1, #654321); this.ctx.fillStyle trunkGradient; this.ctx.fillRect(x - trunkWidth * scale, y, trunkWidth * 2 * scale, trunkHeight * scale); // 树干纹理(固定位置) this.ctx.fillStyle rgba(101, 67, 33, 0.5); const textureCount 2 + (seed % 3); for (let i 0; i textureCount; i++) { this.ctx.fillRect(x - (trunkWidth - 1) * scale, y + i * (trunkHeight / textureCount) * scale, (trunkWidth * 2 - 2) * scale, 2 * scale); } // 固定的树冠尺寸变化 const crownSizeVariation 1 + ((seed + 3) % 4) * 0.1; // 固定的树冠大小变化 const crownOffsetY -10 - ((seed + 2) % 3) * 2; // 固定的树冠Y偏移 // 树冠阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.5); if (type 0) { // 圆形树冠 this.ctx.beginPath(); this.ctx.arc(x + 3, y + crownOffsetY * scale + 3, 20 * scale * crownSizeVariation, 0, Math.PI * 2); this.ctx.fill(); } else if (type 1) { // 椭圆形树冠 this.ctx.beginPath(); this.ctx.ellipse(x + 3, y + (crownOffsetY - 5) * scale + 3, 18 * scale * crownSizeVariation, 25 * scale * crownSizeVariation, 0, 0, Math.PI * 2); this.ctx.fill(); } else { // 三角形树冠(针叶树) this.ctx.beginPath(); this.ctx.moveTo(x + 3, y + (crownOffsetY - 20) * scale + 3); this.ctx.lineTo(x - 15 * scale * crownSizeVariation + 3, y + 3); this.ctx.lineTo(x + 15 * scale * crownSizeVariation + 3, y + 3); this.ctx.closePath(); this.ctx.fill(); } // 树冠主体 if (type 0) { // 圆形树冠 const leafGradient this.ctx.createRadialGradient(x - 8 * scale * crownSizeVariation, y + (crownOffsetY - 5) * scale, 0, x, y + crownOffsetY * scale, 20 * scale * crownSizeVariation); leafGradient.addColorStop(0, #90EE90); leafGradient.addColorStop(0.4, #32CD32); leafGradient.addColorStop(0.8, #228B22); leafGradient.addColorStop(1, #006400); this.ctx.fillStyle leafGradient; this.ctx.beginPath(); this.ctx.arc(x, y + crownOffsetY * scale, 20 * scale * crownSizeVariation, 0, Math.PI * 2); this.ctx.fill(); } else if (type 1) { // 椭圆形树冠 const leafGradient this.ctx.createRadialGradient(x - 6 * scale * crownSizeVariation, y + (crownOffsetY - 10) * scale, 0, x, y + (crownOffsetY - 5) * scale, 25 * scale * crownSizeVariation); leafGradient.addColorStop(0, #90EE90); leafGradient.addColorStop(0.4, #32CD32); leafGradient.addColorStop(0.8, #228B22); leafGradient.addColorStop(1, #006400); this.ctx.fillStyle leafGradient; this.ctx.beginPath(); this.ctx.ellipse(x, y + (crownOffsetY - 5) * scale, 18 * scale * crownSizeVariation, 25 * scale * crownSizeVariation, 0, 0, Math.PI * 2); this.ctx.fill(); } else { // 三角形树冠(针叶树) const leafGradient this.ctx.createLinearGradient(x - 15 * scale * crownSizeVariation, y + (crownOffsetY - 20) * scale, x + 15 * scale * crownSizeVariation, y); leafGradient.addColorStop(0, #228B22); leafGradient.addColorStop(0.5, #006400); leafGradient.addColorStop(1, #004000); this.ctx.fillStyle leafGradient; this.ctx.beginPath(); this.ctx.moveTo(x, y + (crownOffsetY - 20) * scale); this.ctx.lineTo(x - 15 * scale * crownSizeVariation, y); this.ctx.lineTo(x + 15 * scale * crownSizeVariation, y); this.ctx.closePath(); this.ctx.fill(); } // 树冠高光 this.ctx.fillStyle rgba(255, 255, 255, 0.3); if (type 0) { this.ctx.beginPath(); this.ctx.arc(x - 8 * scale * crownSizeVariation, y + (crownOffsetY - 5) * scale, 8 * scale * crownSizeVariation, 0, Math.PI * 2); this.ctx.fill(); } else if (type 1) { this.ctx.beginPath(); this.ctx.ellipse(x - 6 * scale * crownSizeVariation, y + (crownOffsetY - 15) * scale, 6 * scale * crownSizeVariation, 8 * scale * crownSizeVariation, 0, 0, Math.PI * 2); this.ctx.fill(); } else { this.ctx.beginPath(); this.ctx.moveTo(x, y + (crownOffsetY - 18) * scale); this.ctx.lineTo(x - 8 * scale * crownSizeVariation, y + (crownOffsetY - 5) * scale); this.ctx.lineTo(x + 8 * scale * crownSizeVariation, y + (crownOffsetY - 5) * scale); this.ctx.closePath(); this.ctx.fill(); } } drawRealisticGrass(x, y, scale, type) { const grassCount type 0 ? 5 : 7; const grassHeight type 0 ? 18 : 25; // 使用固定的分形结构,基于位置生成确定性的变化 const seed Math.floor(x / 50) + Math.floor(y / 50); // 杂草丛阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.4); for (let i 0; i grassCount; i++) { const offsetX (i - grassCount/2) * 3 * scale; const heightVariation 0.7 + ((seed + i) % 10) * 0.06; // 固定的高度变化 const height grassHeight * scale * heightVariation; this.ctx.beginPath(); this.ctx.moveTo(x + offsetX + 2, y + 2); this.ctx.lineTo(x + offsetX + 1.5, y - height + 2); this.ctx.lineTo(x + offsetX + 2.5, y + 2); this.ctx.closePath(); this.ctx.fill(); } // 杂草丛主体 for (let i 0; i grassCount; i++) { const offsetX (i - grassCount/2) * 3 * scale; const heightVariation 0.7 + ((seed + i) % 10) * 0.06; // 固定的高度变化 const height grassHeight * scale * heightVariation; const bendVariation ((seed + i * 2) % 8 - 4) * scale; // 固定的弯曲度 // 每根草的渐变 const grassGradient this.ctx.createLinearGradient(x + offsetX, y - height, x + offsetX, y); if (type 0) { // 嫩绿色草 grassGradient.addColorStop(0, #9AFF9A); grassGradient.addColorStop(0.3, #7CFC00); grassGradient.addColorStop(0.7, #32CD32); grassGradient.addColorStop(1, #228B22); } else { // 深绿色草 grassGradient.addColorStop(0, #90EE90); grassGradient.addColorStop(0.3, #32CD32); grassGradient.addColorStop(0.7, #228B22); grassGradient.addColorStop(1, #006400); } this.ctx.fillStyle grassGradient; // 绘制固定弯曲的草 this.ctx.beginPath(); this.ctx.moveTo(x + offsetX, y); this.ctx.lineTo(x + offsetX + bendVariation, y - height * 0.7); this.ctx.lineTo(x + offsetX + bendVariation * 0.5, y - height); this.ctx.lineTo(x + offsetX + 1, y); this.ctx.closePath(); this.ctx.fill(); } // 杂草丛高光 this.ctx.fillStyle rgba(255, 255, 255, 0.3); for (let i 0; i grassCount; i + 2) { const offsetX (i - grassCount/2) * 3 * scale; const heightVariation 0.7 + ((seed + i) % 10) * 0.06; // 固定的高度变化 const height grassHeight * scale * heightVariation; this.ctx.beginPath(); this.ctx.moveTo(x + offsetX, y - height * 0.3); this.ctx.lineTo(x + offsetX + 0.5, y - height * 0.7); this.ctx.lineTo(x + offsetX + 1, y - height * 0.3); this.ctx.closePath(); this.ctx.fill(); } } drawDino() { const x this.dino.x; const y this.dino.y; const w this.dino.width; const h this.dino.height; // 恐龙3D阴影(多层阴影效果) this.ctx.fillStyle rgba(0, 0, 0, 0.4); this.ctx.fillRect(x + 8, y + h + 18, w + 15, 12); this.ctx.fillStyle rgba(0, 0, 0, 0.2); this.ctx.fillRect(x + 5, y + h + 15, w + 10, 8); this.ctx.fillStyle rgba(0, 0, 0, 0.1); this.ctx.fillRect(x + 2, y + h + 12, w + 5, 4); // 恐龙身体阴影(3D深度) this.ctx.fillStyle rgba(0, 100, 0, 0.6); this.ctx.beginPath(); this.ctx.ellipse(x + w/2 + 3, y + h/2 + 3, w/2 - 5, h/2 - 5, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙主体颜色渐变(立体感) const gradient this.ctx.createRadialGradient(x + w/3, y + h/3, 0, x + w/2, y + h/2, w/2); gradient.addColorStop(0, #50FA7B); gradient.addColorStop(0.3, #32CD32); gradient.addColorStop(0.7, #228B22); gradient.addColorStop(1, #006400); this.ctx.fillStyle gradient; // 恐龙身体(椭圆形,更像恐龙的身体) this.ctx.beginPath(); this.ctx.ellipse(x + w/2, y + h/2, w/2 - 5, h/2 - 5, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙身体高光 this.ctx.fillStyle rgba(255, 255, 255, 0.3); this.ctx.beginPath(); this.ctx.ellipse(x + w/3, y + h/3, w/4, h/4, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙脖子阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.6); this.ctx.beginPath(); this.ctx.ellipse(x + w + 8, y + h/3 + 2, 12, 18, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙脖子 const neckGradient this.ctx.createRadialGradient(x + w + 3, y + h/3 - 5, 0, x + w + 5, y + h/3, 15); neckGradient.addColorStop(0, #3CB371); neckGradient.addColorStop(0.6, #228B22); neckGradient.addColorStop(1, #006400); this.ctx.fillStyle neckGradient; this.ctx.beginPath(); this.ctx.ellipse(x + w + 5, y + h/3, 12, 18, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙头部阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.7); this.ctx.beginPath(); this.ctx.ellipse(x + w + 28, y + 8, 20, 15, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙头部(向右的恐龙头) const headGradient this.ctx.createRadialGradient(x + w + 20, y, 0, x + w + 25, y + 5, 25); headGradient.addColorStop(0, #50FA7B); headGradient.addColorStop(0.4, #3CB371); headGradient.addColorStop(0.8, #228B22); headGradient.addColorStop(1, #006400); this.ctx.fillStyle headGradient; this.ctx.beginPath(); this.ctx.ellipse(x + w + 25, y + 5, 20, 15, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙头部高光 this.ctx.fillStyle rgba(255, 255, 255, 0.4); this.ctx.beginPath(); this.ctx.ellipse(x + w + 20, y, 8, 6, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙嘴部(向右突出) this.ctx.fillStyle #1F4F1F; this.ctx.beginPath(); this.ctx.ellipse(x + w + 40, y + 8, 12, 8, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙眼睛背景 this.ctx.fillStyle #FFFFFF; this.ctx.beginPath(); this.ctx.ellipse(x + w + 20, y, 8, 10, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙眼珠 this.ctx.fillStyle #000000; this.ctx.beginPath(); this.ctx.ellipse(x + w + 22, y + 1, 5, 6, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙眼睛高光 this.ctx.fillStyle #FFFFFF; this.ctx.beginPath(); this.ctx.ellipse(x + w + 24, y - 1, 2, 2, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙鼻孔 this.ctx.fillStyle #000000; this.ctx.beginPath(); this.ctx.ellipse(x + w + 45, y + 6, 2, 3, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙牙齿 this.ctx.fillStyle #FFFFFF; for (let i 0; i 3; i++) { this.ctx.beginPath(); this.ctx.moveTo(x + w + 35 + i * 4, y + 12); this.ctx.lineTo(x + w + 37 + i * 4, y + 8); this.ctx.lineTo(x + w + 39 + i * 4, y + 12); this.ctx.closePath(); this.ctx.fill(); } // 恐龙腿部 this.ctx.fillStyle #228B22; if (this.gameRunning && this.dino.grounded) { // 跑步动画 const legOffset Math.sin(Date.now() * 0.05) * 3; // 前腿 this.ctx.beginPath(); this.ctx.ellipse(x + w - 15, y + h + 10, 8, 18 + legOffset, 0, 0, Math.PI * 2); this.ctx.fill(); // 后腿 this.ctx.beginPath(); this.ctx.ellipse(x + 15, y + h + 10, 10, 18 - legOffset, 0, 0, Math.PI * 2); this.ctx.fill(); } else { // 静止腿部 this.ctx.beginPath(); this.ctx.ellipse(x + w - 15, y + h + 10, 8, 18, 0, 0, Math.PI * 2); this.ctx.fill(); this.ctx.beginPath(); this.ctx.ellipse(x + 15, y + h + 10, 10, 18, 0, 0, Math.PI * 2); this.ctx.fill(); } // 恐龙脚爪 this.ctx.fillStyle #1F4F1F; this.ctx.fillRect(x + w - 20, y + h + 25, 15, 5); this.ctx.fillRect(x + 10, y + h + 25, 20, 5); // 恐龙前臂 this.ctx.fillStyle #228B22; this.ctx.beginPath(); this.ctx.ellipse(x + w - 5, y + h/2 + 5, 6, 12, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙手爪 this.ctx.fillStyle #1F4F1F; this.ctx.fillRect(x + w - 8, y + h/2 + 15, 12, 3); // 恐龙尾巴(向后延伸) const tailGradient this.ctx.createLinearGradient(x, y + 20, x - 35, y + 30); tailGradient.addColorStop(0, #228B22); tailGradient.addColorStop(1, #006400); this.ctx.fillStyle tailGradient; this.ctx.beginPath(); this.ctx.ellipse(x - 15, y + 25, 20, 10, 0, 0, Math.PI * 2); this.ctx.fill(); // 恐龙背部脊椎 this.ctx.fillStyle #006400; for (let i 0; i 4; i++) { this.ctx.beginPath(); this.ctx.moveTo(x + 10 + i * 12, y + 5); this.ctx.lineTo(x + 15 + i * 12, y - 5); this.ctx.lineTo(x + 20 + i * 12, y + 5); this.ctx.closePath(); this.ctx.fill(); } // 恐龙腹部 this.ctx.fillStyle #90EE90; this.ctx.beginPath(); this.ctx.ellipse(x + w/2, y + h/2 + 5, w/3, h/3, 0, 0, Math.PI * 2); this.ctx.fill(); } drawObstacles() { for (let obstacle of this.obstacles) { const x obstacle.x; const y obstacle.y; const w obstacle.width; const h obstacle.height; // 仙人掌多层阴影(3D深度) this.ctx.fillStyle rgba(0, 0, 0, 0.5); this.ctx.fillRect(x + 6, y + h + 20, w - 3, 15); this.ctx.fillStyle rgba(0, 0, 0, 0.3); this.ctx.fillRect(x + 3, y + h + 15, w - 6, 10); this.ctx.fillStyle rgba(0, 0, 0, 0.1); this.ctx.fillRect(x, y + h + 12, w - 9, 5); // 仙人掌主体深度阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.8); this.ctx.beginPath(); this.ctx.ellipse(x + w/2 + 4, y + h/2 + 4, w/2, h/2, 0, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌主体渐变(3D立体感) const cactusGradient this.ctx.createRadialGradient(x + w/3, y + h/4, 0, x + w/2, y + h/2, w/2); cactusGradient.addColorStop(0, #90EE90); cactusGradient.addColorStop(0.3, #2E8B57); cactusGradient.addColorStop(0.7, #228B22); cactusGradient.addColorStop(1, #006400); this.ctx.fillStyle cactusGradient; // 仙人掌主体(椭圆形) this.ctx.beginPath(); this.ctx.ellipse(x + w/2, y + h/2, w/2, h/2, 0, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌主体高光 this.ctx.fillStyle rgba(255, 255, 255, 0.2); this.ctx.beginPath(); this.ctx.ellipse(x + w/3, y + h/3, w/4, h/4, 0, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌左分支阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.8); this.ctx.beginPath(); this.ctx.ellipse(x - 5, y + 35, 8, 20, 0, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌左分支 const leftBranchGradient this.ctx.createRadialGradient(x - 12, y + 28, 0, x - 8, y + 32, 12); leftBranchGradient.addColorStop(0, #90EE90); leftBranchGradient.addColorStop(0.4, #2E8B57); leftBranchGradient.addColorStop(1, #006400); this.ctx.fillStyle leftBranchGradient; this.ctx.beginPath(); this.ctx.ellipse(x - 8, y + 32, 8, 20, 0, 0, Math.PI * 2); this.ctx.fill(); // 左分支高光 this.ctx.fillStyle rgba(255, 255, 255, 0.2); this.ctx.beginPath(); this.ctx.ellipse(x - 10, y + 28, 3, 8, 0, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌右分支阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.8); this.ctx.beginPath(); this.ctx.ellipse(x + w + 5, y + 33, 10, 25, 0, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌右分支 const rightBranchGradient this.ctx.createRadialGradient(x + w - 2, y + 25, 0, x + w + 2, y + 30, 15); rightBranchGradient.addColorStop(0, #90EE90); rightBranchGradient.addColorStop(0.4, #2E8B57); rightBranchGradient.addColorStop(1, #006400); this.ctx.fillStyle rightBranchGradient; this.ctx.beginPath(); this.ctx.ellipse(x + w + 2, y + 30, 10, 25, 0, 0, Math.PI * 2); this.ctx.fill(); // 右分支高光 this.ctx.fillStyle rgba(255, 255, 255, 0.2); this.ctx.beginPath(); this.ctx.ellipse(x + w - 1, y + 25, 4, 10, 0, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌花朵 this.ctx.fillStyle #FF69B4; this.ctx.beginPath(); this.ctx.arc(x + w/2, y - 5, 4, 0, Math.PI * 2); this.ctx.fill(); // 仙人掌花瓣 this.ctx.fillStyle #FFB6C1; for (let i 0; i 6; i++) { const angle (i * Math.PI * 2) / 6; this.ctx.beginPath(); this.ctx.ellipse( x + w/2 + Math.cos(angle) * 6, y - 5 + Math.sin(angle) * 6, 3, 6, angle, 0, Math.PI * 2 ); this.ctx.fill(); } // 仙人掌刺(更细致) this.ctx.strokeStyle #8B4513; this.ctx.lineWidth 2; // 主体刺 for (let i 0; i 8; i++) { for (let j 0; j 6; j++) { const spikeX x + (w / 8) * (i + 1); const spikeY y + (h / 6) * (j + 1); this.ctx.beginPath(); this.ctx.moveTo(spikeX, spikeY); this.ctx.lineTo(spikeX + 3, spikeY - 8); this.ctx.lineTo(spikeX + 6, spikeY); this.ctx.stroke(); } } // 左分支刺 for (let i 0; i 6; i++) { const spikeX x - 8; const spikeY y + 20 + i * 4; this.ctx.beginPath(); this.ctx.moveTo(spikeX, spikeY); this.ctx.lineTo(spikeX - 6, spikeY - 3); this.ctx.stroke(); } // 右分支刺 for (let i 0; i 8; i++) { const spikeX x + w + 2; const spikeY y + 15 + i * 4; this.ctx.beginPath(); this.ctx.moveTo(spikeX, spikeY); this.ctx.lineTo(spikeX + 6, spikeY - 3); this.ctx.stroke(); } } } drawGround() { const groundHeight 35; // 地面深度阴影 this.ctx.fillStyle rgba(0, 0, 0, 0.3); this.ctx.fillRect(0, this.canvas.height - groundHeight + 5, this.canvas.width, groundHeight - 5); // 地面主体渐变(3D立体感) const groundGradient this.ctx.createLinearGradient(0, this.canvas.height - groundHeight, 0, this.canvas.height); groundGradient.addColorStop(0, #F4A460); groundGradient.addColorStop(0.2, #D2691E); groundGradient.addColorStop(0.5, #8B4513); groundGradient.addColorStop(0.8, #654321); groundGradient.addColorStop(1, #4A2C2A); this.ctx.fillStyle groundGradient; this.ctx.fillRect(0, this.canvas.height - groundHeight, this.canvas.width, groundHeight); // 地面顶部高光 this.ctx.fillStyle rgba(255, 255, 255, 0.1); this.ctx.fillRect(0, this.canvas.height - groundHeight, this.canvas.width, 3); // 地面草丛(3D立体效果) const grassOffset (this.backgroundOffset * 2) % 40; for (let i -grassOffset; i this.canvas.width; i + 40) { // 草丛阴影 this.ctx.fillStyle rgba(0, 100, 0, 0.3); for (let j 0; j 5; j++) { this.ctx.beginPath(); this.ctx.moveTo(i + j * 3 + 1, this.canvas.height - groundHeight + 1); this.ctx.lineTo(i + j * 3 + 2, this.canvas.height - groundHeight - 7); this.ctx.lineTo(i + j * 3 + 3, this.canvas.height - groundHeight + 1); this.ctx.closePath(); this.ctx.fill(); } // 草丛主体渐变 const grassGradient this.ctx.createLinearGradient(i, this.canvas.height - groundHeight - 8, i, this.canvas.height - groundHeight); grassGradient.addColorStop(0, #90EE90); grassGradient.addColorStop(0.5, #228B22); grassGradient.addColorStop(1, #006400); this.ctx.fillStyle grassGradient; // 草丛 for (let j 0; j 5; j++) { this.ctx.beginPath(); this.ctx.moveTo(i + j * 3, this.canvas.height - groundHeight); this.ctx.lineTo(i + j * 3 + 1, this.canvas.height - groundHeight - 8); this.ctx.lineTo(i + j * 3 + 2, this.canvas.height - groundHeight); this.ctx.closePath(); this.ctx.fill(); } // 草丛高光 this.ctx.fillStyle rgba(255, 255, 255, 0.2); for (let j 0; j 5; j++) { this.ctx.beginPath(); this.ctx.moveTo(i + j * 3, this.canvas.height - groundHeight - 2); this.ctx.lineTo(i + j * 3 + 0.5, this.canvas.height - groundHeight - 6); this.ctx.lineTo(i + j * 3 + 1, this.canvas.height - groundHeight - 2); this.ctx.closePath(); this.ctx.fill(); } } // 地面石头(3D立体效果) const stoneOffset (this.backgroundOffset * 1.5) % 80; for (let i -stoneOffset; i this.canvas.width; i + 80) { // 石头阴影 this.ctx.fillStyle rgba(0, 0, 0, 0.4); this.ctx.beginPath(); this.ctx.ellipse(i + 12, this.canvas.height - 8, 5, 3, 0, 0, Math.PI * 2); this.ctx.fill(); this.ctx.beginPath(); this.ctx.ellipse(i + 27, this.canvas.height - 6, 3, 2, 0, 0, Math.PI * 2); this.ctx.fill(); // 石头主体渐变 const stoneGradient this.ctx.createRadialGradient(i + 8, this.canvas.height - 12, 0, i + 10, this.canvas.height - 10, 6); stoneGradient.addColorStop(0, #A9A9A9); stoneGradient.addColorStop(0.6, #696969); stoneGradient.addColorStop(1, #2F4F4F); this.ctx.fillStyle stoneGradient; this.ctx.beginPath(); this.ctx.ellipse(i + 10, this.canvas.height - 10, 5, 3, 0, 0, Math.PI * 2); this.ctx.fill(); const stoneGradient2 this.ctx.createRadialGradient(i + 23, this.canvas.height - 10, 0, i + 25, this.canvas.height - 8, 4); stoneGradient2.addColorStop(0, #A9A9A9); stoneGradient2.addColorStop(0.6, #696969); stoneGradient2.addColorStop(1, #2F4F4F); this.ctx.fillStyle stoneGradient2; this.ctx.beginPath(); this.ctx.ellipse(i + 25, this.canvas.height - 8, 3, 2, 0, 0, Math.PI * 2); this.ctx.fill(); // 石头高光 this.ctx.fillStyle rgba(255, 255, 255, 0.3); this.ctx.beginPath(); this.ctx.ellipse(i + 8, this.canvas.height - 11, 2, 1, 0, 0, Math.PI * 2); this.ctx.fill(); this.ctx.beginPath(); this.ctx.ellipse(i + 23, this.canvas.height - 9, 1, 0.5, 0, 0, Math.PI * 2); this.ctx.fill(); } // 地面纹理线条 this.ctx.strokeStyle #A0522D; this.ctx.lineWidth 1; for (let i 0; i this.canvas.width; i + 30) { this.ctx.beginPath(); this.ctx.moveTo(i, this.canvas.height - 20); this.ctx.lineTo(i + 20, this.canvas.height - 15); this.ctx.stroke(); } } gameLoop() { if (this.gameRunning) { this.updatePhysics(); } this.draw(); requestAnimationFrame(() > this.gameLoop()); } } // 启动游戏 window.addEventListener(load, () > { new DinoGame(); }); /script>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]