{"id":365566,"date":"2024-05-21T02:41:00","date_gmt":"2024-05-21T02:41:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=365566"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=365566","title":{"rendered":"<span>React + Three.js. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 3D \u0448\u0443\u0442\u0435\u0440. \u0427\u0430\u0441\u0442\u044c 3<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435  <\/h4>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0442\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0434\u043d\u0451\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b, \u043d\u043e \u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0438\u0433\u0440\u044b \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u00a0<a href=\"https:\/\/docs.pmnd.rs\/react-three-fiber\/getting-started\/introduction\" rel=\"noopener noreferrer nofollow\"><strong>React Three Fiber<\/strong><\/a>\u00a0&#8212; \u043c\u043e\u0449\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f 3D-\u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435\u00a0<a href=\"https:\/\/threejs.org\/\" rel=\"noopener noreferrer nofollow\"><strong>Three.js<\/strong><\/a>\u00a0\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438\u00a0<strong>React<\/strong>.<\/p>\n<p>\u0412 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c typescript \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u0440\u043e\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u043f\u0440\u0438\u0446\u0435\u043b\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0446\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u043e \u0437\u0432\u0443\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435 \u0438 \u043f\u0440\u0438 \u043f\u0443\u0441\u0442\u043e\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043b\u043e\u0442\u043e\u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441 \u0438\u043a\u043e\u043d\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/JI0PATA\/fps-game\" rel=\"noopener noreferrer nofollow\"><u>GitHub<\/u><\/a>.<\/p>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u0435\u043c\u043e:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/65a7d07de993b17686ea3345\" data-style=\"\" id=\"65a7d07de993b17686ea3345\" width=\"\"><\/div>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;undefined&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span><\/span><\/div>\n<p><a href=\"https:\/\/codesandbox.io\/p\/github\/JI0PATA\/fps-game\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">codesandbox.io<\/a><\/div>\n<\/div>\n<h4>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e  <\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0435\u0451 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c. \u041d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 <strong>React Three Fiber<\/strong> \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a <a href=\"https:\/\/docs.pmnd.rs\/react-three-fiber\/getting-started\/examples\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u0430\u043d\u043d\u043e\u0435 <a href=\"https:\/\/codesandbox.io\/p\/sandbox\/ecctrl-fisheye-nvk9pf\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043c\u043e<\/a>. \u0418\u0437 \u043d\u0435\u0433\u043e \u044f \u0432\u0437\u044f\u043b \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0451 \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0451 \u0441\u0440\u0430\u0437\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>Ground.jsx<\/strong> \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c. \u042f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0435\u0451 \u043f\u043e \u043f\u0443\u0442\u0438 <strong>public\/territory.glb<\/strong>. \u0414\u0430\u043d\u043d\u0443\u044e <a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/raw\/787cb44316af6b03750c8ca7bb517e691244430e\/public\/territory.glb\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0434\u0435\u043b\u044c<\/a> (\u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435) \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0418 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0430 <strong>floor.png<\/strong> \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c9e\/31c\/66f\/c9e31c66fb1ab22984f29c9325692ffb.png\" alt=\"Ground.jsx\" title=\"Ground.jsx\" width=\"1725\" height=\"801\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c9e\/31c\/66f\/c9e31c66fb1ab22984f29c9325692ffb.png\"\/><\/p>\n<div><figcaption>Ground.jsx<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a9a\/67c\/313\/a9a67c313cca3f787a8fe9e714ea223e.png\" alt=\"\u041d\u043e\u0432\u0430\u044f \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044f\" title=\"\u041d\u043e\u0432\u0430\u044f \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044f\" width=\"1901\" height=\"928\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a9a\/67c\/313\/a9a67c313cca3f787a8fe9e714ea223e.png\"\/><\/p>\n<div><figcaption>\u041d\u043e\u0432\u0430\u044f \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/654\/783\/602\/65478360212feeefe0571f18db24e231.gif\" width=\"500\" height=\"282\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/654\/783\/602\/65478360212feeefe0571f18db24e231.gif\"\/><\/figure>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/787cb44316af6b03750c8ca7bb517e691244430e\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a><\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 TypeScript \u0438 SCSS  <\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c <strong>TypeScript<\/strong>. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u0431\u0443\u0434\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <strong>Three.js<\/strong>.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>TypeScript <\/strong>\u043a \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/www.robinwieruch.de\/vite-typescript\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430: <strong>tsconfig.json<\/strong> \u0438 <strong>tsconfig.node.json<\/strong>, \u043a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b\u0448\u0435.<\/p>\n<p><strong>tsconfig.json<\/strong><\/p>\n<pre><code class=\"json\">{   \"compilerOptions\": {     \"target\": \"ES2020\",     \"useDefineForClassFields\": true,     \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],     \"module\": \"ESNext\",     \"skipLibCheck\": true,     \"baseUrl\": \".\",     \"paths\": {       \"@\/*\": [\".\/src\/*\"]     },     \"types\": [\"node\"],      \/* Bundler mode *\/     \"moduleResolution\": \"bundler\",     \"allowImportingTsExtensions\": true,     \"resolveJsonModule\": true,     \"isolatedModules\": true,     \"noEmit\": true,     \"jsx\": \"react-jsx\",      \/* Linting *\/     \"strict\": true,     \"noUnusedLocals\": true,     \"noUnusedParameters\": true,     \"noFallthroughCasesInSwitch\": true   },   \"include\": [\"src\"],   \"references\": [{ \"path\": \".\/tsconfig.node.json\" }] }<\/code><\/pre>\n<p><strong>tsconfig.node.json<\/strong><\/p>\n<pre><code class=\"json\">{   \"compilerOptions\": {     \"composite\": true,     \"skipLibCheck\": true,     \"module\": \"ESNext\",     \"moduleResolution\": \"bundler\",     \"allowSyntheticDefaultImports\": true   },   \"include\": [\"vite.config.js\"] }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0445 \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u044d\u0442\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 <a href=\"https:\/\/dev.to\/andrewezeani\/how-to-create-absolute-imports-in-vite-react-app-a-step-by-step-guide-28co\" rel=\"noopener noreferrer nofollow\"><strong>JS<\/strong><\/a> \u0438 <a href=\"https:\/\/dev.to\/mizanrifat\/streamlining-absolute-imports-in-react-with-typescript-and-vite-2bpp\" rel=\"noopener noreferrer nofollow\"><strong>TS<\/strong><\/a>. \u0414\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 <strong>TS<\/strong> \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e (8-11 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>tsconfig.json<\/strong>). \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 JS \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <strong>jsonconfig.json<\/strong> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n<p><strong>jsconfig.json<\/strong>  <\/p>\n<pre><code class=\"json\">{   \"compilerOptions\": {     \"baseUrl\": \".\",     \"paths\": {       \"@\/*\": [\".\/src\/*\"]     }   } }<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <strong>App.jsx<\/strong> \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0443\u0442\u0438 \u043d\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043f\u0443\u0442\u0438 \u0441 \u201c<strong>@\/<\/strong>\u201d \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0441 <strong>ESLint<\/strong> \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438\u0437 <strong>TypeScript<\/strong> \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>.eslintrc.cjs<\/strong>. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<pre><code class=\"bash\">npm i -D @types\/node @typescript-eslint\/eslint-plugin @typescript-eslint\/parser<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/106\/92c\/9e5\/10692c9e5c8e9f739ce1ebe53f5ece95.png\" alt=\".eslintrc.cjs\" title=\".eslintrc.cjs\" width=\"955\" height=\"521\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/106\/92c\/9e5\/10692c9e5c8e9f739ce1ebe53f5ece95.png\"\/><\/p>\n<div><figcaption>.eslintrc.cjs<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <strong>SCSS<\/strong> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e.  <\/p>\n<pre><code class=\"bash\">npm i -D sass<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c \u0444\u0430\u0439\u043b <strong>index.css<\/strong> \u0432 <strong>index.scss<\/strong>. \u0422\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0443 <strong>main.jsx<\/strong> \u043d\u0430 <strong>main.tsx<\/strong> \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <strong>App<\/strong> \u0438 \u0444\u0430\u0439\u043b\u0430 \u0441\u0442\u0438\u043b\u0435\u0439 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6f8\/7fc\/3c7\/6f87fc3c77af722509790d19eccc3a30.png\" alt=\"\u041e\u0448\u0438\u0431\u043a\u0430 TypeScript\" title=\"\u041e\u0448\u0438\u0431\u043a\u0430 TypeScript\" width=\"1041\" height=\"312\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f8\/7fc\/3c7\/6f87fc3c77af722509790d19eccc3a30.png\"\/><\/p>\n<div><figcaption>\u041e\u0448\u0438\u0431\u043a\u0430 TypeScript<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <strong>.tsx<\/strong> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>index.html<\/strong> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d15\/051\/c4e\/d15051c4eae8c57435f416072963857a.png\" alt=\"index.html\" title=\"index.html\" width=\"833\" height=\"242\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d15\/051\/c4e\/d15051c4eae8c57435f416072963857a.png\"\/><\/p>\n<div><figcaption>index.html<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0430\u043f\u043a\u0438 <strong>src<\/strong> \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>declaration.d.ts<\/strong> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. <\/p>\n<p><strong>declaration.d.ts<\/strong><\/p>\n<pre><code class=\"typescript\">declare module '*.scss'; declare module '*.jsx';<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0441\u0442\u0438\u043b\u044f\u043c. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438 <strong>src\/UI\/UI.module.scss<\/strong>. \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043c \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u0442\u0438\u043b\u0438 \u201c\u043f\u0440\u0438\u0446\u0435\u043b\u0430\u201d \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u201c\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438\u201d.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2c3\/5a0\/7b5\/2c35a07b5adc4a0703ba2a35be17273e.png\" alt=\"main.tsx\" title=\"main.tsx\" width=\"893\" height=\"624\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c3\/5a0\/7b5\/2c35a07b5adc4a0703ba2a35be17273e.png\"\/><\/p>\n<div><figcaption>main.tsx<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <strong>SCSS<\/strong> \u0438 <strong>TypeScript<\/strong> \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>\u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438<\/strong> \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0444\u0430\u0439\u043b\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0443\u0442\u0438 \u043d\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.  <\/p>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/f3f87e0c0024cf25992b31a9d571ab6b132e7492\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a> <\/p>\n<h4>\u0421\u0447\u0451\u0442\u0447\u0438\u043a \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432  <\/h4>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448\u0435 \u043e\u0440\u0443\u0436\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0440\u0435\u043b\u044f\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043b\u0438\u043c\u0438\u0442\u0430 \u043f\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430\u043c. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043b\u0438\u043c\u0438\u0442, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>zustand<\/strong> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438 <strong>src\/store\/RoundsStore.ts<\/strong>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>TypeScript<\/strong>. \u0417\u0430\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043e\u043f\u0438\u0448\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0430\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0412 \u043d\u0451\u043c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e: \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>defaultCountOfRounds<\/strong>), \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0430\u0442\u0440\u043e\u043d \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438 (\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u0447\u0438\u0441\u043b\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e).<\/p>\n<p><strong>RoundsStore.ts<\/strong><\/p>\n<pre><code class=\"typescript\">import {create} from \"zustand\";  const defaultCountOfRounds = 30;  export interface IRoundsStore {     countRounds: number;     decreaseRounds: () => void;     reloadRounds: () => void; }  export const useRoundsStore = create&lt;IRoundsStore>()((set) => ({     countRounds: defaultCountOfRounds,     decreaseRounds: () => set(({ countRounds }) => {         return {             countRounds: Math.max(countRounds - 1, 0)         }     }),     reloadRounds: () => set(() => {         return {             countRounds: defaultCountOfRounds         }     }) }));<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432. \u041f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0443\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430: <strong>src\/UI\/NumberOfRounds\/NumberOfRounds.tsx<\/strong> \u0438 <strong>src\/UI\/NumberOfRounds\/styles.module.scss<\/strong>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0438\u043b\u0438 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p><strong>styles.module.scss<\/strong><\/p>\n<pre><code class=\"css\">.rounds {   display: flex;   align-items: center;   justify-content: center;   width: 60px;   height: 60px;   position: absolute;   right: 40px;   bottom: 40px;   background: rgba(255, 255, 255, .8);   font-size: 40px;   border-radius: 10px; }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u0430\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430. \u0412 \u0444\u0430\u0439\u043b\u0435 <strong>NumberOfRounds.tsx<\/strong> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c <strong>useRoundsStore<\/strong> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432. \u0410 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043b\u0438\u0431\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432, \u043b\u0438\u0431\u043e \u043a\u043d\u043e\u043f\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0436\u0430\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u043c, \u0431\u044b\u043b\u043e \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u201c\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438\u201d \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412 <strong>.env<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044f: \u043e\u0434\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438, \u0432\u0442\u043e\u0440\u043e\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0436\u0430\u0442\u044c.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e8d\/ebd\/0f7\/e8debd0f7e2086acc8231a2d3e8e3b5f.png\" alt=\".env\" title=\".env\" width=\"509\" height=\"211\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8d\/ebd\/0f7\/e8debd0f7e2086acc8231a2d3e8e3b5f.png\"\/><\/p>\n<div><figcaption>.env<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0430\u0439\u043b <strong>NumberOfRounds.tsx<\/strong>.  <\/p>\n<pre><code class=\"typescript\">import {useRoundsStore, IRoundsStore} from \"@\/store\/RoundsStore.ts\"; import styles from \"@\/UI\/NumberOfRounds\/styles.module.scss\";  const RELOAD_BUTTON_NAME = import.meta.env.VITE_RELOAD_BUTTON_NAME;  const NumberOfRounds = () => {     const countOfRounds = useRoundsStore((state: IRoundsStore) => state.countRounds);     const isEmptyRounds = countOfRounds === 0;      return (         &lt;div className={styles.rounds}>             {!isEmptyRounds ? countOfRounds : RELOAD_BUTTON_NAME}         &lt;\/div>     ); };  export default NumberOfRounds;<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e <strong>TypeScript<\/strong> \u0432\u0441\u0451 \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0442\u043e \u043e\u043d \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441, \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>.env <\/strong>\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b <strong>tsconfig.json<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <strong>types<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6d0\/7ef\/5dc\/6d07ef5dcad87db152bb5b7dfd65fd32.png\" alt=\"tsconfig.json\" title=\"tsconfig.json\" width=\"639\" height=\"274\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d0\/7ef\/5dc\/6d07ef5dcad87db152bb5b7dfd65fd32.png\"\/><\/p>\n<div><figcaption>tsconfig.json<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>declaration.d.ts<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430\u0448\u0435\u0433\u043e <strong>.env<\/strong>, \u0447\u0442\u043e\u0431\u044b <strong>TypeScript<\/strong> \u043c\u043e\u0433 \u0432\u0441\u0451 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e64\/3a1\/896\/e643a1896ead38edc425b0fe052354b5.png\" alt=\"declaration.d.ts\" title=\"declaration.d.ts\" width=\"691\" height=\"421\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e64\/3a1\/896\/e643a1896ead38edc425b0fe052354b5.png\"\/><\/p>\n<div><figcaption>declaration.d.ts<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0451\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0443 \u043d\u0430\u0441 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 &#8212; \u043f\u0440\u0438\u0446\u0435\u043b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 3D. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <strong>src\/UI\/UI.tsx<\/strong>.\u00a0<\/p>\n<p><strong><em>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435. <\/em><\/strong>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0442\u0443\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: <strong>useAimingStore<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 <strong>src\/store\/AimingStore.ts<\/strong> \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043c \u0435\u0433\u043e \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0438\u0434\u0443. \u0418\u0437 \u0444\u0430\u0439\u043b\u0430 <strong>Weapon.jsx<\/strong> \u0443\u0434\u0430\u043b\u0438\u043c \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <strong>Weapon.jsx<\/strong> \u0438 <strong>Player.jsx<\/strong>.<\/p>\n<p><strong>AimingStore.ts<\/strong><\/p>\n<pre><code class=\"typescript\">import {create} from \"zustand\";  export interface IAimingStore {     isAiming: boolean;     setIsAiming: (value: boolean ) => void; }  export const useAimingStore = create&lt;IAimingStore>()((set) => ({     isAiming: false,     setIsAiming: (value) => set(() => ({ isAiming: value })) }));<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ed\/a9a\/a51\/0eda9aa51d172f70946e6093a4704b5f.png\" alt=\"Weapon.jsx\" title=\"Weapon.jsx\" width=\"962\" height=\"769\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ed\/a9a\/a51\/0eda9aa51d172f70946e6093a4704b5f.png\"\/><\/p>\n<div><figcaption>Weapon.jsx<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1b9\/390\/b65\/1b9390b657644aa4c5a1e1242b8520fb.png\" alt=\"Player.jsx\" title=\"Player.jsx\" width=\"816\" height=\"307\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1b9\/390\/b65\/1b9390b657644aa4c5a1e1242b8520fb.png\"\/><\/p>\n<div><figcaption>Player.jsx<\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0430\u0439\u043b <strong>UI.tsx<\/strong>. \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043c \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0446\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u043d\u0435 \u043f\u0440\u0438\u0446\u0435\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \u043c\u044b\u0448\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0443\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <strong>NumberOfRounds<\/strong>.  <\/p>\n<p><strong>UI.tsx<\/strong><\/p>\n<pre><code class=\"typescript\">import NumberOfRounds from \"@\/UI\/NumberOfRounds\/NumberOfRounds.tsx\"; import {IAimingStore, useAimingStore} from \"@\/store\/AimingStore.ts\"; import styles from \"@\/UI\/UI.module.scss\";  const UI = () => {     const isAiming = useAimingStore((state: IAimingStore) => state.isAiming);      return (         &lt;div className=\"ui-root\">             {!isAiming &amp;&amp; &lt;div className={styles.aim} \/>}             &lt;NumberOfRounds\/>         &lt;\/div>     ); };  export default UI;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0430\u0442\u0440\u043e\u043d. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>decreaseRounds<\/strong> \u0438\u0437 <strong>useRoundsStore<\/strong>. \u0410 \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u0430\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e 0, \u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>reloadRounds<\/strong>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430 \u043e\u0434\u0438\u043d \u043a\u043b\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/510\/2e2\/b06\/5102e2b0638b565de263b90092895fed.png\" alt=\"Weapon.jsx\" title=\"Weapon.jsx\" width=\"1037\" height=\"1000\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/510\/2e2\/b06\/5102e2b0638b565de263b90092895fed.png\"\/><\/p>\n<div><figcaption>Weapon.jsx<\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/936de291c3120d50387d46bf1348b78afc0b4443\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a><\/p>\n<h4>\u041f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0430  <\/h4>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443: \u043f\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u043f\u0430\u0442\u0440\u043e\u043d\u044b, \u0442\u043e \u043e\u0440\u0443\u0436\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0440\u0435\u043b\u044f\u0442\u044c, \u043d\u043e \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u0430, \u0430 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>Weapon.jsx<\/strong>. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 <strong>.env <\/strong>\u043a\u043e\u0434 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438. \u0417\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 <strong>useRoundsStore<\/strong>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f <strong>keypress<\/strong> \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0443\u044e \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \u0441 \u0442\u043e\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0434\u0430\u043d\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438. \u0410 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>startShooting<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u0440\u0430\u0432\u043d\u043e 0, \u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u0442\u0440\u043e\u043d\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 R, \u0442\u043e \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0437\u0432\u0443\u043a\u0438 \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0447\u043d\u0443\u0442 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/d48cedabbd653fb145a99f05c5c7577e1fcd30b1\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a><\/p>\n<h4>\u0417\u0432\u0443\u043a\u0438 \u043f\u0440\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435 \u0438 \u043f\u0440\u0438 \u043f\u0443\u0441\u0442\u043e\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435  <\/h4>\n<p>\u0417\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u0437\u0432\u0443\u043a\u0430\u043c\u0438 \u043e\u0440\u0443\u0436\u0438\u044f. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0437\u0432\u0443\u043a \u043f\u0440\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435. \u041d\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441 \u043f\u0443\u0441\u0442\u044b\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u043c \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u0432\u0443\u043a\u0430. \u041c\u043d\u043e\u044e \u0443\u0436\u0435 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d \u0437\u0432\u0443\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/raw\/7231b278ca52a2e86e0469aa93b62b41396a1ee9\/src\/assets\/sounds\/shoot-without-bullet.wav\" rel=\"noopener noreferrer nofollow\">\u0435\u0433\u043e<\/a> (\u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430\u0447\u043d\u0451\u0442\u0441\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435) \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430.\u00a0<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>HTMLAudio<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0437\u0432\u0443\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433 <strong>PositionalAudio<\/strong>. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>url<\/strong> &#8212; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0430\u0443\u0434\u0438\u043e-\u0444\u0430\u0439\u043b;<\/p>\n<\/li>\n<li>\n<p><strong>autoplay<\/strong> &#8212; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c false, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0439 \u0437\u0432\u0443\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p><strong>loop<\/strong> &#8212; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c false, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p><strong>ref<\/strong> &#8212; \u0437\u0430\u0434\u0430\u0451\u043c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0437\u0432\u0443\u043a\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/7231b278ca52a2e86e0469aa93b62b41396a1ee9\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a><\/p>\n<h4>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043b\u043e\u0442\u043e\u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430  <\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043b\u043e\u0442\u043e\u0432 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0433\u0440\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b.\u00a0<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <strong>src\/store\/QuickAccessSlotsStore.ts<\/strong>. \u041e\u043f\u0438\u0448\u0435\u043c \u0442\u0438\u043f \u0441\u043b\u043e\u0442\u0430 <strong>QuickAccessSlotsType<\/strong>, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043a\u043e\u043d\u043a\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <strong>IQuickAccessSlotsStore<\/strong>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0441\u043b\u043e\u0442\u044b &#8212; \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u043e\u0432. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0430\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435.<\/p>\n<p><strong>QuickAccessSlotsStore.ts<\/strong><\/p>\n<pre><code class=\"typescript\">import {create} from \"zustand\"; import default_slots from \"@\/quick_access_slots.json\";  const SLOTS_COUNT = 5 as const;  type QuickAccessSlotsType = {     item: string; }  interface IQuickAccessSlotsStore {     slots: QuickAccessSlotsType[]; }  export const useQuickAccessSlotsStore = create&lt;IQuickAccessSlotsStore>()(() => ({     slots: default_slots.concat(Array(SLOTS_COUNT - default_slots.length).fill({         item: null     })) }));<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0431\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <strong>json<\/strong>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c<strong> <\/strong>\u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043e\u0432. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043a\u043e\u043d\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.  <\/p>\n<p><strong>quick_access_slots.json<\/strong>  <\/p>\n<pre><code class=\"json\">[   {     \"item\": \"medicine\/aid.png\"   },   {     \"item\": \"weapons\/mp5.png\"   },   {     \"item\": \"weapons\/ak.png\"   } ]<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0442\u043e\u0432 \u0441 \u0438\u043a\u043e\u043d\u043a\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438 \u0446\u0438\u0444\u0440\u043e\u0439 \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u043c\u0430\u043a\u0435\u0442\u0430: <strong>src\/UI\/QuickAccessSlots\/styles.module.scss<\/strong> \u0438 <strong>src\/UI\/QuickAccessSlots\/QuickAccessSlots.tsx<\/strong>.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0442\u0438\u043b\u0438.<\/p>\n<pre><code class=\"css\">.slots {   position: fixed;   bottom: 40px;   left: 50%;   transform: translateX(-50%);   display: flex;   align-items: center;   column-gap: 10px;    .slot {     position: relative;     width: 60px;     height: 60px;     border-radius: 10px;     border: 2px solid darkgray;     background: rgba(255, 255, 255, .3);     padding: 5px;     transform: skew(-20deg, 0);      img {       width: 100%;       height: 100%;     }      .key {       position: absolute;       z-index: 2;       font-weight: bold;     }   } }<\/code><\/pre>\n<p>\u0412 <strong>tsx<\/strong> \u0444\u0430\u0439\u043b\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0441\u043b\u043e\u0442\u044b \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u0446\u0438\u043a\u043b, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0442\u0430 \u0446\u0438\u0444\u0440\u0443 (\u0438\u043d\u0434\u0435\u043a\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 + 1), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u043b\u0438 \u0447\u0435\u043c-\u0442\u043e \u0441\u043b\u043e\u0442 \u0438 \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.  <\/p>\n<p><strong>QuickAccessSlots.tsx<\/strong><\/p>\n<pre><code class=\"typescript\">import {useQuickAccessSlotsStore} from \"@\/store\/QuickAccessSlotsStore.ts\"; import styles from \"@\/UI\/QuickAccessSlots\/styles.module.scss\";  const QuickAccessSlots = () => {     const slots = useQuickAccessSlotsStore((state) => state.slots);      return (         &lt;div className={styles.slots}>             {slots.map((slot, key) => (                 &lt;div key={key} className={styles.slot}>                     &lt;span className={styles.key}>{key + 1}&lt;\/span>                     {slot.item &amp;&amp; &lt;img src={`\/images\/icons\/${slot.item}`} alt={`${slot.item} ICON`}\/>}                 &lt;\/div>             ))}         &lt;\/div>     ); };  export default QuickAccessSlots;<\/code><\/pre>\n<p>\u0418 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <strong>UI.tsx<\/strong>.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b4d\/498\/2fb\/b4d4982fb83034ac69f02212854ce674.png\" alt=\"UI.tsx\" title=\"UI.tsx\" width=\"937\" height=\"401\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b4d\/498\/2fb\/b4d4982fb83034ac69f02212854ce674.png\"\/><\/p>\n<div><figcaption>UI.tsx<\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/308a6cb11c99899c5dfd11998cd326c98bfb6744\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a><\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435  <\/h4>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e, \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u043c, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u0441 \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u043e\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0432\u0435\u043b\u0438 \u0441\u043b\u043e\u0442\u044b \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0438\u0433\u0440\u0443, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043d\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/787076\/\"> https:\/\/habr.com\/ru\/articles\/787076\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435  <\/h4>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0442\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0434\u043d\u0451\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b, \u043d\u043e \u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0438\u0433\u0440\u044b \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u00a0<a href=\"https:\/\/docs.pmnd.rs\/react-three-fiber\/getting-started\/introduction\" rel=\"noopener noreferrer nofollow\"><strong>React Three Fiber<\/strong><\/a>\u00a0&#8212; \u043c\u043e\u0449\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f 3D-\u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435\u00a0<a href=\"https:\/\/threejs.org\/\" rel=\"noopener noreferrer nofollow\"><strong>Three.js<\/strong><\/a>\u00a0\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438\u00a0<strong>React<\/strong>.<\/p>\n<p>\u0412 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c typescript \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0430\u043c;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u0440\u043e\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u043f\u0440\u0438\u0446\u0435\u043b\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0446\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u043e \u0437\u0432\u0443\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435 \u0438 \u043f\u0440\u0438 \u043f\u0443\u0441\u0442\u043e\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043b\u043e\u0442\u043e\u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441 \u0438\u043a\u043e\u043d\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/JI0PATA\/fps-game\" rel=\"noopener noreferrer nofollow\"><u>GitHub<\/u><\/a>.<\/p>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0434\u0435\u043c\u043e:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/65a7d07de993b17686ea3345\" data-style=\"\" id=\"65a7d07de993b17686ea3345\" width=\"\"><\/div>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;undefined&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span><\/span><\/div>\n<p><a href=\"https:\/\/codesandbox.io\/p\/github\/JI0PATA\/fps-game\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">codesandbox.io<\/a><\/div>\n<\/div>\n<h4>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e  <\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044e, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0435\u0451 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c. \u041d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 <strong>React Three Fiber<\/strong> \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a <a href=\"https:\/\/docs.pmnd.rs\/react-three-fiber\/getting-started\/examples\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u0430\u043d\u043d\u043e\u0435 <a href=\"https:\/\/codesandbox.io\/p\/sandbox\/ecctrl-fisheye-nvk9pf\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043c\u043e<\/a>. \u0418\u0437 \u043d\u0435\u0433\u043e \u044f \u0432\u0437\u044f\u043b \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0451 \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0451 \u0441\u0440\u0430\u0437\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>Ground.jsx<\/strong> \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c. \u042f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0435\u0451 \u043f\u043e \u043f\u0443\u0442\u0438 <strong>public\/territory.glb<\/strong>. \u0414\u0430\u043d\u043d\u0443\u044e <a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/raw\/787cb44316af6b03750c8ca7bb517e691244430e\/public\/territory.glb\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0434\u0435\u043b\u044c<\/a> (\u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435) \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0418 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0430 <strong>floor.png<\/strong> \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Ground.jsx<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u041d\u043e\u0432\u0430\u044f \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><\/figure>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/787cb44316af6b03750c8ca7bb517e691244430e\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a><\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 TypeScript \u0438 SCSS  <\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c <strong>TypeScript<\/strong>. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u0431\u0443\u0434\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <strong>Three.js<\/strong>.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>TypeScript <\/strong>\u043a \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/www.robinwieruch.de\/vite-typescript\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430: <strong>tsconfig.json<\/strong> \u0438 <strong>tsconfig.node.json<\/strong>, \u043a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b\u0448\u0435.<\/p>\n<p><strong>tsconfig.json<\/strong><\/p>\n<pre><code class=\"json\">{   \"compilerOptions\": {     \"target\": \"ES2020\",     \"useDefineForClassFields\": true,     \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],     \"module\": \"ESNext\",     \"skipLibCheck\": true,     \"baseUrl\": \".\",     \"paths\": {       \"@\/*\": [\".\/src\/*\"]     },     \"types\": [\"node\"],      \/* Bundler mode *\/     \"moduleResolution\": \"bundler\",     \"allowImportingTsExtensions\": true,     \"resolveJsonModule\": true,     \"isolatedModules\": true,     \"noEmit\": true,     \"jsx\": \"react-jsx\",      \/* Linting *\/     \"strict\": true,     \"noUnusedLocals\": true,     \"noUnusedParameters\": true,     \"noFallthroughCasesInSwitch\": true   },   \"include\": [\"src\"],   \"references\": [{ \"path\": \".\/tsconfig.node.json\" }] }<\/code><\/pre>\n<p><strong>tsconfig.node.json<\/strong><\/p>\n<pre><code class=\"json\">{   \"compilerOptions\": {     \"composite\": true,     \"skipLibCheck\": true,     \"module\": \"ESNext\",     \"moduleResolution\": \"bundler\",     \"allowSyntheticDefaultImports\": true   },   \"include\": [\"vite.config.js\"] }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0445 \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u044d\u0442\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 <a href=\"https:\/\/dev.to\/andrewezeani\/how-to-create-absolute-imports-in-vite-react-app-a-step-by-step-guide-28co\" rel=\"noopener noreferrer nofollow\"><strong>JS<\/strong><\/a> \u0438 <a href=\"https:\/\/dev.to\/mizanrifat\/streamlining-absolute-imports-in-react-with-typescript-and-vite-2bpp\" rel=\"noopener noreferrer nofollow\"><strong>TS<\/strong><\/a>. \u0414\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 <strong>TS<\/strong> \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e (8-11 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>tsconfig.json<\/strong>). \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 JS \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <strong>jsonconfig.json<\/strong> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n<p><strong>jsconfig.json<\/strong>  <\/p>\n<pre><code class=\"json\">{   \"compilerOptions\": {     \"baseUrl\": \".\",     \"paths\": {       \"@\/*\": [\".\/src\/*\"]     }   } }<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <strong>App.jsx<\/strong> \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0443\u0442\u0438 \u043d\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043f\u0443\u0442\u0438 \u0441 \u201c<strong>@\/<\/strong>\u201d \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0441 <strong>ESLint<\/strong> \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438\u0437 <strong>TypeScript<\/strong> \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>.eslintrc.cjs<\/strong>. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<pre><code class=\"bash\">npm i -D @types\/node @typescript-eslint\/eslint-plugin @typescript-eslint\/parser<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>.eslintrc.cjs<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <strong>SCSS<\/strong> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e.  <\/p>\n<pre><code class=\"bash\">npm i -D sass<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c \u0444\u0430\u0439\u043b <strong>index.css<\/strong> \u0432 <strong>index.scss<\/strong>. \u0422\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0443 <strong>main.jsx<\/strong> \u043d\u0430 <strong>main.tsx<\/strong> \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <strong>App<\/strong> \u0438 \u0444\u0430\u0439\u043b\u0430 \u0441\u0442\u0438\u043b\u0435\u0439 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c.  <\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u0448\u0438\u0431\u043a\u0430 TypeScript<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <strong>.tsx<\/strong> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>index.html<\/strong> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.  <\/p>\n<figure class=\"full-width\">\n<div><figcaption>index.html<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0430\u043f\u043a\u0438 <strong>src<\/strong> \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b <strong>declaration.d.ts<\/strong> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. <\/p>\n<p><strong>declaration.d.ts<\/strong><\/p>\n<pre><code class=\"typescript\">declare module '*.scss'; declare module '*.jsx';<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0441\u0442\u0438\u043b\u044f\u043c. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438 <strong>src\/UI\/UI.module.scss<\/strong>. \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043c \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u0442\u0438\u043b\u0438 \u201c\u043f\u0440\u0438\u0446\u0435\u043b\u0430\u201d \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u201c\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438\u201d.  <\/p>\n<figure class=\"full-width\">\n<div><figcaption>main.tsx<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <strong>SCSS<\/strong> \u0438 <strong>TypeScript<\/strong> \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>\u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u0443\u0442\u0438<\/strong> \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0444\u0430\u0439\u043b\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0443\u0442\u0438 \u043d\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.  <\/p>\n<p><a href=\"https:\/\/github.com\/JI0PATA\/fps-game\/commit\/f3f87e0c0024cf25992b31a9d571ab6b132e7492\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/a> <\/p>\n<h4>\u0421\u0447\u0451\u0442\u0447\u0438\u043a \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432  <\/h4>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448\u0435 \u043e\u0440\u0443\u0436\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0440\u0435\u043b\u044f\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043b\u0438\u043c\u0438\u0442\u0430 \u043f\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430\u043c. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043b\u0438\u043c\u0438\u0442, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>zustand<\/strong> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438 <strong>src\/store\/RoundsStore.ts<\/strong>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>TypeScript<\/strong>. \u0417\u0430\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043e\u043f\u0438\u0448\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0430\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0412 \u043d\u0451\u043c \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e: \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>defaultCountOfRounds<\/strong>), \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0430\u0442\u0440\u043e\u043d \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438 (\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u0447\u0438\u0441\u043b\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e).<\/p>\n<p><strong>RoundsStore.ts<\/strong><\/p>\n<pre><code class=\"typescript\">import {create} from \"zustand\";  const defaultCountOfRounds = 30;  export interface IRoundsStore {     countRounds: number;     decreaseRounds: () => void;     reloadRounds: () => void; }  export const useRoundsStore = create&lt;IRoundsStore>()((set) => ({     countRounds: defaultCountOfRounds,     decreaseRounds: () => set(({ countRounds }) => {         return {             countRounds: Math.max(countRounds - 1, 0)         }     }),     reloadRounds: () => set(() => {         return {             countRounds: defaultCountOfRounds         }     }) }));<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432. \u041f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0443\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430: <strong>src\/UI\/NumberOfRounds\/NumberOfRounds.tsx<\/strong> \u0438 <strong>src\/UI\/NumberOfRounds\/styles.module.scss<\/strong>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0438\u043b\u0438 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p><strong>styles.module.scss<\/strong><\/p>\n<pre><code class=\"css\">.rounds {   display: flex;   align-items: center;   justify-content: center;   width: 60px;   height: 60px;   position: absolute;   right: 40px;   bottom: 40px;   background: rgba(255, 255, 255, .8);   font-size: 40px;   border-radius: 10px; }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u0430\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430. \u0412 \u0444\u0430\u0439\u043b\u0435 <strong>NumberOfRounds.tsx<\/strong> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c <strong>useRoundsStore<\/strong> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432. \u0410 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043b\u0438\u0431\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432, \u043b\u0438\u0431\u043e \u043a\u043d\u043e\u043f\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0436\u0430\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u043c, \u0431\u044b\u043b\u043e \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u201c\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438\u201d \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412 <strong>.env<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044f: \u043e\u0434\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438, \u0432\u0442\u043e\u0440\u043e\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0436\u0430\u0442\u044c.<\/p>\n<figure class=\"\">\n<div><figcaption>.env<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0430\u0439\u043b <strong>NumberOfRounds.tsx<\/strong>.  <\/p>\n<pre><code class=\"typescript\">import {useRoundsStore, IRoundsStore} from \"@\/store\/RoundsStore.ts\"; import styles from \"@\/UI\/NumberOfRounds\/styles.module.scss\";  const RELOAD_BUTTON_NAME = import.meta.env.VITE_RELOAD_BUTTON_NAME;  const NumberOfRounds = () => {     const countOfRounds = useRoundsStore((state: IRoundsStore) => state.countRounds);     const isEmptyRounds = countOfRounds === 0;      return (         &lt;div className={styles.rounds}>             {!isEmptyRounds ? countOfRounds : RELOAD_BUTTON_NAME}         &lt;\/div>     ); };  export default NumberOfRounds;<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e <strong>TypeScript<\/strong> \u0432\u0441\u0451 \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0442\u043e \u043e\u043d \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441, \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>.env <\/strong>\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b <strong>tsconfig.json<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <strong>types<\/strong>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>tsconfig.json<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>declaration.d.ts<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430\u0448\u0435\u0433\u043e <strong>.env<\/strong>, \u0447\u0442\u043e\u0431\u044b <strong>TypeScript<\/strong> \u043c\u043e\u0433 \u0432\u0441\u0451 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c.  <\/p>\n<figure class=\"full-width\">\n<div><figcaption>declaration.d.ts<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0451\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0443 \u043d\u0430\u0441 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 &#8212; \u043f\u0440\u0438\u0446\u0435\u043b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 3D. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <strong>src\/UI\/UI.tsx<\/strong>.\u00a0<\/p>\n<p><strong><em>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435. <\/em><\/strong>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0442\u0443\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: <strong>useAimingStore<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 <strong>src\/store\/AimingStore.ts<\/strong> \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043c \u0435\u0433\u043e \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0438\u0434\u0443. \u0418\u0437 \u0444\u0430\u0439\u043b\u0430 <strong>Weapon.jsx<\/strong> \u0443\u0434\u0430\u043b\u0438\u043c \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <strong>Weapon.jsx<\/strong> \u0438 <strong>Player.jsx<\/strong>.<\/p>\n<p><strong>AimingStore.ts<\/strong><\/p>\n<pre><code class=\"typescript\">import {create} from \"zustand\";  export interface IAimingStore {     isAiming: boolean;     setIsAiming: (value: boolean ) => void; }  export const useAimingStore = create&lt;IAimingStore>()((set) => ({     isAiming: false,     setIsAiming: (value) => set(() => ({ isAiming: value })) }));<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>Weapon.jsx<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>Player.jsx<\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0430\u0439\u043b <strong>UI.tsx<\/strong>. \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043c \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0446\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u043d\u0435 \u043f\u0440\u0438\u0446\u0435\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \u043c\u044b\u0448\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0443\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <strong>NumberOfRounds<\/strong>.  <\/p>\n<p><strong>UI.tsx<\/strong><\/p>\n<pre><code class=\"typescript\">import NumberOfRounds from \"@\/UI\/NumberOfRounds\/NumberOfRounds.tsx\"; import {IAimingStore, useAimingStore} from \"@\/store\/AimingStore.ts\"; import styles from \"@\/UI\/UI.module.scss\";  const UI = () => {     const isAiming = useAimingStore((state: IAimingStore) => state.isAiming);      return (         &lt;div className=\"ui-root\">             {!isAiming &amp;&amp; &lt;div className={styles.aim} \/>}             &lt;NumberOfRounds\/>         &lt;\/div>     ); };  export default UI;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0430\u0442\u0440\u043e\u043d. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>decreaseRounds<\/strong> \u0438\u0437 <strong>useRoundsStore<\/strong>. \u0410 \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u0430\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0442\u0440\u043e\u043d\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e 0, \u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>reloadRounds<\/strong>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0432<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-365566","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=365566"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365566\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}