forked from Odonkhuu/G001TowerDefencee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
116 lines (107 loc) · 5.57 KB
/
index.html
File metadata and controls
116 lines (107 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html lang="mn">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TD Game — Танилцуулга</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bitcount+Grid+Single+Ink:wght@100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css" />
</head>
<body class="intro">
<header class="site-header">
<div class="brand">
<svg class="coin" viewBox="0 0 64 64" aria-hidden="true">
<defs>
<radialGradient id="g" cx="50%" cy="40%" r="60%">
<stop offset="0%" stop-color="#FFE27A"/>
<stop offset="55%" stop-color="#FFC938"/>
<stop offset="100%" stop-color="#D39B00"/>
</radialGradient>
</defs>
<circle cx="32" cy="32" r="28" fill="url(#g)" stroke="#A87400" stroke-width="4"/>
<circle cx="32" cy="32" r="20" fill="none" stroke="#A87400" stroke-width="3"/>
</svg>
<span class="title">TD Game</span>
</div>
<nav>
<a href="#about">Танилцуулга</a>
<a href="#characters">Дүрүүд</a>
<a href="#algorithms">Алгоритмууд</a>
<a href="#stack">Програм/Технологи</a>
</nav>
</header>
<main class="container">
<section class="hero">
<div class="hero-text">
<h1>Цайз хамгаалах — Tower Defense</h1>
<p>Хязгааргүй давалгаатай дайснуудыг стратеги байршуулалт, ухаалаг цохилтоор буулгаж аваарай.</p>
<div class="cta">
<a class="btn btn-primary" href="game.html">Тоглох</a>
<a class="btn btn-ghost" href="#about">Дэлгэрэнгүй</a>
</div>
</div>
<div class="hero-art" aria-hidden="true">
<canvas id="heroCanvas" width="360" height="220"></canvas>
</div>
</section>
<section id="about" class="card">
<h2>Тоглоомын тухай</h2>
<p>Энэ тоглоом нь <strong>HTML5 Canvas</strong> дээр бичигдсэн Tower Defense төрлийн тоглоом.
Дайснууд <em>замын цэгүүд</em> (waypoints) даган урагшилж, тоглогч нь харвагч барилгыг зөв байршуулан
дайснуудыг барих ёстой. Алдаа гаргавал зүрх (hearts) буурч, 0 хүрмэгц тоглоом дуусна.</p>
</section>
<section id="characters" class="card">
<h2>Дүрүүд</h2>
<ul class="grid two">
<li>
<h3>Дайсан (Орк)</h3>
<p>Sprite анимац (7 фрэйм). Дайсны төв рүү чиглэн хөдөлнө.</p>
</li>
<li>
<h3>Цамхаг (Tower)</h3>
<p>Буудлагын хүрээтэй (радиус), онилсон үед тодорхой нөхцөл шалгана сум харвана.</p>
</li>
<li>
<h3>Сум (Projectile)</h3>
<p><code>atan2</code>-оор өнцгөө тодорхойлж зорилтот дайсны төв рүү шулуун хурдаар ниснэ.</p>
</li>
<li>
<h3>Байршуулах хавтан (Placement Tile)</h3>
<p>Тодорхой индекс (утга <code>14</code>) бүхий зургийн хэсэг барилгыг давталтаар харуулсанаар анимешн байдлаар харагдах юм.</p>
</li>
</ul>
</section>
<section id="algorithms" class="card">
<h2>Алгоритмууд</h2>
<ol class="algo-list">
<li><strong>Зам дагах:</strong> Дайсан бүр дараагийн waypoint руу <code>atan2(Δy, Δx)</code>-оор өнцөг олж, cos/sin үржвэрээр хурд гаргана.</li>
<li><strong>Мөргөлдөөн шалгалт:</strong> Тойрог–тойрог <code>distance < r_enemy + r_bullet</code>.</li>
<li><strong>Анимацын фрэйм:</strong> <code>elapsed % hold === 0</code> үед фрэйм ахиулна.</li>
<li><strong>Давалгааны spawn:</strong> Дайснууд дуусвал <code>spawnCount += 2</code>, дахин spawn.</li>
<li><strong>Тоглоом зогсоох:</strong> <code>requestAnimationFrame</code>-ийн нэг цикл ажиллуулж, hearts=0 үед <code>cancelAnimationFrame</code>.</li>
</ol>
</section>
<section id="stack" class="card">
<h2>Програм / Технологи</h2>
<ul class="stack-list">
<li>HTML5 Canvas, JavaScript (ES6)</li>
<li>requestAnimationFrame, 2D Context API</li>
<li>SVG (зоосон икон), Google Fonts — Bitcount</li>
<li>Зураг/спрайт бэлтгэл: Photoshop / Illustrator (болон өөр график хэрэгсэл)</li>
<li>Хөгжүүлэлт: Visual Studio Code</li>
<li>Tile map редактор: <a href="http://www.mapeditor.org" target="_blank">Tiled</a></li>
</ul>
<div class="logo-canvas-wrapper" style="padding:8px; border-radius:12px;">
<canvas id="logoCanvas" width="400" height="100"></canvas>
</div>
</section>
</main>
<footer class="site-footer">
<p>© 2025 TD Game — Танилцуулга</p>
</footer>
<script src="js/hero.js"></script>
<script src="js/stack.js"></script>
</body>
</html>