Skip to content

Commit 028196b

Browse files
committed
add prettier and service worker
1 parent 519d3d3 commit 028196b

File tree

122 files changed

+4687
-2210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+4687
-2210
lines changed

.eslintrc

-11
This file was deleted.

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 4
4+
}

RELEASE_NOTES.md

+41-38
Original file line numberDiff line numberDiff line change
@@ -2,101 +2,104 @@
22

33
## v0.6.0 - 2019/12/04
44

5-
* Maintenance
5+
It's been over a year. It was time to give this project a little love:
66

7-
It's been over a year. It was time to give this project a little love. Updated dependencies, removed the Node server, and stuff like that.
7+
- Updated dependencies.
8+
- Removed the Node server.
9+
- Set up Prettier.
10+
- Add Service Worker.
811

912
## v0.5.3 - 2018/10/12
1013

11-
* "Color Map"
14+
- "Color Map"
1215

1316
I'm pretty proud of this one. I've added this lightly flash that happens on your screen when you pick up items on the ground. I feel like I'm already there--at the point where this project is exactly like Doom :)
1417

1518
Also, health and armor items now do provide armor and health to the player, as they should.
1619

1720
## v0.5.2 - 2018/10/10
1821

19-
* Items
22+
- Items
2023

2124
What would be Doom without items to pick up? Well, it would be pretty boring. So, here they are. They actually can not be picked up yet, but at least they animate :)
2225

2326
## v0.5.1 - 2018/10/07
2427

25-
* Refactoring, collisions, and automap
28+
- Refactoring, collisions, and automap
2629

2730
Since I started writing the Wolfenstein/Doom engine in JavaScript, I've learnt a lot about what it takes to create a game engine. Thankfully, I didn't have to start from scratch, thanks to [this article](https://dev.opera.com/articles/3d-games-with-canvas-and-raycasting-part-1). Partially rewriting the code from the get go allowed me to build on this great foundation. Also, I felt that using Redux to manage the state of the engine was an important move. However, as I added more and more features in order to have this project resemble the original games more closely, I got a better understanding of the code I used as a basis. Therefore, it was time to refactor. As a result, I got rid of a good chunk of code and harmonized how different parts of the engine work. HUGE WIN!
2831

29-
Also, as I am slowly introducing a new category of things in the game (items that can be picked up), I took the time to review how the logic for collision detection works: I introduced the possiblity to have things of different sizes in the engine. Tada!
32+
Also, as I am slowly introducing a new category of things in the game (items that can be picked up), I took the time to review how the logic for collision detection works: I introduced the possiblity to have things of different sizes in the engine. Tada!
3033

3134
And I realized that the automap had some inconsistencies that bothered me. Fixed too :)
3235

3336
## v0.5.0 - 2018/10/06
3437

35-
* Playable on mobile
38+
- Playable on mobile
3639

3740
Since I started this project, I secretly dreamt of making the game playable on my tablet. It took me a few months but it is now possible :)
3841

3942
Unfortunately, it does not seem that smaller devices handle the engine as well as laptops and desktop computers do. As a consequence, any movement on a mobile makes the framerate drop vertiginously. I guess my table is not top of the line, so this might not be a problem on the most recent devices. I'll take a look later on how to improve performances for machines with less CPU power.
4043

4144
## v0.4.9 - 2018/10/05
4245

43-
* Ammo
46+
- Ammo
4447

4548
Another little improvement: Ammunition is now subtracted from your ammo count as you fire. And the engine checks your ammo count, so no more infinite firing!
4649

4750
## v0.4.8 - 2018/09/30
4851

49-
* Weapon sounds
52+
- Weapon sounds
5053

5154
Here we are! Those weapon not only animate now but they also make the appropriate sound as the player is firing away. With a little effort, it was possible to recreate the original feel of the super shotgun reloading phase.
5255

5356
I also added a little logic in order to adjust how much time each weapon takes to be ready to fire again.
5457

5558
## v0.4.7 - 2018/09/30
5659

57-
* Can't change weapon while animating
60+
- Can't change weapon while animating
5861

5962
There was a little oddity going on with the weapons. As soon as you stopped holding the fire key, the weapon animation stopped and was replaced by the idle frame. No, no, no! The animation has to complete! And now it does. Also, until the animation has finished, it is not possible to switch weapons. Just like in the original game. Yay!
6063

6164
## v0.4.6 - 2018/09/29
6265

63-
* Weapon firing animations
66+
- Weapon firing animations
6467

6568
I'm taking little steps towards having weapons fully implemented. I added the necessary code to animate the weapons when pressing the firing key (aka Control or a click on the mouse). It's still missing the flash overlay, the positioning of the sprites is not correct, and it does not take the ammo away. But it's still good progress :)
6669

6770
## v0.4.5 - 2018/09/29
6871

69-
* Keep it in the 30s
72+
- Keep it in the 30s
7073

7174
I did it! I found the issue that was slowing down the engine tremendously after a few minutes of gameplay. I had an idea on what part of the engine was to be blamed but the actual problem proved to be a little bit different from what I expected. Basically, there was a function supposed to clear sprites that was horrible performance-wise and was actually not doing anything useful! The fix was as simple as commenting out the function. But I couldn't help refactor the mess related to rendering decorations and enemies. I ended up with cleaner code and a framerate that satisfyingly stays around 30 fps instead of dropping to insane numbers like it used to. Yay!
7275

7376
Bonus: No more useless updates to the DOM for invisible sprites.
7477

7578
## v0.4.4 - 2018/09/29
7679

77-
* Figuring out the FPS mess
80+
- Figuring out the FPS mess
7881

7982
A major issue I have with this project is the fact that the framerate goes down very quickly after the engine is running for a few minutes. It's very bad, really, because the game becomes unplayable at that point. I've noticed that problem a while ago but I was not sure how to tackle the issue. Well, from now on, it is possible to get a snapshot in the console of the framerate every second. With a simple color code and a timestamp, I get a little more insight into where and how it's going wrong, which should hopefully help me debug the code and see what is sucking the life out of the engine.
8083

8184
Fingers crossed.
8285

8386
## v0.4.3 - 2018/09/21
8487

85-
* Decorations
88+
- Decorations
8689

8790
The engine was drawing all decorations (barrels, pillars, etc.) as if they were all of the same height and width. This is now fixed and, with a little (too much) magic (ie, magic numbers), we have a more coherent world where small items are small and big items are big. Makes sense, right?
8891

8992
## v0.4.2 - 2018/09/08
9093

91-
* Weapon idle animations
94+
- Weapon idle animations
9295

9396
The chainsaw is a special weapon in Doom. It's the only weapon that is animated when you are not actively using it to destroy some demons. Moreover, it makes a very distinctive idling sound as well as a beautiful revving sound.
9497

9598
Of course, I had to write some code in order to make sure that our beloved weapon does it all. There's only one thing left to do now... Let's find some meat!
9699

97100
## v0.4.1 - 2018/09/08
98101

99-
* Lower and raise weapons
102+
- Lower and raise weapons
100103

101104
It was a little sad to switch weapons without transitions. Guess what? When you select a different weapon, the weapon will now amazingly lower and the next weapon will raise. Magic!
102105

@@ -106,13 +109,13 @@ Also, the player can not select a weapon they don't own anymore. Better hide thi
106109

107110
## v0.4.0 - 2018/09/07
108111

109-
* Switching weapons
112+
- Switching weapons
110113

111114
We're moving up in the world. Version 0.4, because the status bear is done and we are moving to more complex stuff, such as... weapons! It is now possible to change your current weapon by pressing a number between 1 and 7. The image changes abruptly, and the engine does not check if you actually own the weapon, but it's a good start!
112115

113116
## v0.3.7 - 2018/09/04
114117

115-
* Weapon sprites
118+
- Weapon sprites
116119

117120
I guess this update is not as complete as the previous ones, as the freshly added weapon sprites really do nothing. At least it's getting some boilerplate out of the way and helps me think about what approach I need to take to tackle all the weapon animations.
118121

@@ -122,7 +125,7 @@ But what I really need to figure out now is how to keep a good height/width rati
122125

123126
## v0.3.6 - 2018/09/02
124127

125-
* Status bar is ready
128+
- Status bar is ready
126129

127130
Here we are, with a full-blown Doom status bar. Finally, players will have the opportunity to immerse themselves in the game by checking doomguy's healh, armor, wepaons, ammo, and keys as they are dodging bullets from the enemies. Well, the engine is not quite ready for the monsters to attack but, eh, at least they're chasing you!
128131

@@ -134,13 +137,13 @@ Indeed.
134137

135138
## v0.3.5 - 2018/08/31
136139

137-
* Ammo
140+
- Ammo
138141

139142
The concept of ammunition is now part of the engine. Ammo does not do anything yet, but the game is able to display how much you have for the currently selected weapon. Which would be much more useful if the player was actually able to select a weapon... and use their ammo! It will come in due time.
140143

141144
## v0.3.4 - 2018/08/30
142145

143-
* Keys and Weapon Slots
146+
- Keys and Weapon Slots
144147

145148
Look alive people! There are now door key icons (card or skull, of course) as well as wepaon slots that light up when the player owns the right weapon on the status bar.
146149

@@ -150,47 +153,47 @@ I wonder if debugging is the reason why the IDKFA and IDFA cheats exist in the f
150153

151154
## v0.3.3 - 2018/08/29
152155

153-
* Armor!
156+
- Armor!
154157

155158
Same as health, we now display the armor percentage of the player. It's useless for now, but it's displayed and will come handy in the future. I've changed the methodology used to draw the status bar: we now have a CSS grid, which seems to work pretty well for this case. Booya!
156159

157160
## v0.3.2 - 2018/08/28
158161

159-
* Health
162+
- Health
160163

161164
Technically, the player has health now. It can't be modified, it does not really do anything, except for changing how the mug shot looks, but it's there, and it's drawn on the status bar. Nice!
162165

163166
## v0.3.1 - 2018/08/27
164167

165-
* Mugshot
168+
- Mugshot
166169

167170
We can now see doomguy's beautiful face while he's roaming hell. He will take a look on the left, on the right, straight ahead, check again on the right, and so on... randomly. Depending on his health, we will see more or less blood. Also, we have god mode (or should I say degreelessness mode?) and a death state.
168171

169172
## v0.3.0 - 2018/08/26
170173

171-
* Time to move to v0.3!
174+
- Time to move to v0.3!
172175

173176
Yes, I think that it's time to bump the version of this project, as things are starting to take shape. We have a music/sfx engine, enemies with walk animations for multiple angles, a little bit of artificial intelligence, a whole collection of wall textures to draw from freely, a cool automap, some debug functionalities, and status messages that display at the top of the screen.
174177

175178
Latest addition: Now, the automap will always keep the best ratio possible, so that every wall on the map looks like a square, as it should, and not a rectangle if the screen's ratio is not 1:1. Very satisfactory!
176179

177180
## v0.2.11 - 2018/08/25
178181

179-
* Playlist mode
182+
- Playlist mode
180183

181184
Here is what's new: When playlist mode is ON, the music engine will play a different song at the end of the current song. When playlist mode is OFF, the same song will loop over and over again. Neat, eh?
182185

183-
I guess this will not really make a difference in the final version of the game, since Doom does not do that in its original version (source ports probably allow it, though). The real difference for me is that when I'm debugging the engine, I won't be listening to the same song all the time! And that's what matters :P
186+
I guess this will not really make a difference in the final version of the game, since Doom does not do that in its original version (source ports probably allow it, though). The real difference for me is that when I'm debugging the engine, I won't be listening to the same song all the time! And that's what matters :P
184187

185188
## v0.2.10 - 2018/08/24
186189

187-
* Automap Grid
190+
- Automap Grid
188191

189192
Alright, we now have a grid on the automap to have a better view of the level layout. Bonus: You can now change the colors used to draw the map. Yay!
190193

191194
## v0.2.9 - 2018/08/23
192195

193-
* Chasing the player
196+
- Chasing the player
194197

195198
Something very iconic about Doom is the way the enemies behave: Once they are awake, they walk in the general direction of the player, and wander from time to time by taking a steep turn or go in the opposite direction for a few steps, while emitting guttural growling sounds.
196199

@@ -200,58 +203,58 @@ Much more fun than having these guys just run blindly towards you like a huge ma
200203

201204
## v0.2.8 - 2018/08/22
202205

203-
* Sprite angles
206+
- Sprite angles
204207

205208
The engine is now capable of handling different sprite angles when the player looks at enemies. However, the enemies always lock in towards the player so you will not get to see these different-angle sprites yet. Just a matter of time before I enhance the AI and show the backs and sides of our favorite zombiemen.
206209

207210
## v0.2.7 - 2018/08/21
208211

209-
* Walk animations (mirrored frames, mirrored angles, reversed angles, and other fun things)
212+
- Walk animations (mirrored frames, mirrored angles, reversed angles, and other fun things)
210213

211214
I've added the less-straightforward walk animations for the Spider Mastermind, the Archvile, and so on. It was a very interesting dive into how id Software found amazing shortcuts to avoid drawing so many enemy sprites! Pretty cool.
212215

213216
## v0.2.6 - 2018/08/21
214217

215-
* Enemy walking sounds
218+
- Enemy walking sounds
216219

217220
Enemies can now emit a sound at fixed/random interval while they are chasing the player. Totally sets the mood :)
218221

219222
## v0.2.5 - 2018/08/20
220223

221-
* Walk animations
224+
- Walk animations
222225

223226
Enemies now animate when they chase you! We have a chaingunner, a cybie, and a SS. The other enemies' animations are slightly less straightforward, so it will take me a little longer to get these working. The peeps at id Software were smart enough to mirror the enemies' animations in order to save them from drawing all the sprites. However, my little engine (that could) is not smart enough to handle angles yet, so I'll have to be clever as well in order to make sure that the sprites make it all the way to the renderer even if the filenames are not as predictable as with our good old SSes.
224227

225228
Now that we have walking enemies, it's pretty cool, if you ask me. Makes it all more real. Yet, the engine right now feels more like a very alpha of Doom than the actual game when it was released to the public.
226229

227230
## v0.2.4 - 2018/08/19
228231

229-
* Change song
232+
- Change song
230233

231234
You can now randomly play a new song by pressing `M` on your keyboard. I won't get bored of hearing the same song 10 times in a row, now :P
232235

233236
## v0.2.3 - 2018/08/19
234237

235-
* The game can now be paused
238+
- The game can now be paused
236239

237240
Because it will be very useful for debug, the game is now pauseable!
238241

239242
## v0.2.2 - 2018/08/18
240243

241-
* We have better logging
244+
- We have better logging
242245

243246
Now that displaying messages at the top of the screen works, it was time to make sure that these messages get deleted logically. From now on, no more than 3 messages will be displayed at once, and they will all consistently be displayed for 3 seconds each (unless they were pushed out of the queue because they were the 4th message). It's pretty neat :)
244247

245248
## v0.2.1 - 2018/08/18
246249

247-
* We have logging
250+
- We have logging
248251

249252
The engine is now able to log messages at the top of the screen. The frame rate is now aligned with the right side of the screen.
250253

251254
Also, the color of both the frame rate and messages is red by default but will turn orange when viewing the automap.
252255

253256
## v0.2.0 - 2018/08/18
254257

255-
* We have a music engine!
258+
- We have a music engine!
256259

257260
The engine will now start a random song from Doom or Doom II to give the game some atmosphere. For Chrome-specific reasons, the song will only start playing on the first click on the page.

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,5 +331,5 @@
331331
</div>
332332
</div>
333333

334-
<script type="text/javascript" src="main.ab132821560f648df02d.js"></script></body>
334+
<script type="text/javascript" src="main.fa1d28cf0bd57ee327c2.js"></script></body>
335335
</html>

0 commit comments

Comments
 (0)