From 1506fd6b4b96231366f2ecc1993d000249387a23 Mon Sep 17 00:00:00 2001 From: Krainova Anastasia Date: Sun, 27 Oct 2024 23:08:54 +0200 Subject: [PATCH] add task solution --- src/images/favicon.png | Bin 0 -> 11176 bytes src/index.html | 4 ++++ src/scripts/main.js | 13 +++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 src/images/favicon.png diff --git a/src/images/favicon.png b/src/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..d3c9beada1a321fc37171180e3b35fdc6469cb5a GIT binary patch literal 11176 zcmeI2bx>PR^yq^J4^mtL6n81s;#!KkdvPmTXo28bq(~_qoT4pWpm?D`i@UeDy9JVW zzkj@$H}n2{Gw-ioW->R~yLWf*IcImzIs1vz)>I+Hqrn4#K!h(<6?H)%G@k#yU~Hfy zFgVE%xM2Foztjf`>J=66>V}7#2c2GE)R!5$K}z92wB~ytnhhXsp_I%K5`oGs1R)Q%1k=y2|9^SV{)_m$@Ch|jtQU8fu3)__L|92Bj(;V4RZk!UcK zc^r;PLdu8`kY#hpK4D|9iD=Kd^}zHUTgJyec74~m6nOp^aZm@-J%Rqz9n*XK39=c| zfufPB$v2{rxX3AwXBU!dS7rr|&J$&w{5EO1b9JvWtI`q|YQ5HF4#q{JWR=Q0$B4G+ zrh3WFB$=U$sRTQK3}@8$chiq<)C3;D-s|y$ zqVMMejxC&zy7IXk<}vFyKLsv+{_x9Ln>+j`_N+d-#m%@5Mr)x`lP=B0q^V98Z2rTu znWh)9T}wZ|Ty0n7K=1U{>oMlp277I>;eA+S285lzS3qCPe>jr+yT?XfP`{B$Et$$xCjj#Yu@Q~4;u|ynr)U~KvggtxFitGaf zpxUbjo>0&D686c9|4V?^UP<0@pP6X&Tx0>HGLZo9iM&XTE~Y~oF?H9o1(E!hX2y7} z6BDF{^09k11bq`+#V}g-cSmn90C_%sAoIb9g4lk)MeFmM9!~AK8YHZ-TP0;^^*LhJ zJfK%Bv1e`oZj+#mx_x;ax)+Wg+IHbo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KAjm8{)@I3!4`aE&!5%qZ|&oBOVjp@ zTwWbVg-pJ0Zq(v=ec-pb**y9GNGYwLW2KBQpG}V4Oij`D=Hs41bqx z{H8tD1n97*jgb(&Emm^1t<%t*T1N4%RUvMGr=l+@)kBnX4bzrL_QfW`LA_e+F9;(0N>&+zRJo8^kq_{gJ|%)acibo z557vYu0zcKmK@(u#-3YKRs7VJq$_kO7fTj%00Fe@usYx3aZ%!f;jXdtxD@t$j!%fQ zQ!sCu@*a&vWb!YmEgLg>BXcVe+?XhI+vs70()@NLZ_2xNPkeVHTFkRmox}pGH+%7^ z3N9a$11zo(Pad0!IO6WR!~u?|=7B`{#d^$=OzVa>wpD4m>5)_T;o{WPW{v$nB7V*waOo0HdI1%z>F*-m(!V6F{q7X1qDzMc^;XyY-JkG z7T4H8{)4_q)hyKdUrA}*&|*X~MSSjoHFifjVH9yt#ez-A($TpxycmVuV+3197wYfs zn`de)*rk_GyYDXw-!KT~)sb6bl}W>-N(}(=%4Zr6qnN_p`#ER7K13-@5hM%y@)+tw z1*|wQE+~T_c7Wj73i!>*GGWe%JAi>&gcVa$o42RP2TRj6#1|saeDH*S<1i@{@jR^)xpnnh+$5GCYy+L;oV_A-omHH{!(eAmDDRor4ckvkNg8s+shq3|` QKyN`Wl{6J=<*md27fBofjQ{`u literal 0 HcmV?d00001 diff --git a/src/index.html b/src/index.html index c3566beb6..0c9ea4f80 100644 --- a/src/index.html +++ b/src/index.html @@ -7,6 +7,10 @@ content="width=device-width, initial-scale=1.0" /> 2048 + { document.addEventListener('keydown', (evnt) => { switch (evnt.key) { - case 'ArrowLeft': + case ARROW_LEFT: game.moveLeft(); break; - case 'ArrowRight': + case ARROW_RIGHT: game.moveRight(); break; - case 'ArrowUp': + case ARROW_UP: game.moveUp(); break; - case 'ArrowDown': + case ARROW_DOWN: game.moveDown(); break; }