-
Notifications
You must be signed in to change notification settings - Fork 26
/
aa.js
executable file
·417 lines (338 loc) · 29.4 KB
/
aa.js
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
'use strict';
/* global soundManager */
/*
████▙ ▀████▌████▙ ▀█████ █████▀ ▄██████▄ ▀████▌████▙ ████▙ ▀█████▀ ▀█████▀ ▀████▐███▋▀█████▀ ▀█████▀ TM
▄██▀ ▕█████▏ ████▌ ████▌ ▐████▌ ████▌ ████▎▐███▊ ████▌ ████▌ █████▏ █████ █████ ████ ▝██▋ ▝████ ▐███▘
▄█▀ ▐▐████▎ ████▌ ████▙ █████ ▌████▌▐███▊ ████▏████▌ ████▙ ▐▐████▎ █████ █████ ████ ▝▋ ▝███▙ ▗███▘
▄████▄▄▄▄▄▄▄▄▄ █▀▄▄▄▄▄▄▄▄▄▄▄ █▌████▋ ████▌▗████▘ ▌█████▌████▌████▊ ████▌████▌▗████▘ █▌████▋ █████ █████ ████ ▗█▌ ▝███▙▝█▘
▄█████▄▄▄▄ ▀▀▀ ▐█▌▐████ ████▌████▘ ▌█████▌████▌████▊ ████▌████▌████▘ ▐█▌▐████ █████ █████ ████▐██▌ ▐████▌
▄ ▄████████████████▄ ██ ▄████▎ ████▌▝███▙ █▐████ ████▌████▊ ████▌████▌▝███▙ ██ ▄████▎ █████ █████ ████ ▝█▌ ▐████▌
██ ▀████████████████████▄ ▐█▌██████▌ ████▌ ████▌ ▕█ ███▌ ████▌▐███▊ ████ ████▌ ████▌ ▐█▌██████▌ █████ ▗▋█████ ▗▋ ████ ▗▋ ▐████▌
▀███ ▄██████████████████████ ███ ▐████ ████▌ ████▌▗▋▐█ ▐██ ████▌ ████▎▐███▊ ████▌ ████▌▗▋ ███ ▐████ █████ ▗██▌█████ ▗██▌ ████ ▗██▌ ▐████▌
████▄▄███████████████████████▀ ▄███▄ ▄████▌▄█████▄▀████▀▄██▄ █▌ ▄█████▄ ▀██████▀ ▄█████▄▀████▀ ▄███▄ ▄████▌▄█████▐████▌█████▌████▌▄████▐███▌ ▄██████▄
████████▀▀▀▀▀▀▀▀████▀█▀▀▀▀█▀
██▀ ██▘▘ ██▘▘
---------------------------------------------
A R M O R A L L E Y :: R E M A S T E R E D
--------- 10th Anniversary Edition ----------
A browser-based interpretation of the Macintosh + MS-DOS releases of Armor Alley.
Original game Copyright (C) 1989 - 1991 Information Access Technologies.
https://en.wikipedia.org/wiki/Armor_alley
Images, text and other portions of the original game used with permission under an ISC license.
Original sound effects could not be re-licensed; modern replacements used from freesound.org.
https://www.schillmania.com/armor-alley/
https://www.schillmania.com/content/entries/2013/armor-alley-web-prototype/
https://github.com/scottschiller/ArmorAlley/
General disclaimer: This is a fun personal side project. The code could be tightened up a bit.
This release: V2.0.20230501
Previous release: V1.6.20220201
Original release: V1.0.20131031
Changelog / Revision History
----------------------------
+ V2.0.20230501: 10th Anniversary "Remastered" Edition
+ Quick video overview (3m 45s): https://youtu.be/oYUCUvg02rY
+ New features
• Mobile / touch screen support. Updated UX / UI, better playability and feature parity vs. desktop. Portrait is playable, but landscape is preferable on smaller screens.
• Network multiplayer, like the original game. PvP, or co-op. Can be played with or against CPU players, as well.
• 22 game levels. 10 original game "campaign" battles, plus 12 levels designed for network games.
• Level editor. Create or modify existing levels. Data stored in URL at present - terrible, I know. Also compatible with network games.
• Optional "Virtual Stupidity" theme pack. 🎸🤘
+ Performance improvements
• Reduced CPU load, in general, across the board between JavaScript execution, layout, and paint / compositing.
• Game Loop: Adjustments to target 30FPS on 120 Hz monitors. [01f9f43]
• Collision "zones", greatly reducing object comparison work and function calls. 20,000 collision checks per second, down to 500 or less. https://twitter.com/schill/status/1627725917345955840
• DOM node pool / recycling: `poolBoy.js` - for things like gunfire and smoke. Less paint / repaint, more GPU compositing. https://twitter.com/schill/status/1628833430988554240
• Reduced variable / object creation in game loop.
• Battlefield DOM node no longer being transformed for scroll; now, only on-screen sprites.
+ Sound
• Even more sound effects.
• Some sounds can use ±5% playback speed for a little variety.
• Sounds can now be heard "in the distance," to the left and right.
• "Virtual Stupidity": 500+ meticulously-picked samples. [21f7726]
+ UX / UI
• "Live Graveyard" feature: decorate the battlefield over time. [032f845]
• "Remastered" 8-bit sprite assets from Armor Alley V1.1 for Macintosh. The original 1.0 and PC-DOS version had up to 4-bit colour.
• Nice home page logo, "scanned" from the combat handbook that came with the original boxed game.
• Network games use Windows 95's `LIGHTS.EXE` taskbar UI showing tx/rx traffic, very important. ;) https://twitter.com/schill/status/1636449071140605958 [17c0a9b]
• Four types of stormy weather: rain, hail, snow, and one other that's a surprise.
• Radar jamming: New visual noise overlay.
• "Extra-fancy" bunker explosions, particles, burning, and smoke effects.
• Nicer bomb explosion on ground. Hat tip: "Dirt Explosion" by SrGrafo on DeviantArt - https://www.deviantart.com/srgrafo/art/Dirt-Explosion-774442026
• "DOMFetti" confetti explosions, colours based on the target being hit.
• Notifications: Verbiage for different actions, e.g., "your tank steamrolled an infantry", or gunfire "popped a balloon" etc.
+ Bug fixes
• Refactor of Traffic Control, so vehicles are less likely to get "stuck" waiting for one another.
• Helicopter bombs could be delayed after key press. They should now be consistent and fire on the next frame.
• Super Bunkers would sometimes stay yellow, even when friendly.
• Additional "arrow signs" on battlefield were missing from bases since 2013. Oops. ;)
• Parachute infantry (dropped from helicopter) no longer get a recycle (reaching end of battlefield) reward.
• Balloon respawning at top of screen: fixed.
• Allow balloons to be moving up or down at init, previously always downward.
• Fixed bomb spark / hidden / bottom-align logic.
• Tighten up inventory ordering / queueing, consistent spacing + avoiding overlapping between sprites.
+ Gameplay
+ Helicopters
• Only the local player's helicopter blinks on the radar; all others are solid, as in the original game.
• Desktop: double-click no longer toggles helicopter auto-rotate feature.
+ Smart Missiles
• Notify user when trying to fire a smart missile, but no eligible targets nearby.
• Smart missiles can now take damage, and plow through up to four infantry (ground units only) before dying.
• Smart Missile targeting refactor. Removed former "missile facing target" requirement. Prefer shortest distance, unless just above ground. Hat tip: Pythagoras. :wink: :triangular_ruler:
• Smart Missiles now target your vertical offset, plus half your height.
• Smart Missiles now blink on launch, and take a moment (0.5 seconds) to arm themselves, and are not as dangerous (1 damage point) until then. This is implemented as the "Ramius frame count" (delay) [1d71faf] - as inspired by "The Hunt For Red October." https://www.youtube.com/watch?v=CgTc3cYaLdo&t=112s
• New feature: Smart Missile "decoy" ability, - about 1/3 of a second to see and retarget a newly-deployed parachute infantry when the initial target was the helicopter. [926b16f]
+ Gunfire
• Gunfire can now collide with gunfire.
• Turret gun firing rates have been reduced significantly for easy + hard levels.
• Gunfire can now ricochet off the roof of a Super Bunker.
• Desktop: Helicopter gunfire now stops when landing on, and cannot start while on a landing pad.
+ Bombs
• Bombs now "pass-thru" infantry, as opposed to dying 1:1.
• Bomb explosions on the ground can now take out larger groups of infantry.
• Bombs can be hit by gunfire in extreme mode.
+ Tanks
• Tanks have finally been given flamethrowsers (as in the original game,) which they use on infantry, engineers, super bunkers and end bunkers. [e3de57e]
• Game preferences refactor. Volume control, UX/UI, and optional gameplay features.
• Enemy tanks fire every 11 frames in "hard" mode, 12 in "easy" (and tutorial), and 10 in "extreme." Previously, all were 10.
• Tanks now repair more incrementally, larger gains every 1 second.
+ Other
• Engineers start repairing bunkers (if enabled) at the doorway, "shielded" by bunker vs. previously standing outside.
• Landing pads can be "The Danger Zone" if enabled in prefs. This was inspired by the 2022 Top Gun movie release. See also: "The Girl From Ipanema, "I Got You Babe," "Mucha Muchacha," and more.
• Base explosions can now also damage units passing by.
• Bases can fire rubber chickens + bananas if "match missile type" enabled in prefs.
• "GOURANGA!" - inspired by the original Grand Theft Auto.
• When the battle is over, the losing team's units all contribute to the explosion party.
+ Technical
• Codebase migration to ES6 modules, patterns and syntax.
• SoundManager 2: hacked-together version of Web Audio API for playback, vs. HTML5. [a44bc81]
• Refactoring of game type and objects system; e.g., `tank` -> `TYPES.tank`, and `game.objects.tanks[]` -> `game.objects.tank[]` so look-ups and interating by type are logical.
• `game.objects.players` now has local, remote, cpu etc., which point to helicopters. Previously, many assumptions were made about `game.objects.helicopters[0]` and `[1]`.
• Network feature uses [PeerJS](https://peerjs.com/) (MIT license) for peer-to-peer communication via WebRTC.
+ Miscellaneous
• It turns out there are _three_ types of cloud sprites in the original game, not two. [4a561c4]
• 12 smoke frames in the original game too, vs. my 9. [53f08aa]
• Nicer ASCII block-character logo.
• Updated favicon + related app / tile images.
----
+ V1.6.20220101: Massive update for 2022, based on work from 2020 + 2021
+ Video oveview
• Demo, features and walk-through of "extreme" mode (55 minutes): https://youtu.be/9BQ62c7u2JM
+ Performance improvements
• The game should be smoother, targeting 30FPS. It is OK full-screen @ 1080p and windowed @ 4K in Chrome on a 2018 Mac Mini, 3.2 GHz 6-core i7 w/Intel UHD Graphics 630 1536 MB.
• More GPU-accelerated rendering, reduced DOM nodes by removing when off-screen (e.g., static terrain items)
• All sprites should be on the GPU and moved using transforms, reducing paint operations
• All transforms (CSS + JS) for positioning + animation are 3d, with the goal of GPU acceleration - e.g., translate3d(), rotate3d(), scale3d()
• DOM nodes are not appended at object create time - now deferred until the object is on-screen for the first time.
• All "sub-sprites" should now be GPU-accelerated via CSS animations, transforms and transitions
• Sound: Only create `Audio()` when actively playing sounds, and destroy when they finish playing. Browsers are starting to limit the number of `Audio()` instances.
• Sound: Queue and play sounds all at once with each animation frame callback, vs. prior ad-hoc behaviour.
• Refactored game tip scroller to only show two nodes at a time, 1024px width vs. 102,400px. Front-end tech / Chrome Dev Tools demo: https://youtu.be/eVW0WgTdK3A
• Performance: Don't update known static radar items: turret, base, bunkers (bunker, end bunker, super bunker) unless marked as "stale" during resize / world scaling
• Performance: CSS / `contentVisibility` to reduce / optimize rendering costs
• Animation loop: improved timing, target 30 fps. Request next frame right away. Exit early if next frame arrives too quickly.
• Turret "scan" is now a CSS animation; previously, animated via JS.
• Smart missiles and helicopter trailers are now GPU-accelerated.
• Performance: Battlefield and radar units are now positioned via transform: translate3d() - no more legacy CSS shenanigans using `bottom: 0px`.
• Memory leak fixes: DOM nodes, audio events, and a few others.
+ Sound
• Over 100 sound assets now in use
• New and updated sound effects: Infantry and engineer gunfire, injury and death, credit +/-, helicopter and turret guns, shell casings on turrets,
bullets hitting the ground, turret being disabled and enabled (restored.)
+ UX / UI
• Proper "game options" modal with radio buttons and checkboxes for various UX/UI and gameplay features
• "It was a dark and stormy night" - option for snow on the battlefield. (May be slow on some computers.)
• Bunkers, balloons and super-bunkers now use graphics from the Macintosh (68K) version of Armor Alley; a bit more orange, and less garish yellow.
• Dune ][-style credit / debit UI and sounds
• Toast-style game notifications
• Health status bars when units are being hit or repaired
• New and improved smoke / particle effects, more explosions and shrapnel, more fun!
• Order queue: Refactored UI to show letters (e.g., MTVIE), with superscript numbers as appropriate.
• Missiles smoke more, and in extreme mode, have a burst of thrust (as in the original game) as they near expiry
• Pseudo-3D effect on shrapnel: Increase size slightly with vertical position on screen
• Ground units are "behind" most terrain elements like trees, bushes etc.
+ Bug fixes
• Bombing floating balloons no longer causes an explosion on the ground
• Improved bomb and shrapnel alignment / collision positioning with balloons, tanks, bunkers, and super-bunkers
• Fixed bug with quickly-respawning balloons (shooting balloon while infantry are passing under bunker, for example.)
• Fixed UI bug where the "incoming missile" white line would not always disappear.
• Game end: Improve alignment of view and base
• Adjusted initial position of game, centering view on the helicopter + base
• Helicopter / super-bunker: Improve vertical alignment if helicopter crashes on superbunker "roof."
• Fixed radar item for Super Bunkers, now shows correct friendly / enemy status.
• Cloud "wind" accelerates / decelerates more smoothly
• Clouds no longer "bounce" when they drift off the end of the world, but get a nice bit of wind to bring them back into view.
• Slight vertical alignment tweaks on gunfire and balloons in radar view.
• Improved orientation of heat-seeking smart missiles (and rubber chickens and bananas) as they track their target
• Tweaked movement and velocity of smart missiles, making them potentially faster / more random
• Enemy helicopter will now turn to face targets. Sometimes it would fire the other way. ;)
• Improved helicopter motion when approaching landing pad - "bounce" has largely been eliminated.
• Improved off-screen / on-screen DOM pruning, restoration of 3D transforms when re-appending DOM elements
• Fixed end-game bug, sometimes ground units (e.g. van) did not appear at base when blowing up.
• Adjusted collision detection: if helicopter is hiding "in" a friendly super-bunker, bombs should hit the roof of the super bunker and not the helicopter.
+ Gameplay
• New weapon: Heat-seeking bananas
• Ground unit "Traffic Control" option: Vehicles try to leave space between, and avoid overlapping each other. Tanks will now "park" behind friendly tanks,
avoiding a pile-up. Tanks normally only stop to fire. Vans and missile launchers will now wait for each other, too. Tanks will not stop for vans or
missile launchers, giving tanks a greater chance of ending up at the front of a convoy - a preferable offensive position.
• Units can now be "recycled" if they cross the battlefield, you are rewarded 2x cost in credits
• Engineers can now steal all funds from enemy bunker
• Engineers can now repair (but not rebuid) friendly bunkers
• Bullets now ricochet off non-friendly super-bunkers
• Shrapnel will ricochet off certain units (tank, super-bunker)
• "Incoming missile" doesn't show in extreme mode when the radar is jammed.
• End base, extreme mode: if a defense missile is destroyed, respawn another within 0.5 seconds.
• Missile launchers trigger when closer to the helicopter, more likely now to be on-screen
• Helicopter respawn: Delay if certain ground units are obstructing the landing pad.
• Enemy helicopter AI: Default 10% of dropping bombs when targeting a tank, subject to game difficulty (hard: 15%, extreme: 25%.)
• Bombs can now collide with smart missiles and take them out
• Tank gunfire only hits bunkers if tanks are shooting at a helicopter, or another tank
(bug fix: previously, tanks could destroy a bunker trying to hit an infantry on the other side.)
• Super bunkers that are un-manned are "neutral" and dangerous to both sides, and will be shown as hostile on the radar.
(This includes when tanks disarm a bunker by firing at it.)
• Bomb trajectory now includes the helicopter's Y-axis velocity, and they now rotate along with their trajectory.
• Helicopters now rise up from the landing pad on game start and respawn, like the original game.
• Helicopter gunfire takes tilt / angle into account.
• Helicopter "shake" starts when health is under 70%, gets worse with damage. This affects gunfire trajectory.
• Your missile launchers only fire at the enemy helicopter when the convoy is "unassisted", e.g., there is no friendly helicopter or turret nearby.
• Extreme mode: If you shoot down the enemy base's smart missiles while near the base, it will launch new ones that are faster and more difficult to dodge.
• While on a landing pad, your gunfire may go over infantry's heads most of the time.
• Don't assume the top of the battlefield is always safe; watch out for balloons!
• Parachute infantry now fall at slightly different rates, and may be affected more by wind
• A few additional, inspirational [ game paused in background ] messages
+ Technical notes: development / code
• Migrated core JavaScript to ES6 syntax, retaining functional + prototypal inheritance style. Slightly less verbose.
• As part of ES6 migration, dropped legacy IE 8 + 9 code and checks: ancient event handlers, lack of transform, `requestAnimationFrame()` polyfill etc.
• Lots of cleanup: Exit early, reduced `if/else` nesting. Dropped all `setTimeout()` calls, moved to a frame-based approach: `setFrameTimeout()`.
• `aa.js` (core game code) is massive at ~450 KB, and seems like a good candidate to be broken up into ES6 modules. TBD.
+ V1.51.20181124
+ Performance tweaks
• More motion / animation is now on the GPU via `transform`, vs. `style.left` / `style.top`.
• Main animation loop calls `requestAnimationFrame()` first, before anything else (like VSYNC.)
• Drop legacy SM2 flash options.
• Turret scan is now driven by CSS animation vs. JS setting an angle transform every frame.
+ Sound
• New base explosion, tweaked other explosion sound effects.
• New "heavy mechanics" bunker chain (repair) sound.
+ V1.5.20180201
+ Big feature updates!
• Game "mostly" now works on mobile devices. Touch-based events for helicopter control, UI for helicopter weapons and inventory / ordering. Tested on iPhone X. Others should work reasonably-well. Hopefully.
• Inventory order queueing! 🎉 (Finally.) e.g., 3 tanks in a row. Queueing deducts funds immediately. No added UI or cancel ability (yet.)
• Battlefield view is now bigger on screen. Stats UI is dead, long live stats.
• Performance improvements. tl;dr: JavaScript tweaks, putting most all sprites onto the GPU. Replaced most common animated .GIF backgrounds with 3d-transform, GPU-accelerated CSS animation-driven sprites. 😅
+ Sound
• No sound for any Safari (desktop or mobile) for now, including version 11.0. Multiple sounds kill performance on desktop, and "auto-play" is effectively blocked on mobile. https://bugs.webkit.org/show_bug.cgi?id=116145
• New + improved helicopter machine gun sounds. 9 different samples, played at random.
• New sound effects: "bomb hatch" (helicopter bomb release), tank gunfire, bunker chain/balloon repair, helicopter gunfire hit.
• "Medals clanking" sound for bunker chain/balloon repair. (BY-NC 3.0.) https://freesound.org/people/Gareth_H/sounds/365799/
• New tank gunfire sound: "Tank Fire Mixed.wav" by Cyberkineticfilms/freesound.org (CC0, "No Rights Reserved". 🙇)
• Hat tip: "Bolo" "tank self hit" sound effect, Copyright (C) Steuart Cheshire 1993. My favourite Mac game of all time. ❤️
+ UX / UI
• "Radar jammed" TV static-like overlay with transform sprite.
• Slightly faster helicopter bombing rate - more responsive.
• Chain refactor. Use fixed height, animate via transform, fall with gravity when balloon and/or bunker are lost.
• Balloons are yellow-ish on radar, and now transform-rotated to elliptical shapes. Bunkers / base color and border tweaks, friendly vs. enemy now look different.
• Inventory and helicopter ammo, etc., become greyed out when unaffordable / unavailable.
• Target / "tracking" animation on Smart Missile targets.
• Smart Missiles can now re-target on the next frame after the original target dies. If a new target can not be immediately acquired, the Smart Missile dies as previously.
• Radar items, clouds and some other sprites move more smoothly simply by dropping `parseInt()`.
• "C" / rubber chicken use causes UI to switch to rubber chicken mode.
• Possible bugfix: If paused and enemy order timer fires, re-start timer. This probably fixes enemy inventory building sometimes breaking.
• Jam radar all the time on hard + extreme game types.
+ Miscellany
• Note re: Firefox `will-change` memory consumption warning that might show in console.
• URL feature flags: `noTranslate3d` and `noRadarGPU`. `frameRate=[60|*]` for testing of `requestAnimationFrame()` timing. camelCase others. Let Opera (now webkit-based) have transforms.
• +`makeTransformSprite()`, a sort of sub-sprite for CSS transform-based animations (GPU-accelerated animated .GIF alternatives.)
• `z-index: -1` can be harmful for performance / compositing.
• iPhone X notch handling based on orientation and whatnot.
+ 12/2017
+ Optimized performance / dropped CPU usage significantly by hiding off-screen elements.
+ Fixed silly blank / empty frame in balloon right -> left animation sequence.
+ Dropped numerous legacy -webkit and -moz prefixes in CSS.
+ DOM Pruning option with offscreen logic
+ 10/2017
+ Fixed up top stats layout in Firefox, Safari, Chrome.
+ Emoji to convey meaning of tutorial, easy, hard, extreme modes.
+ ESLint code clean-up.
+ 09/2015
+ "Extreme" game mode
• Higher enemy convoy production rate.
• Turrets fire at a faster rate.
• Twin enemy turrets near mid-field.
• Turrets fire at ground vehicles and smart missiles. Infantry and engineers are not targeted, but can be hit.
• Owning all bunkers does not halt enemy production.
+ Miscellaneous
• Fix for "negative look-ahead" case - enemy Super Bunker now fires at helicopter on both sides.
• `Math.abs()` checks on distance for missile launchers
• Fixed Bunker and Super Bunker vertical alignment / collision detection with helicopter
• Infantry will not be picked up when the helicopter is on a landing pad and repairing.
• Shrapnel shows on radar.
• Background color fixed on bullet and missile "spark" graphic.
+ 08/2014
+ Sound events / sound effects
• Wrench and related sounds on helicopter repair/refuel, balloon repair, turret claiming/rebuilding/repair
• Violin notes for friendly capture events: bunker, turret etc. (C5). Enemy note is C4.
• "Pop" / "vacuum" sounds for infantry pick up + deployment, and turret restoration
• Door close for passing infantry entering bunkers
• Splat for infantry and engineer kills
• Crash-and-glass for bunker explosions
• Heavy/light impact sounds for bullets hitting metal (tanks) and other structures (bunkers)
• Turrets audibly "break" when destroyed.
+ Game logic / rules
• Turret gunfire can now hit infantry, regular bunkers and Super Bunkers. However, only tank gunfire can hit Super Bunkers for damage.
• For "easy" game mode, turrets now fire at half the previous rate.
+ UI / design
• Arrows on bunkers now animate to the right/left when claimed by friendly/enemy infantry.
+ Miscellaneous
• Sound arrays (i.e., 5 bullet/metal sounds) shuffle on each rotation, reducing chance of repetitiveness.
• Upped turret gunfire sound array, possibly reduce cloning of Audio() in heavy fire cases.
• Infantry build "faster" now, so they are more closely grouped together (in units of five.)
• Shrapnel now rotates using CSS animations, rotation direction determined randomly.
• In tutorial mode, disarm user-armed Super Bunker so it doesn't accidentally kill Missile Launchers that later show up.
• Fixed enemy infantry + engineer die animation to be bottom-aligned.
+ 07/2014
• Safari 7.1 and 8 (OS X 10.10/Yosemite preview) still have HTML5 audio jank bug, thus prefer Flash. https://bugs.webkit.org/show_bug.cgi?id=116145
• Opacity fade on edge of game tips.
• Font legibility tweaks.
+ 04/2014
• "Hard" game option, comparable to original game's level 9.
• Gunfire and shrapnel now shows up on radar.
• Enemy unit production halts when all bunkers are friendly / player-owned.
• Heat-seeking rubber chickens (launched with C key.)
• Turret gunfire can hit tanks, vans and missile launchers in "hard" mode. Protip: Don't approach turrets from low angles.
+ 03/2014
• Added "Super Bunkers" (pillbox bunkers) https://en.wikipedia.org/wiki/Armor_alley#Terrain_elements
*/
const prefsManager = PrefsManager();
const keyboardMonitor = KeyboardMonitor();
let stats;
// used by the "exit [game type]" link
window.aa = {
exit() {
// delete stored preference
utils.storage.remove(prefs.gameType);
}
};
// OGG is available, so MP3 is not required.
soundManager.audioFormats.mp3.required = false;
soundManager.setup({
debugMode: false,
// Audio in Firefox starts breaking up at some number of active sounds, if this is enabled. :/
usePlaybackRate: true,
defaultOptions: {
volume: DEFAULT_VOLUME,
multiShotEvents: true
},
});
if (winloc.match(/mute/i)) {
soundManager.disable();
}
window.addEventListener('DOMContentLoaded', game.initArmorAlley);
// --- THE END ---
import { winloc, DEFAULT_VOLUME } from './core/global.js';
import { utils } from './core/utils.js';
import { game } from './core/Game.js';
import { KeyboardMonitor } from './UI/KeyboardMonitor.js';
import { prefs, PrefsManager } from './UI/preferences.js';
// a few hot globals
export { gameType, screenScale } from './core/Game.js';
export { keyboardMonitor, prefsManager, stats };