Rebuild meadow with continuous overhead grass
Browse filesRemove incorrectly tiled side-view grass edges and render a connected overhead meadow with a curved lake and matching collision.
- ASSETS.md +3 -2
- README.md +1 -1
- assets/klc/grass-24.tsj +901 -0
- assets/klc/maptiles.png +0 -0
- assets/klc/solid.png +0 -0
- game.js +126 -55
- index.html +1 -0
ASSETS.md
CHANGED
|
@@ -6,9 +6,10 @@
|
|
| 6 |
|---|---|---|---|
|
| 7 |
| [`assets/klc/midi-ow.png`](assets/klc/midi-ow.png) | `game/res/klc/midi-ow.png` | 玩家角色 | [`assets/klc/midiO.ase`](assets/klc/midiO.ase);對應的精靈圖 Aseprite 原始檔 |
|
| 8 |
| [`assets/klc/pillbug.png`](assets/klc/pillbug.png) | `game/res/klc/pillbug.png` | 森林敵人 | [`assets/klc/pillbug.ase`](assets/klc/pillbug.ase) |
|
| 9 |
-
| [`assets/klc/ts-grass.png`](assets/klc/ts-grass.png) | `game/res/gfx/ts-grass.png` |
|
|
|
|
| 10 |
|
| 11 |
-
角色與敵人精靈以獨立 PNG atlas 載入,程式只選取其中的動畫影格;草地圖
|
| 12 |
|
| 13 |
- 原始專案:[github.com/KelvinShadewing/KyrodianLegends](https://github.com/KelvinShadewing/KyrodianLegends)
|
| 14 |
- 美術作者與貢獻者名單:上游 [`game/CREDITS.md`](https://github.com/KelvinShadewing/KyrodianLegends/blob/main/game/CREDITS.md)
|
|
|
|
| 6 |
|---|---|---|---|
|
| 7 |
| [`assets/klc/midi-ow.png`](assets/klc/midi-ow.png) | `game/res/klc/midi-ow.png` | 玩家角色 | [`assets/klc/midiO.ase`](assets/klc/midiO.ase);對應的精靈圖 Aseprite 原始檔 |
|
| 8 |
| [`assets/klc/pillbug.png`](assets/klc/pillbug.png) | `game/res/klc/pillbug.png` | 森林敵人 | [`assets/klc/pillbug.ase`](assets/klc/pillbug.ase) |
|
| 9 |
+
| [`assets/klc/ts-grass.png`](assets/klc/ts-grass.png) | `game/res/gfx/ts-grass.png` | 隨遊戲提供的上游側視地形素材 | 素材展示用,不作為俯視地表直接拼貼 |
|
| 10 |
+
| [`assets/klc/maptiles.png`](assets/klc/maptiles.png) | `game/res/gfx/maptiles.png` | 獨立隨附的世界地圖材質圖集 | PNG 本身可獨立重用;世界地圖與圖塊規則見上游 `game/res/map/` |
|
| 11 |
|
| 12 |
+
角色與敵人精靈以獨立 PNG atlas 載入,程式只選取其中的動畫影格。`maptiles.png` 為原作世界地圖的小型資訊圖示材質圖集;俯視森林地面以連續畫布繪製並加上低對比草紋,沒有拿世界地圖圖示或原作側視草沿貼在地面。森林湖岸也直接繪製為同一張地表上的自然曲線,避免把側視 tileset 邊角硬用於俯視場景。上游發佈的 [`midiO.ase`](assets/klc/midiO.ase) 作為 Midi 精靈圖的可編輯來源一併提供,Pillbug 素材亦附原始 `.ase` 檔。Kyrodian Legends 沒有發佈 `ts-grass.png` 對應的 `.ase` 檔,因此只提供上游 PNG,**不會將不同素材的 `.ase` 偽稱為其原始檔**。不論是單張 PNG 或 Aseprite 原始檔,皆可直接下載與重用,無須依賴本遊戲程式。
|
| 13 |
|
| 14 |
- 原始專案:[github.com/KelvinShadewing/KyrodianLegends](https://github.com/KelvinShadewing/KyrodianLegends)
|
| 15 |
- 美術作者與貢獻者名單:上游 [`game/CREDITS.md`](https://github.com/KelvinShadewing/KyrodianLegends/blob/main/game/CREDITS.md)
|
README.md
CHANGED
|
@@ -26,4 +26,4 @@ pinned: false
|
|
| 26 |
- 專案與素材來源:[github.com/KelvinShadewing/KyrodianLegends](https://github.com/KelvinShadewing/KyrodianLegends)、[kyrodianlegends.com](https://kyrodianlegends.com/)。
|
| 27 |
- 本遊戲為獨立同人詮釋,並非官方作品,也不代表 Kyrodian Legends 專案或作者立場。
|
| 28 |
|
| 29 |
-
此 Space 的介面與實作為獨立創作;Kyrodian Legends 衍生遊戲內容與素材依 KLPL 提供,個別圖像以 PNG 獨立附上,附上游既有的可編輯 `.ase` 源檔,不把素材藏在合併圖或混淆的遊戲引擎中。
|
|
|
|
| 26 |
- 專案與素材來源:[github.com/KelvinShadewing/KyrodianLegends](https://github.com/KelvinShadewing/KyrodianLegends)、[kyrodianlegends.com](https://kyrodianlegends.com/)。
|
| 27 |
- 本遊戲為獨立同人詮釋,並非官方作品,也不代表 Kyrodian Legends 專案或作者立場。
|
| 28 |
|
| 29 |
+
此 Space 的介面與實作為獨立創作;Kyrodian Legends 衍生遊戲內容與素材依 KLPL 提供,個別圖像以 PNG 獨立附上,附上游既有的可編輯 `.ase` 源檔,不把素材藏在合併圖或混淆的遊戲引擎中。俯視草地以連續的地表畫布繪製;來源圖集中的側視草沿與裝飾素材不會直接隨機貼到地面。
|
assets/klc/grass-24.tsj
ADDED
|
@@ -0,0 +1,901 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"columns": 20,
|
| 3 |
+
"image": "../gfx/ts-grass.png",
|
| 4 |
+
"imageheight": 480,
|
| 5 |
+
"imagewidth": 480,
|
| 6 |
+
"margin": 0,
|
| 7 |
+
"name": "grass-24",
|
| 8 |
+
"spacing": 0,
|
| 9 |
+
"tilecount": 400,
|
| 10 |
+
"tiledversion": "1.11.0",
|
| 11 |
+
"tileheight": 24,
|
| 12 |
+
"tileoffset": {
|
| 13 |
+
"x": -4,
|
| 14 |
+
"y": 4
|
| 15 |
+
},
|
| 16 |
+
"tiles": [
|
| 17 |
+
{
|
| 18 |
+
"id": 30,
|
| 19 |
+
"probability": 0.00999999977648258
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"id": 112,
|
| 23 |
+
"probability": 0.00999999977648258
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"id": 113,
|
| 27 |
+
"probability": 0.00999999977648258
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"id": 114,
|
| 31 |
+
"probability": 0.00999999977648258
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"id": 115,
|
| 35 |
+
"probability": 0.00999999977648258
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"id": 121,
|
| 39 |
+
"probability": 0.100000001490116
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"id": 123,
|
| 43 |
+
"probability": 0.100000001490116
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"id": 124,
|
| 47 |
+
"probability": 0.100000001490116
|
| 48 |
+
},
|
| 49 |
+
{
|
| 50 |
+
"id": 125,
|
| 51 |
+
"probability": 0.100000001490116
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"id": 132,
|
| 55 |
+
"probability": 0.00999999977648258
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"id": 133,
|
| 59 |
+
"probability": 0.00999999977648258
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"id": 134,
|
| 63 |
+
"probability": 0.00999999977648258
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"id": 135,
|
| 67 |
+
"probability": 0.00999999977648258
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"id": 143,
|
| 71 |
+
"probability": 0.100000001490116
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"id": 154,
|
| 75 |
+
"probability": 0.00100000004749745
|
| 76 |
+
},
|
| 77 |
+
{
|
| 78 |
+
"id": 155,
|
| 79 |
+
"probability": 0.00100000004749745
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"id": 156,
|
| 83 |
+
"probability": 0.00100000004749745
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
"id": 157,
|
| 87 |
+
"probability": 0.00100000004749745
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"id": 158,
|
| 91 |
+
"probability": 0.00100000004749745
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"id": 174,
|
| 95 |
+
"probability": 0.00100000004749745
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"id": 175,
|
| 99 |
+
"probability": 0.00100000004749745
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"id": 176,
|
| 103 |
+
"probability": 0.00100000004749745
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"id": 177,
|
| 107 |
+
"probability": 0.00100000004749745
|
| 108 |
+
},
|
| 109 |
+
{
|
| 110 |
+
"id": 178,
|
| 111 |
+
"probability": 0.00100000004749745
|
| 112 |
+
}
|
| 113 |
+
],
|
| 114 |
+
"tilewidth": 24,
|
| 115 |
+
"type": "tileset",
|
| 116 |
+
"version": "1.10",
|
| 117 |
+
"wangsets": [
|
| 118 |
+
{
|
| 119 |
+
"colors": [
|
| 120 |
+
{
|
| 121 |
+
"color": "#ff0000",
|
| 122 |
+
"name": "grass",
|
| 123 |
+
"probability": 1,
|
| 124 |
+
"tile": -1
|
| 125 |
+
}
|
| 126 |
+
],
|
| 127 |
+
"name": "grass",
|
| 128 |
+
"tile": -1,
|
| 129 |
+
"type": "mixed",
|
| 130 |
+
"wangtiles": [
|
| 131 |
+
{
|
| 132 |
+
"tileid": 0,
|
| 133 |
+
"wangid": [
|
| 134 |
+
0,
|
| 135 |
+
0,
|
| 136 |
+
0,
|
| 137 |
+
0,
|
| 138 |
+
1,
|
| 139 |
+
0,
|
| 140 |
+
0,
|
| 141 |
+
0
|
| 142 |
+
]
|
| 143 |
+
},
|
| 144 |
+
{
|
| 145 |
+
"tileid": 1,
|
| 146 |
+
"wangid": [
|
| 147 |
+
0,
|
| 148 |
+
0,
|
| 149 |
+
1,
|
| 150 |
+
0,
|
| 151 |
+
1,
|
| 152 |
+
0,
|
| 153 |
+
0,
|
| 154 |
+
0
|
| 155 |
+
]
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
"tileid": 2,
|
| 159 |
+
"wangid": [
|
| 160 |
+
0,
|
| 161 |
+
0,
|
| 162 |
+
1,
|
| 163 |
+
0,
|
| 164 |
+
1,
|
| 165 |
+
0,
|
| 166 |
+
1,
|
| 167 |
+
0
|
| 168 |
+
]
|
| 169 |
+
},
|
| 170 |
+
{
|
| 171 |
+
"tileid": 3,
|
| 172 |
+
"wangid": [
|
| 173 |
+
0,
|
| 174 |
+
0,
|
| 175 |
+
0,
|
| 176 |
+
0,
|
| 177 |
+
1,
|
| 178 |
+
0,
|
| 179 |
+
1,
|
| 180 |
+
0
|
| 181 |
+
]
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"tileid": 4,
|
| 185 |
+
"wangid": [
|
| 186 |
+
1,
|
| 187 |
+
0,
|
| 188 |
+
1,
|
| 189 |
+
0,
|
| 190 |
+
1,
|
| 191 |
+
0,
|
| 192 |
+
1,
|
| 193 |
+
1
|
| 194 |
+
]
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"tileid": 5,
|
| 198 |
+
"wangid": [
|
| 199 |
+
0,
|
| 200 |
+
0,
|
| 201 |
+
1,
|
| 202 |
+
1,
|
| 203 |
+
1,
|
| 204 |
+
0,
|
| 205 |
+
1,
|
| 206 |
+
0
|
| 207 |
+
]
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"tileid": 6,
|
| 211 |
+
"wangid": [
|
| 212 |
+
0,
|
| 213 |
+
0,
|
| 214 |
+
1,
|
| 215 |
+
0,
|
| 216 |
+
1,
|
| 217 |
+
1,
|
| 218 |
+
1,
|
| 219 |
+
0
|
| 220 |
+
]
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"tileid": 7,
|
| 224 |
+
"wangid": [
|
| 225 |
+
1,
|
| 226 |
+
1,
|
| 227 |
+
1,
|
| 228 |
+
0,
|
| 229 |
+
1,
|
| 230 |
+
0,
|
| 231 |
+
1,
|
| 232 |
+
0
|
| 233 |
+
]
|
| 234 |
+
},
|
| 235 |
+
{
|
| 236 |
+
"tileid": 8,
|
| 237 |
+
"wangid": [
|
| 238 |
+
0,
|
| 239 |
+
0,
|
| 240 |
+
1,
|
| 241 |
+
1,
|
| 242 |
+
1,
|
| 243 |
+
0,
|
| 244 |
+
0,
|
| 245 |
+
0
|
| 246 |
+
]
|
| 247 |
+
},
|
| 248 |
+
{
|
| 249 |
+
"tileid": 9,
|
| 250 |
+
"wangid": [
|
| 251 |
+
1,
|
| 252 |
+
0,
|
| 253 |
+
1,
|
| 254 |
+
1,
|
| 255 |
+
1,
|
| 256 |
+
1,
|
| 257 |
+
1,
|
| 258 |
+
0
|
| 259 |
+
]
|
| 260 |
+
},
|
| 261 |
+
{
|
| 262 |
+
"tileid": 10,
|
| 263 |
+
"wangid": [
|
| 264 |
+
0,
|
| 265 |
+
0,
|
| 266 |
+
1,
|
| 267 |
+
1,
|
| 268 |
+
1,
|
| 269 |
+
1,
|
| 270 |
+
1,
|
| 271 |
+
0
|
| 272 |
+
]
|
| 273 |
+
},
|
| 274 |
+
{
|
| 275 |
+
"tileid": 11,
|
| 276 |
+
"wangid": [
|
| 277 |
+
0,
|
| 278 |
+
0,
|
| 279 |
+
0,
|
| 280 |
+
0,
|
| 281 |
+
1,
|
| 282 |
+
1,
|
| 283 |
+
1,
|
| 284 |
+
0
|
| 285 |
+
]
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"tileid": 20,
|
| 289 |
+
"wangid": [
|
| 290 |
+
1,
|
| 291 |
+
0,
|
| 292 |
+
0,
|
| 293 |
+
0,
|
| 294 |
+
1,
|
| 295 |
+
0,
|
| 296 |
+
0,
|
| 297 |
+
0
|
| 298 |
+
]
|
| 299 |
+
},
|
| 300 |
+
{
|
| 301 |
+
"tileid": 21,
|
| 302 |
+
"wangid": [
|
| 303 |
+
1,
|
| 304 |
+
0,
|
| 305 |
+
1,
|
| 306 |
+
0,
|
| 307 |
+
1,
|
| 308 |
+
0,
|
| 309 |
+
0,
|
| 310 |
+
0
|
| 311 |
+
]
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"tileid": 22,
|
| 315 |
+
"wangid": [
|
| 316 |
+
1,
|
| 317 |
+
0,
|
| 318 |
+
1,
|
| 319 |
+
0,
|
| 320 |
+
1,
|
| 321 |
+
0,
|
| 322 |
+
1,
|
| 323 |
+
0
|
| 324 |
+
]
|
| 325 |
+
},
|
| 326 |
+
{
|
| 327 |
+
"tileid": 23,
|
| 328 |
+
"wangid": [
|
| 329 |
+
1,
|
| 330 |
+
0,
|
| 331 |
+
0,
|
| 332 |
+
0,
|
| 333 |
+
1,
|
| 334 |
+
0,
|
| 335 |
+
1,
|
| 336 |
+
0
|
| 337 |
+
]
|
| 338 |
+
},
|
| 339 |
+
{
|
| 340 |
+
"tileid": 24,
|
| 341 |
+
"wangid": [
|
| 342 |
+
1,
|
| 343 |
+
0,
|
| 344 |
+
1,
|
| 345 |
+
1,
|
| 346 |
+
1,
|
| 347 |
+
0,
|
| 348 |
+
0,
|
| 349 |
+
0
|
| 350 |
+
]
|
| 351 |
+
},
|
| 352 |
+
{
|
| 353 |
+
"tileid": 25,
|
| 354 |
+
"wangid": [
|
| 355 |
+
1,
|
| 356 |
+
1,
|
| 357 |
+
1,
|
| 358 |
+
1,
|
| 359 |
+
1,
|
| 360 |
+
1,
|
| 361 |
+
1,
|
| 362 |
+
0
|
| 363 |
+
]
|
| 364 |
+
},
|
| 365 |
+
{
|
| 366 |
+
"tileid": 26,
|
| 367 |
+
"wangid": [
|
| 368 |
+
1,
|
| 369 |
+
0,
|
| 370 |
+
1,
|
| 371 |
+
1,
|
| 372 |
+
1,
|
| 373 |
+
1,
|
| 374 |
+
1,
|
| 375 |
+
1
|
| 376 |
+
]
|
| 377 |
+
},
|
| 378 |
+
{
|
| 379 |
+
"tileid": 27,
|
| 380 |
+
"wangid": [
|
| 381 |
+
1,
|
| 382 |
+
0,
|
| 383 |
+
0,
|
| 384 |
+
0,
|
| 385 |
+
1,
|
| 386 |
+
1,
|
| 387 |
+
1,
|
| 388 |
+
0
|
| 389 |
+
]
|
| 390 |
+
},
|
| 391 |
+
{
|
| 392 |
+
"tileid": 28,
|
| 393 |
+
"wangid": [
|
| 394 |
+
1,
|
| 395 |
+
1,
|
| 396 |
+
1,
|
| 397 |
+
1,
|
| 398 |
+
1,
|
| 399 |
+
0,
|
| 400 |
+
0,
|
| 401 |
+
0
|
| 402 |
+
]
|
| 403 |
+
},
|
| 404 |
+
{
|
| 405 |
+
"tileid": 29,
|
| 406 |
+
"wangid": [
|
| 407 |
+
1,
|
| 408 |
+
1,
|
| 409 |
+
1,
|
| 410 |
+
0,
|
| 411 |
+
1,
|
| 412 |
+
1,
|
| 413 |
+
1,
|
| 414 |
+
0
|
| 415 |
+
]
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"tileid": 30,
|
| 419 |
+
"wangid": [
|
| 420 |
+
1,
|
| 421 |
+
1,
|
| 422 |
+
1,
|
| 423 |
+
1,
|
| 424 |
+
1,
|
| 425 |
+
1,
|
| 426 |
+
1,
|
| 427 |
+
1
|
| 428 |
+
]
|
| 429 |
+
},
|
| 430 |
+
{
|
| 431 |
+
"tileid": 31,
|
| 432 |
+
"wangid": [
|
| 433 |
+
1,
|
| 434 |
+
0,
|
| 435 |
+
1,
|
| 436 |
+
0,
|
| 437 |
+
1,
|
| 438 |
+
1,
|
| 439 |
+
1,
|
| 440 |
+
1
|
| 441 |
+
]
|
| 442 |
+
},
|
| 443 |
+
{
|
| 444 |
+
"tileid": 40,
|
| 445 |
+
"wangid": [
|
| 446 |
+
1,
|
| 447 |
+
0,
|
| 448 |
+
0,
|
| 449 |
+
0,
|
| 450 |
+
0,
|
| 451 |
+
0,
|
| 452 |
+
0,
|
| 453 |
+
0
|
| 454 |
+
]
|
| 455 |
+
},
|
| 456 |
+
{
|
| 457 |
+
"tileid": 41,
|
| 458 |
+
"wangid": [
|
| 459 |
+
1,
|
| 460 |
+
0,
|
| 461 |
+
1,
|
| 462 |
+
0,
|
| 463 |
+
0,
|
| 464 |
+
0,
|
| 465 |
+
0,
|
| 466 |
+
0
|
| 467 |
+
]
|
| 468 |
+
},
|
| 469 |
+
{
|
| 470 |
+
"tileid": 42,
|
| 471 |
+
"wangid": [
|
| 472 |
+
1,
|
| 473 |
+
0,
|
| 474 |
+
1,
|
| 475 |
+
0,
|
| 476 |
+
0,
|
| 477 |
+
0,
|
| 478 |
+
1,
|
| 479 |
+
0
|
| 480 |
+
]
|
| 481 |
+
},
|
| 482 |
+
{
|
| 483 |
+
"tileid": 43,
|
| 484 |
+
"wangid": [
|
| 485 |
+
1,
|
| 486 |
+
0,
|
| 487 |
+
0,
|
| 488 |
+
0,
|
| 489 |
+
0,
|
| 490 |
+
0,
|
| 491 |
+
1,
|
| 492 |
+
0
|
| 493 |
+
]
|
| 494 |
+
},
|
| 495 |
+
{
|
| 496 |
+
"tileid": 44,
|
| 497 |
+
"wangid": [
|
| 498 |
+
1,
|
| 499 |
+
1,
|
| 500 |
+
1,
|
| 501 |
+
0,
|
| 502 |
+
1,
|
| 503 |
+
0,
|
| 504 |
+
0,
|
| 505 |
+
0
|
| 506 |
+
]
|
| 507 |
+
},
|
| 508 |
+
{
|
| 509 |
+
"tileid": 45,
|
| 510 |
+
"wangid": [
|
| 511 |
+
1,
|
| 512 |
+
1,
|
| 513 |
+
1,
|
| 514 |
+
1,
|
| 515 |
+
1,
|
| 516 |
+
0,
|
| 517 |
+
1,
|
| 518 |
+
1
|
| 519 |
+
]
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"tileid": 46,
|
| 523 |
+
"wangid": [
|
| 524 |
+
1,
|
| 525 |
+
1,
|
| 526 |
+
1,
|
| 527 |
+
0,
|
| 528 |
+
1,
|
| 529 |
+
1,
|
| 530 |
+
1,
|
| 531 |
+
1
|
| 532 |
+
]
|
| 533 |
+
},
|
| 534 |
+
{
|
| 535 |
+
"tileid": 47,
|
| 536 |
+
"wangid": [
|
| 537 |
+
1,
|
| 538 |
+
0,
|
| 539 |
+
0,
|
| 540 |
+
0,
|
| 541 |
+
1,
|
| 542 |
+
0,
|
| 543 |
+
1,
|
| 544 |
+
1
|
| 545 |
+
]
|
| 546 |
+
},
|
| 547 |
+
{
|
| 548 |
+
"tileid": 48,
|
| 549 |
+
"wangid": [
|
| 550 |
+
1,
|
| 551 |
+
1,
|
| 552 |
+
1,
|
| 553 |
+
1,
|
| 554 |
+
1,
|
| 555 |
+
0,
|
| 556 |
+
1,
|
| 557 |
+
0
|
| 558 |
+
]
|
| 559 |
+
},
|
| 560 |
+
{
|
| 561 |
+
"tileid": 49,
|
| 562 |
+
"wangid": [
|
| 563 |
+
1,
|
| 564 |
+
1,
|
| 565 |
+
1,
|
| 566 |
+
1,
|
| 567 |
+
1,
|
| 568 |
+
1,
|
| 569 |
+
1,
|
| 570 |
+
1
|
| 571 |
+
]
|
| 572 |
+
},
|
| 573 |
+
{
|
| 574 |
+
"tileid": 50,
|
| 575 |
+
"wangid": [
|
| 576 |
+
1,
|
| 577 |
+
0,
|
| 578 |
+
1,
|
| 579 |
+
1,
|
| 580 |
+
1,
|
| 581 |
+
0,
|
| 582 |
+
1,
|
| 583 |
+
1
|
| 584 |
+
]
|
| 585 |
+
},
|
| 586 |
+
{
|
| 587 |
+
"tileid": 51,
|
| 588 |
+
"wangid": [
|
| 589 |
+
1,
|
| 590 |
+
0,
|
| 591 |
+
0,
|
| 592 |
+
0,
|
| 593 |
+
1,
|
| 594 |
+
1,
|
| 595 |
+
1,
|
| 596 |
+
1
|
| 597 |
+
]
|
| 598 |
+
},
|
| 599 |
+
{
|
| 600 |
+
"tileid": 61,
|
| 601 |
+
"wangid": [
|
| 602 |
+
0,
|
| 603 |
+
0,
|
| 604 |
+
1,
|
| 605 |
+
0,
|
| 606 |
+
0,
|
| 607 |
+
0,
|
| 608 |
+
0,
|
| 609 |
+
0
|
| 610 |
+
]
|
| 611 |
+
},
|
| 612 |
+
{
|
| 613 |
+
"tileid": 62,
|
| 614 |
+
"wangid": [
|
| 615 |
+
0,
|
| 616 |
+
0,
|
| 617 |
+
1,
|
| 618 |
+
0,
|
| 619 |
+
0,
|
| 620 |
+
0,
|
| 621 |
+
1,
|
| 622 |
+
0
|
| 623 |
+
]
|
| 624 |
+
},
|
| 625 |
+
{
|
| 626 |
+
"tileid": 63,
|
| 627 |
+
"wangid": [
|
| 628 |
+
0,
|
| 629 |
+
0,
|
| 630 |
+
0,
|
| 631 |
+
0,
|
| 632 |
+
0,
|
| 633 |
+
0,
|
| 634 |
+
1,
|
| 635 |
+
0
|
| 636 |
+
]
|
| 637 |
+
},
|
| 638 |
+
{
|
| 639 |
+
"tileid": 64,
|
| 640 |
+
"wangid": [
|
| 641 |
+
1,
|
| 642 |
+
0,
|
| 643 |
+
1,
|
| 644 |
+
0,
|
| 645 |
+
1,
|
| 646 |
+
1,
|
| 647 |
+
1,
|
| 648 |
+
0
|
| 649 |
+
]
|
| 650 |
+
},
|
| 651 |
+
{
|
| 652 |
+
"tileid": 65,
|
| 653 |
+
"wangid": [
|
| 654 |
+
1,
|
| 655 |
+
1,
|
| 656 |
+
1,
|
| 657 |
+
0,
|
| 658 |
+
0,
|
| 659 |
+
0,
|
| 660 |
+
1,
|
| 661 |
+
0
|
| 662 |
+
]
|
| 663 |
+
},
|
| 664 |
+
{
|
| 665 |
+
"tileid": 66,
|
| 666 |
+
"wangid": [
|
| 667 |
+
1,
|
| 668 |
+
0,
|
| 669 |
+
1,
|
| 670 |
+
0,
|
| 671 |
+
0,
|
| 672 |
+
0,
|
| 673 |
+
1,
|
| 674 |
+
1
|
| 675 |
+
]
|
| 676 |
+
},
|
| 677 |
+
{
|
| 678 |
+
"tileid": 67,
|
| 679 |
+
"wangid": [
|
| 680 |
+
1,
|
| 681 |
+
0,
|
| 682 |
+
1,
|
| 683 |
+
1,
|
| 684 |
+
1,
|
| 685 |
+
0,
|
| 686 |
+
1,
|
| 687 |
+
0
|
| 688 |
+
]
|
| 689 |
+
},
|
| 690 |
+
{
|
| 691 |
+
"tileid": 68,
|
| 692 |
+
"wangid": [
|
| 693 |
+
1,
|
| 694 |
+
1,
|
| 695 |
+
1,
|
| 696 |
+
0,
|
| 697 |
+
0,
|
| 698 |
+
0,
|
| 699 |
+
0,
|
| 700 |
+
0
|
| 701 |
+
]
|
| 702 |
+
},
|
| 703 |
+
{
|
| 704 |
+
"tileid": 69,
|
| 705 |
+
"wangid": [
|
| 706 |
+
1,
|
| 707 |
+
1,
|
| 708 |
+
1,
|
| 709 |
+
0,
|
| 710 |
+
0,
|
| 711 |
+
0,
|
| 712 |
+
1,
|
| 713 |
+
1
|
| 714 |
+
]
|
| 715 |
+
},
|
| 716 |
+
{
|
| 717 |
+
"tileid": 70,
|
| 718 |
+
"wangid": [
|
| 719 |
+
1,
|
| 720 |
+
1,
|
| 721 |
+
1,
|
| 722 |
+
0,
|
| 723 |
+
1,
|
| 724 |
+
0,
|
| 725 |
+
1,
|
| 726 |
+
1
|
| 727 |
+
]
|
| 728 |
+
},
|
| 729 |
+
{
|
| 730 |
+
"tileid": 71,
|
| 731 |
+
"wangid": [
|
| 732 |
+
1,
|
| 733 |
+
0,
|
| 734 |
+
0,
|
| 735 |
+
0,
|
| 736 |
+
0,
|
| 737 |
+
0,
|
| 738 |
+
1,
|
| 739 |
+
1
|
| 740 |
+
]
|
| 741 |
+
},
|
| 742 |
+
{
|
| 743 |
+
"tileid": 92,
|
| 744 |
+
"wangid": [
|
| 745 |
+
0,
|
| 746 |
+
0,
|
| 747 |
+
1,
|
| 748 |
+
1,
|
| 749 |
+
1,
|
| 750 |
+
1,
|
| 751 |
+
1,
|
| 752 |
+
0
|
| 753 |
+
]
|
| 754 |
+
},
|
| 755 |
+
{
|
| 756 |
+
"tileid": 93,
|
| 757 |
+
"wangid": [
|
| 758 |
+
0,
|
| 759 |
+
0,
|
| 760 |
+
1,
|
| 761 |
+
1,
|
| 762 |
+
1,
|
| 763 |
+
1,
|
| 764 |
+
1,
|
| 765 |
+
0
|
| 766 |
+
]
|
| 767 |
+
},
|
| 768 |
+
{
|
| 769 |
+
"tileid": 94,
|
| 770 |
+
"wangid": [
|
| 771 |
+
0,
|
| 772 |
+
0,
|
| 773 |
+
1,
|
| 774 |
+
1,
|
| 775 |
+
1,
|
| 776 |
+
1,
|
| 777 |
+
1,
|
| 778 |
+
0
|
| 779 |
+
]
|
| 780 |
+
},
|
| 781 |
+
{
|
| 782 |
+
"tileid": 95,
|
| 783 |
+
"wangid": [
|
| 784 |
+
0,
|
| 785 |
+
0,
|
| 786 |
+
1,
|
| 787 |
+
1,
|
| 788 |
+
1,
|
| 789 |
+
1,
|
| 790 |
+
1,
|
| 791 |
+
0
|
| 792 |
+
]
|
| 793 |
+
},
|
| 794 |
+
{
|
| 795 |
+
"tileid": 112,
|
| 796 |
+
"wangid": [
|
| 797 |
+
0,
|
| 798 |
+
0,
|
| 799 |
+
1,
|
| 800 |
+
1,
|
| 801 |
+
1,
|
| 802 |
+
1,
|
| 803 |
+
1,
|
| 804 |
+
0
|
| 805 |
+
]
|
| 806 |
+
},
|
| 807 |
+
{
|
| 808 |
+
"tileid": 113,
|
| 809 |
+
"wangid": [
|
| 810 |
+
0,
|
| 811 |
+
0,
|
| 812 |
+
1,
|
| 813 |
+
1,
|
| 814 |
+
1,
|
| 815 |
+
1,
|
| 816 |
+
1,
|
| 817 |
+
0
|
| 818 |
+
]
|
| 819 |
+
},
|
| 820 |
+
{
|
| 821 |
+
"tileid": 114,
|
| 822 |
+
"wangid": [
|
| 823 |
+
0,
|
| 824 |
+
0,
|
| 825 |
+
1,
|
| 826 |
+
1,
|
| 827 |
+
1,
|
| 828 |
+
1,
|
| 829 |
+
1,
|
| 830 |
+
0
|
| 831 |
+
]
|
| 832 |
+
},
|
| 833 |
+
{
|
| 834 |
+
"tileid": 115,
|
| 835 |
+
"wangid": [
|
| 836 |
+
0,
|
| 837 |
+
0,
|
| 838 |
+
1,
|
| 839 |
+
1,
|
| 840 |
+
1,
|
| 841 |
+
1,
|
| 842 |
+
1,
|
| 843 |
+
0
|
| 844 |
+
]
|
| 845 |
+
},
|
| 846 |
+
{
|
| 847 |
+
"tileid": 132,
|
| 848 |
+
"wangid": [
|
| 849 |
+
1,
|
| 850 |
+
1,
|
| 851 |
+
1,
|
| 852 |
+
1,
|
| 853 |
+
1,
|
| 854 |
+
1,
|
| 855 |
+
1,
|
| 856 |
+
1
|
| 857 |
+
]
|
| 858 |
+
},
|
| 859 |
+
{
|
| 860 |
+
"tileid": 133,
|
| 861 |
+
"wangid": [
|
| 862 |
+
1,
|
| 863 |
+
1,
|
| 864 |
+
1,
|
| 865 |
+
1,
|
| 866 |
+
1,
|
| 867 |
+
1,
|
| 868 |
+
1,
|
| 869 |
+
1
|
| 870 |
+
]
|
| 871 |
+
},
|
| 872 |
+
{
|
| 873 |
+
"tileid": 134,
|
| 874 |
+
"wangid": [
|
| 875 |
+
1,
|
| 876 |
+
1,
|
| 877 |
+
1,
|
| 878 |
+
1,
|
| 879 |
+
1,
|
| 880 |
+
1,
|
| 881 |
+
1,
|
| 882 |
+
1
|
| 883 |
+
]
|
| 884 |
+
},
|
| 885 |
+
{
|
| 886 |
+
"tileid": 135,
|
| 887 |
+
"wangid": [
|
| 888 |
+
1,
|
| 889 |
+
1,
|
| 890 |
+
1,
|
| 891 |
+
1,
|
| 892 |
+
1,
|
| 893 |
+
1,
|
| 894 |
+
1,
|
| 895 |
+
1
|
| 896 |
+
]
|
| 897 |
+
}
|
| 898 |
+
]
|
| 899 |
+
}
|
| 900 |
+
]
|
| 901 |
+
}
|
assets/klc/maptiles.png
ADDED
|
assets/klc/solid.png
ADDED
|
game.js
CHANGED
|
@@ -10,14 +10,18 @@
|
|
| 10 |
const MAP_H = 35;
|
| 11 |
const WORLD_W = MAP_W * TILE;
|
| 12 |
const WORLD_H = MAP_H * TILE;
|
|
|
|
| 13 |
const view = { w: canvas.width, h: canvas.height };
|
| 14 |
const keys = new Set();
|
| 15 |
const image = (src) => { const img = new Image(); img.src = src; return img; };
|
| 16 |
const sprites = {
|
| 17 |
hero: image('assets/klc/midi-ow.png'),
|
| 18 |
bug: image('assets/klc/pillbug.png'),
|
| 19 |
-
grass: image('assets/klc/ts-grass.png'),
|
| 20 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
let state;
|
| 23 |
let lastTime = 0;
|
|
@@ -26,6 +30,7 @@
|
|
| 26 |
let swingTimer = 0;
|
| 27 |
let hurtFlash = 0;
|
| 28 |
let seed = 412907;
|
|
|
|
| 29 |
|
| 30 |
function random() {
|
| 31 |
seed = (seed * 1664525 + 1013904223) >>> 0;
|
|
@@ -37,6 +42,107 @@
|
|
| 37 |
return n - Math.floor(n);
|
| 38 |
}
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
function makeWorld() {
|
| 41 |
seed = 412907;
|
| 42 |
const obstacles = [];
|
|
@@ -81,7 +187,7 @@
|
|
| 81 |
enemies.push({ id: i, x: tx * TILE + 23, y: ty * TILE + 25, hp: 2, maxHp: 2, alive: true, cooldown: 0, phase: random() * 6, boss: false });
|
| 82 |
}
|
| 83 |
|
| 84 |
-
return { obstacles, props, enemies, water, temple
|
| 85 |
}
|
| 86 |
|
| 87 |
function reset() {
|
|
@@ -134,10 +240,17 @@
|
|
| 134 |
return state.obstacles.some((o) => o.x === tx && o.y === ty);
|
| 135 |
}
|
| 136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
function canStand(x, y) {
|
| 138 |
const r = 11;
|
| 139 |
if (x < TILE * 2 + r || y < TILE * 2 + r || x > WORLD_W - TILE * 2 - r || y > WORLD_H - TILE * 2 - r) return false;
|
| 140 |
if (isSolid(x - r, y) || isSolid(x + r, y) || isSolid(x, y - r) || isSolid(x, y + r)) return false;
|
|
|
|
| 141 |
for (const p of state.props) if (p.type === 'tree' && Math.hypot(x - (p.x + .5) * TILE, y - (p.y + .66) * TILE) < 21) return false;
|
| 142 |
return true;
|
| 143 |
}
|
|
@@ -336,60 +449,18 @@
|
|
| 336 |
updateObjective();
|
| 337 |
}
|
| 338 |
|
| 339 |
-
function tile(ctx2, sx, sy, dx, dy, sw = 24, sh = 24, size = TILE) {
|
| 340 |
-
if (sprites.grass.complete && sprites.grass.naturalWidth >= sx + sw && sprites.grass.naturalHeight >= sy + sh) {
|
| 341 |
-
ctx2.drawImage(sprites.grass, sx, sy, sw, sh, dx, dy, size, size);
|
| 342 |
-
}
|
| 343 |
-
}
|
| 344 |
-
|
| 345 |
function drawGround(camX, camY) {
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
const y1 = Math.min(MAP_H, Math.ceil((camY + view.h) / TILE) + 1);
|
| 350 |
-
const greens = ['#467448', '#49794a', '#456e43', '#4b7748'];
|
| 351 |
-
for (let y = y0; y < y1; y++) {
|
| 352 |
-
for (let x = x0; x < x1; x++) {
|
| 353 |
-
const px = x * TILE - camX;
|
| 354 |
-
const py = y * TILE - camY;
|
| 355 |
-
const n = noise(x, y);
|
| 356 |
-
ctx.fillStyle = greens[Math.floor(n * greens.length)];
|
| 357 |
-
ctx.fillRect(px, py, TILE, TILE);
|
| 358 |
-
ctx.fillStyle = '#263c2925';
|
| 359 |
-
ctx.fillRect(px + 3 + n * 17, py + 5 + noise(y, x) * 23, 2, 4);
|
| 360 |
-
ctx.fillStyle = '#bad07927';
|
| 361 |
-
ctx.fillRect(px + 27 + noise(x + 8, y) * 12, py + 26 + n * 11, 2, 3);
|
| 362 |
-
}
|
| 363 |
-
}
|
| 364 |
-
for (const [i, d] of state.deco.entries()) {
|
| 365 |
-
if (d.x * TILE < camX - TILE || d.x * TILE > camX + view.w || d.y * TILE < camY - TILE || d.y * TILE > camY + view.h) continue;
|
| 366 |
-
const x = d.x * TILE - camX + 10 + noise(d.x, d.y) * 24;
|
| 367 |
-
const y = d.y * TILE - camY + 9 + noise(d.y + 4, d.x) * 25;
|
| 368 |
-
ctx.fillStyle = d.variant === 0 ? '#b0bd615e' : d.variant === 1 ? '#dae29650' : '#7caa565a';
|
| 369 |
-
ctx.fillRect(Math.round(x), Math.round(y), 3, 4);
|
| 370 |
-
ctx.fillRect(Math.round(x + 4), Math.round(y - 3), 2, 3);
|
| 371 |
-
// Use individual, reusable flower tiles from the Kyrodian Legends atlas.
|
| 372 |
-
if (sprites.grass.complete && sprites.grass.naturalWidth >= 480 && d.variant === 0 && i % 3 === 0) {
|
| 373 |
-
const cells = [[360, 144], [384, 144], [408, 144], [432, 144], [456, 144], [360, 168], [384, 168], [408, 168], [432, 168], [456, 168]];
|
| 374 |
-
const [sx, sy] = cells[Math.floor(noise(d.x, d.y + 11) * cells.length)];
|
| 375 |
-
ctx.drawImage(sprites.grass, sx, sy, 24, 24, Math.round(x - 8), Math.round(y - 9), 24, 24);
|
| 376 |
-
}
|
| 377 |
-
}
|
| 378 |
-
drawWater(camX, camY);
|
| 379 |
-
}
|
| 380 |
-
|
| 381 |
-
function drawWater(camX, camY) {
|
| 382 |
-
const w = state.water;
|
| 383 |
-
for (let y = w.y; y < w.y + w.h; y++) for (let x = w.x; x < w.x + w.w; x++) {
|
| 384 |
-
const px = x * TILE - camX;
|
| 385 |
-
const py = y * TILE - camY;
|
| 386 |
-
ctx.fillStyle = '#446d67'; ctx.fillRect(px, py, TILE, TILE);
|
| 387 |
-
ctx.fillStyle = '#638c7d'; ctx.fillRect(px + 4, py + 8 + Math.sin(state.time * 1.7 + x * 1.8) * 3, 16, 2);
|
| 388 |
-
ctx.fillStyle = '#92ae92'; ctx.fillRect(px + 24, py + 28 + Math.sin(state.time + y) * 3, 11, 2);
|
| 389 |
-
ctx.fillStyle = '#74917b'; ctx.fillRect(px + 36, py + 15, 5, 2);
|
| 390 |
}
|
| 391 |
-
ctx.fillStyle = '#
|
| 392 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
}
|
| 394 |
|
| 395 |
function drawTree(x, y, variant, camX, camY) {
|
|
@@ -495,7 +566,6 @@
|
|
| 495 |
}
|
| 496 |
|
| 497 |
function draw(camX, camY) {
|
| 498 |
-
ctx.fillStyle = '#263b2b'; ctx.fillRect(0, 0, view.w, view.h);
|
| 499 |
drawGround(camX, camY);
|
| 500 |
const objects = [];
|
| 501 |
for (const prop of state.props) objects.push({ y: (prop.y + .8) * TILE, draw: () => prop.type === 'tree' ? drawTree(prop.x, prop.y, prop.variant, camX, camY) : drawRock(prop.x, prop.y, camX, camY) });
|
|
@@ -598,6 +668,7 @@
|
|
| 598 |
button.addEventListener('lostpointercapture', up);
|
| 599 |
});
|
| 600 |
|
|
|
|
| 601 |
reset();
|
| 602 |
requestAnimationFrame(loop);
|
| 603 |
})();
|
|
|
|
| 10 |
const MAP_H = 35;
|
| 11 |
const WORLD_W = MAP_W * TILE;
|
| 12 |
const WORLD_H = MAP_H * TILE;
|
| 13 |
+
const LAKE = { x: 20.5 * TILE, y: 14 * TILE, rx: 3.25 * TILE, ry: 2.05 * TILE };
|
| 14 |
const view = { w: canvas.width, h: canvas.height };
|
| 15 |
const keys = new Set();
|
| 16 |
const image = (src) => { const img = new Image(); img.src = src; return img; };
|
| 17 |
const sprites = {
|
| 18 |
hero: image('assets/klc/midi-ow.png'),
|
| 19 |
bug: image('assets/klc/pillbug.png'),
|
|
|
|
| 20 |
};
|
| 21 |
+
const terrain = document.createElement('canvas');
|
| 22 |
+
terrain.width = WORLD_W;
|
| 23 |
+
terrain.height = WORLD_H;
|
| 24 |
+
const terrainCtx = terrain.getContext('2d');
|
| 25 |
|
| 26 |
let state;
|
| 27 |
let lastTime = 0;
|
|
|
|
| 30 |
let swingTimer = 0;
|
| 31 |
let hurtFlash = 0;
|
| 32 |
let seed = 412907;
|
| 33 |
+
let terrainReady = false;
|
| 34 |
|
| 35 |
function random() {
|
| 36 |
seed = (seed * 1664525 + 1013904223) >>> 0;
|
|
|
|
| 42 |
return n - Math.floor(n);
|
| 43 |
}
|
| 44 |
|
| 45 |
+
function fieldNoise(x, y) {
|
| 46 |
+
const x0 = Math.floor(x), y0 = Math.floor(y);
|
| 47 |
+
const smoothX = (x - x0) ** 2 * (3 - 2 * (x - x0));
|
| 48 |
+
const smoothY = (y - y0) ** 2 * (3 - 2 * (y - y0));
|
| 49 |
+
const top = noise(x0, y0) * (1 - smoothX) + noise(x0 + 1, y0) * smoothX;
|
| 50 |
+
const bottom = noise(x0, y0 + 1) * (1 - smoothX) + noise(x0 + 1, y0 + 1) * smoothX;
|
| 51 |
+
return top * (1 - smoothY) + bottom * smoothY;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
function makeTerrain() {
|
| 55 |
+
// A single, connected, genuinely top-down grassy meadow. Generate subtle
|
| 56 |
+
// smooth colour variation first; there's no per-cell fill or visible grid.
|
| 57 |
+
const texture = document.createElement('canvas');
|
| 58 |
+
texture.width = 480;
|
| 59 |
+
texture.height = 336;
|
| 60 |
+
const tctx = texture.getContext('2d');
|
| 61 |
+
const pixels = tctx.createImageData(texture.width, texture.height);
|
| 62 |
+
for (let y = 0; y < texture.height; y++) {
|
| 63 |
+
for (let x = 0; x < texture.width; x++) {
|
| 64 |
+
// Layered smooth noise gives the whole landscape natural, connected
|
| 65 |
+
// colour changes without the checkerboard seams of independently
|
| 66 |
+
// coloured map tiles or pinprick noise that looks like clutter.
|
| 67 |
+
const broad = (fieldNoise(x / 62, y / 45) - .5) * 9;
|
| 68 |
+
const middle = (fieldNoise(x / 24, y / 19) - .5) * 5;
|
| 69 |
+
const fine = (fieldNoise(x / 9, y / 7) - .5) * 2;
|
| 70 |
+
const base = broad + middle + fine;
|
| 71 |
+
const i = (y * texture.width + x) * 4;
|
| 72 |
+
pixels.data[i] = Math.round(70 + base);
|
| 73 |
+
pixels.data[i + 1] = Math.round(114 + base);
|
| 74 |
+
pixels.data[i + 2] = Math.round(68 + base * .58);
|
| 75 |
+
pixels.data[i + 3] = 255;
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
tctx.putImageData(pixels, 0, 0);
|
| 79 |
+
|
| 80 |
+
const ground = terrainCtx;
|
| 81 |
+
ground.clearRect(0, 0, WORLD_W, WORLD_H);
|
| 82 |
+
ground.imageSmoothingEnabled = true;
|
| 83 |
+
ground.drawImage(texture, 0, 0, WORLD_W, WORLD_H);
|
| 84 |
+
|
| 85 |
+
ground.imageSmoothingEnabled = true;
|
| 86 |
+
ground.drawImage(texture, 0, 0, WORLD_W, WORLD_H);
|
| 87 |
+
|
| 88 |
+
// Shape one natural, gently irregular lake in the same ground bitmap.
|
| 89 |
+
// Dark bank, soft reeds and a smooth water fill make a single connected
|
| 90 |
+
// landscape feature rather than unjoined square water/shore tiles.
|
| 91 |
+
const shoreline = (rx, ry) => {
|
| 92 |
+
ground.beginPath();
|
| 93 |
+
for (let i = 0; i <= 144; i++) {
|
| 94 |
+
const angle = (i / 144) * Math.PI * 2;
|
| 95 |
+
const warp = 1 + Math.sin(angle * 3 + .6) * .009 + Math.sin(angle * 7 + 1.9) * .004;
|
| 96 |
+
const px = LAKE.x + Math.cos(angle) * rx * warp;
|
| 97 |
+
const py = LAKE.y + Math.sin(angle) * ry * warp;
|
| 98 |
+
if (i === 0) ground.moveTo(px, py); else ground.lineTo(px, py);
|
| 99 |
+
}
|
| 100 |
+
ground.closePath();
|
| 101 |
+
};
|
| 102 |
+
shoreline(LAKE.rx + 21, LAKE.ry + 17);
|
| 103 |
+
ground.fillStyle = '#5c8051';
|
| 104 |
+
ground.fill();
|
| 105 |
+
shoreline(LAKE.rx + 12, LAKE.ry + 10);
|
| 106 |
+
ground.fillStyle = '#6d9257';
|
| 107 |
+
ground.fill();
|
| 108 |
+
shoreline(LAKE.rx, LAKE.ry);
|
| 109 |
+
const water = ground.createLinearGradient(0, LAKE.y - LAKE.ry, 0, LAKE.y + LAKE.ry);
|
| 110 |
+
water.addColorStop(0, '#729986');
|
| 111 |
+
water.addColorStop(.22, '#5d887b');
|
| 112 |
+
water.addColorStop(.75, '#46756f');
|
| 113 |
+
water.addColorStop(1, '#385f5e');
|
| 114 |
+
ground.fillStyle = water;
|
| 115 |
+
ground.fill();
|
| 116 |
+
|
| 117 |
+
const marsh = [
|
| 118 |
+
[-1.25, -.72], [-.68, -1.34], [.53, -1.29], [1.12, -.83],
|
| 119 |
+
[1.2, -.06], [1.02, .7], [.43, 1.28], [-.72, 1.1], [-1.23, .52],
|
| 120 |
+
];
|
| 121 |
+
for (const [dx, dy] of marsh) {
|
| 122 |
+
const reedX = LAKE.x + dx * LAKE.rx;
|
| 123 |
+
const reedY = LAKE.y + dy * LAKE.ry;
|
| 124 |
+
if (Math.abs(dx) > 1.16 || Math.abs(dy) > 1.24) continue;
|
| 125 |
+
ground.fillStyle = '#75854f';
|
| 126 |
+
ground.fillRect(Math.round(reedX), Math.round(reedY), 5, 3);
|
| 127 |
+
ground.fillStyle = '#8c9759';
|
| 128 |
+
ground.fillRect(Math.round(reedX - 2), Math.round(reedY - 2), 3, 4);
|
| 129 |
+
ground.fillRect(Math.round(reedX + 3), Math.round(reedY - 3), 3, 4);
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
// Scattered tiny wave accents are contained within the water itself.
|
| 133 |
+
ground.save();
|
| 134 |
+
shoreline(LAKE.rx - 2, LAKE.ry - 2);
|
| 135 |
+
ground.clip();
|
| 136 |
+
for (let i = 0; i < 14; i++) {
|
| 137 |
+
const x = LAKE.x + (noise(i + 58, 63) - .5) * LAKE.rx * 1.6;
|
| 138 |
+
const y = LAKE.y + (noise(i + 85, 47) - .5) * LAKE.ry * 1.25;
|
| 139 |
+
ground.fillStyle = i % 3 === 0 ? '#a0bb8c42' : '#7fac9342';
|
| 140 |
+
ground.fillRect(Math.round(x), Math.round(y), 9 + i % 4 * 3, 1);
|
| 141 |
+
}
|
| 142 |
+
ground.restore();
|
| 143 |
+
terrainReady = true;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
function makeWorld() {
|
| 147 |
seed = 412907;
|
| 148 |
const obstacles = [];
|
|
|
|
| 187 |
enemies.push({ id: i, x: tx * TILE + 23, y: ty * TILE + 25, hp: 2, maxHp: 2, alive: true, cooldown: 0, phase: random() * 6, boss: false });
|
| 188 |
}
|
| 189 |
|
| 190 |
+
return { obstacles, props, enemies, water, temple };
|
| 191 |
}
|
| 192 |
|
| 193 |
function reset() {
|
|
|
|
| 240 |
return state.obstacles.some((o) => o.x === tx && o.y === ty);
|
| 241 |
}
|
| 242 |
|
| 243 |
+
function isLake(x, y) {
|
| 244 |
+
const dx = (x - LAKE.x) / (LAKE.rx + 2);
|
| 245 |
+
const dy = (y - LAKE.y) / (LAKE.ry + 2);
|
| 246 |
+
return dx * dx + dy * dy < 1;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
function canStand(x, y) {
|
| 250 |
const r = 11;
|
| 251 |
if (x < TILE * 2 + r || y < TILE * 2 + r || x > WORLD_W - TILE * 2 - r || y > WORLD_H - TILE * 2 - r) return false;
|
| 252 |
if (isSolid(x - r, y) || isSolid(x + r, y) || isSolid(x, y - r) || isSolid(x, y + r)) return false;
|
| 253 |
+
if ([[-r,0],[r,0],[0,-r],[0,r]].some(([dx,dy]) => isLake(x + dx, y + dy))) return false;
|
| 254 |
for (const p of state.props) if (p.type === 'tree' && Math.hypot(x - (p.x + .5) * TILE, y - (p.y + .66) * TILE) < 21) return false;
|
| 255 |
return true;
|
| 256 |
}
|
|
|
|
| 449 |
updateObjective();
|
| 450 |
}
|
| 451 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 452 |
function drawGround(camX, camY) {
|
| 453 |
+
if (terrainReady) {
|
| 454 |
+
ctx.drawImage(terrain, camX, camY, view.w, view.h, 0, 0, view.w, view.h);
|
| 455 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 456 |
}
|
| 457 |
+
ctx.fillStyle = '#477248';
|
| 458 |
+
ctx.fillRect(0, 0, view.w, view.h);
|
| 459 |
+
const lake = { x: LAKE.x - camX, y: LAKE.y - camY };
|
| 460 |
+
ctx.fillStyle = '#587b4d';
|
| 461 |
+
ctx.beginPath(); ctx.ellipse(lake.x, lake.y, LAKE.rx + 13, LAKE.ry + 11, 0, 0, Math.PI * 2); ctx.fill();
|
| 462 |
+
ctx.fillStyle = '#557e75';
|
| 463 |
+
ctx.beginPath(); ctx.ellipse(lake.x, lake.y, LAKE.rx, LAKE.ry, 0, 0, Math.PI * 2); ctx.fill();
|
| 464 |
}
|
| 465 |
|
| 466 |
function drawTree(x, y, variant, camX, camY) {
|
|
|
|
| 566 |
}
|
| 567 |
|
| 568 |
function draw(camX, camY) {
|
|
|
|
| 569 |
drawGround(camX, camY);
|
| 570 |
const objects = [];
|
| 571 |
for (const prop of state.props) objects.push({ y: (prop.y + .8) * TILE, draw: () => prop.type === 'tree' ? drawTree(prop.x, prop.y, prop.variant, camX, camY) : drawRock(prop.x, prop.y, camX, camY) });
|
|
|
|
| 668 |
button.addEventListener('lostpointercapture', up);
|
| 669 |
});
|
| 670 |
|
| 671 |
+
makeTerrain();
|
| 672 |
reset();
|
| 673 |
requestAnimationFrame(loop);
|
| 674 |
})();
|
index.html
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
<meta name="theme-color" content="#101d18">
|
| 7 |
<meta name="description" content="走過星火之森、擊退魔物、收集星火碎片,挑戰北方的魔王。">
|
| 8 |
<title>星火之森 — 一場像素 RPG 冒險</title>
|
|
|
|
| 9 |
<link rel="stylesheet" href="style.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 6 |
<meta name="theme-color" content="#101d18">
|
| 7 |
<meta name="description" content="走過星火之森、擊退魔物、收集星火碎片,挑戰北方的魔王。">
|
| 8 |
<title>星火之森 — 一場像素 RPG 冒險</title>
|
| 9 |
+
<link rel="icon" href="data:,">
|
| 10 |
<link rel="stylesheet" href="style.css">
|
| 11 |
</head>
|
| 12 |
<body>
|