Skip to content

Commit 20dda9b

Browse files
authored
Merge pull request #38 from eugene-serb/development
Release 1.3.1
2 parents 97e7eca + c345212 commit 20dda9b

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

docs/index.5a2285572a9b7ac7e183.js renamed to docs/index.18dbdeeb2e87433e1432.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
trackLinks: true,
1414
accurateTrackBounce: true,
1515
webvisor: true
16-
});</script><script defer="defer" src="index.5a2285572a9b7ac7e183.js"></script></head><body><header class="header-mini"><nav class="container"><a href="https://eugene-serb.github.io/" target="_self">Go to homepage</a></nav></header><main class="page container"><h1 class="visually-hidden">Eugene Serb – Snake Game</h1><section class="post"><div class="game"><div id="map" class="game__map-wrapper"></div><div class="game__right-column"><h2 class="game__title">Snake Game</h2><div class="game__game-info"><span id="dialog" class="game__dialog">Let's have fun!</span><div class="game__banner"><span id="score" class="game__score">Score: 0</span> <span id="timer" class="game__timer">Time: 00:00</span></div><div class="game__controls"><span>Up</span><div><span></span><kbd>W</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Down</span><div><span></span><kbd>S</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Left</span><div><span></span><kbd>A</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Rigth</span><div><span></span><kbd>D</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Restart</span><div><span></span><kbd>R</kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;">START</kbd></div><span>Pause</span><div><span></span><kbd>P</kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;">BACK</kbd></div></div></div></div><div class="game__left-column"><div class="game__rating"><h3>Your records:</h3><table class="table_emerald"><thead><tr><th>#</th><th>Score</th><th>Time</th><th>Date</th></tr></thead><tbody id="rating"></tbody></table></div></div></div></section></main><footer class="footer"><div class="footer-wrapper container"><div class="annotation"><span class="annotation__text">© 2023 <a href="https://eugene-serb.github.io/" target="_blank" translate="no">Eugene Serb</a>. Content licensed under </span><a href="./LICENSE.md" target="_blank">GNU General Public License v3.0</a><br><span class="annotation__text">This site is open source. </span><a href="https://github.com/eugene-serb/snake-game/" target="_blank">Improve this page.</a></div></div></footer><noscript><div><img src="https://mc.yandex.ru/watch/79722217" style="position:absolute; left:-9999px;" alt=""/></div></noscript></body></html>
16+
});</script><script defer="defer" src="index.18dbdeeb2e87433e1432.js"></script></head><body><header class="header-mini"><nav class="container"><a href="https://eugene-serb.github.io/" target="_self">Go to homepage</a></nav></header><main class="page container"><h1 class="visually-hidden">Eugene Serb – Snake Game</h1><section class="post"><div class="game"><div id="map" class="game__map-wrapper"></div><div class="game__right-column"><h2 class="game__title">Snake Game</h2><div class="game__game-info"><span id="dialog" class="game__dialog">Let's have fun!</span><div class="game__banner"><span id="score" class="game__score">Score: 0</span> <span id="timer" class="game__timer">Time: 00:00</span></div><div class="game__controls"><span>Up</span><div><span></span><kbd>W</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Down</span><div><span></span><kbd>S</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Left</span><div><span></span><kbd>A</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Rigth</span><div><span></span><kbd>D</kbd> <span>and </span><kbd></kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;"></kbd></div><span>Restart</span><div><span></span><kbd>R</kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;">START</kbd></div><span>Pause</span><div><span></span><kbd>P</kbd> <span>and </span><kbd style="background-color: grey; border-radius: 2ch; color: white;">BACK</kbd></div></div></div></div><div class="game__left-column"><div class="game__rating"><h3>Your records:</h3><table class="table_emerald"><thead><tr><th>#</th><th>Score</th><th>Time</th><th>Date</th></tr></thead><tbody id="rating"></tbody></table></div></div></div></section></main><footer class="footer"><div class="footer-wrapper container"><div class="annotation"><span class="annotation__text">© 2023 <a href="https://eugene-serb.github.io/" target="_blank" translate="no">Eugene Serb</a>. Content licensed under </span><a href="./LICENSE.md" target="_blank">GNU General Public License v3.0</a><br><span class="annotation__text">This site is open source. </span><a href="https://github.com/eugene-serb/snake-game/" target="_blank">Improve this page.</a></div></div></footer><noscript><div><img src="https://mc.yandex.ru/watch/79722217" style="position:absolute; left:-9999px;" alt=""/></div></noscript></body></html>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snake-game",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "This is a simple browser snake-game. Let's have fun!",
55
"keywords": [
66
"snake-game",

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import SnakeGame from '@/snake-game.js';
44

55
const params = {
66
speedRate: 200,
7+
keyRating: 'es:snake',
78
};
89

910
const snakeGame = new SnakeGame(params);

src/snake-game.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ import {
1717
} from '@/items.js';
1818

1919
export class SnakeGame extends Gameloop {
20-
constructor() {
20+
constructor(params) {
2121
super();
2222

23+
this._params = params;
24+
2325
this.SPEED_RATE = (this._params?.speedRate &&
2426
typeof this._params?.speedRate === 'number'
2527
) ? this._params?.speedRate : 250;
2628

29+
this.KEY_RATING = (this._params?.keyRating &&
30+
typeof this._params?.keyRating === 'string'
31+
) ? this._params?.keyRating : 'es:snake';
32+
2733
this.#DOMs();
2834
this.#configurations();
2935
this.#eventListeners();

0 commit comments

Comments
 (0)