From 4b367091d5e0a78977c079a334d9438fb3a92495 Mon Sep 17 00:00:00 2001 From: s434585 Date: Wed, 10 Jan 2018 02:07:28 +0100 Subject: [PATCH] Add test_question to project --- .gitignore | 1 + css/style.css | 1 - js/script — kopia.txt | 49 +++++++ js/script.js | 34 +---- js/snake.js | 267 +++++++++++++++++++++++++++++---------- package-lock.json | 16 +++ przejsciowy/bg.png | Bin 0 -> 15542 bytes przejsciowy/coin.png | Bin 0 -> 15233 bytes przejsciowy/ghost1.png | Bin 0 -> 16358 bytes przejsciowy/ghost2.png | Bin 0 -> 16480 bytes przejsciowy/index.html | 207 ++++++++++++++++++++++++++++++ przejsciowy/pacman.png | Bin 0 -> 16739 bytes przejsciowy/snake.css | 55 ++++++++ przejsciowy/snake.html | 42 ++++++ przejsciowy/snake.js | 143 +++++++++++++++++++++ przejsciowy/wall.png | Bin 0 -> 4202 bytes snake.css | 71 +++++++++++ snake.html | 62 +++++++-- wytyczne => wytyczne.txt | 0 19 files changed, 834 insertions(+), 114 deletions(-) create mode 100644 .gitignore create mode 100644 js/script — kopia.txt create mode 100644 package-lock.json create mode 100644 przejsciowy/bg.png create mode 100644 przejsciowy/coin.png create mode 100644 przejsciowy/ghost1.png create mode 100644 przejsciowy/ghost2.png create mode 100644 przejsciowy/index.html create mode 100644 przejsciowy/pacman.png create mode 100644 przejsciowy/snake.css create mode 100644 przejsciowy/snake.html create mode 100644 przejsciowy/snake.js create mode 100644 przejsciowy/wall.png create mode 100644 snake.css rename wytyczne => wytyczne.txt (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/css/style.css b/css/style.css index 9cc943b..556ad37 100644 --- a/css/style.css +++ b/css/style.css @@ -38,7 +38,6 @@ div#pop-up-police { box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); } - h1 { font-family: headersFont; font-size: 80px; diff --git a/js/script — kopia.txt b/js/script — kopia.txt new file mode 100644 index 0000000..664a44c --- /dev/null +++ b/js/script — kopia.txt @@ -0,0 +1,49 @@ +$(document).ready(function() { + console.log("ready"); + $(document).on('keydown', function(e){ + if(e.which == 37){ + $("#move-left").attr('id','char-pants-left'); + $("#char-arm-left-up").attr('id','char-arm-left'); + $("#char-arm-right-up").attr('id','char-arm-right'); + $("#char-container").css({ + 'left': '-=2rem', + }) + $("#char-pants-left").attr('id','move-left'); + $("#char-pupil-left").attr('id','char-pupil-left-move'); + $("#char-pupil-right").attr('id','char-pupil-right-move'); + $("#char-arm-left").attr('id','char-arm-left-up'); + $("#char-arm-right").attr('id','char-arm-right-up'); + } + if(e.which == 38){ + $("#char-arm-left-up").attr('id','char-arm-left'); + $("#char-arm-right-up").attr('id','char-arm-right'); + $("#char-container").css({ + 'top': '-=2rem', + }) + $("#char-arm-left").attr('id','char-arm-left-up'); + $("#char-arm-right").attr('id','char-arm-right-up'); + } + if(e.which == 39){ + $("#move-right").attr('id','char-pants-right'); + $("#char-arm-left-up").attr('id','char-arm-left'); + $("#char-arm-right-up").attr('id','char-arm-right'); + $("#char-container").css({ + 'left': '+=2rem', + }) + $("#char-pants-right").attr('id','move-right'); + $("#char-pupil-left-move").attr('id','char-pupil-left'); + $("#char-pupil-right-move").attr('id','char-pupil-right'); + $("#char-arm-left").attr('id','char-arm-left-up'); + $("#char-arm-right").attr('id','char-arm-right-up'); + } + if(e.which == 40){ + $("#char-arm-left-up").attr('id','char-arm-left'); + $("#char-arm-right-up").attr('id','char-arm-right'); + $("#char-container").css({ + 'top': '+=2rem', + }) + $("#char-arm-left").attr('id','char-arm-left-up'); + $("#char-arm-right").attr('id','char-arm-right-up'); + } + }) +}); \ No newline at end of file diff --git a/js/script.js b/js/script.js index 11a7974..e247dac 100644 --- a/js/script.js +++ b/js/script.js @@ -13,25 +13,6 @@ $(document).ready(function() { $("#char-pupil-right").attr('id','char-pupil-right-move'); $("#char-arm-left").attr('id','char-arm-left-up'); $("#char-arm-right").attr('id','char-arm-right-up'); - var positionCharXCornerLeft = $('#char-container').offset().left; - var positionCharYCornerLeft = $('#char-container').offset().top; - var positionCharXRightCorner = $('#char-container').offset().left + $('#char-container').innerWidth(); - var positionCharYRightCorner = $('#char-container').offset().top + $('#char-container').innerHeight(); - - //https://stackoverflow.com/questions/8872578/if-element-is-over-another-element - //uproscic kod(funkcje/zmienne); - var positionXPoliceBuildingCornerLeft = $('#police-building').offset().left; - var positionYPoliceBuildingCornerLeft = $('#police-building').offset().top; - var positionXPoliceBuildingCornerRight = $('#police-building').offset().left + $('#police-building').innerWidth(); - var positionYPoliceBuildingCornerRight = $('#police-building').offset().top + $('#police-building').innerHeight(); - - if(positionXPoliceBuildingCornerRight>positionCharXCornerLeft && positionYPoliceBuildingCornerRight>positionCharYCornerLeft && - positionXPoliceBuildingCornerLeft parseInt(highest)) { + $('#highest').text(current) + } + + } + + function placeFood() { + food = { + x: Math.round(Math.random() * (w - cw) / cw), + y: Math.round(Math.random() * (h - cw) / cw) + } + } + + function placeSnake() { + snake = { + x: Math.round(Math.random() * (w - cw) / cw), + y: Math.round(Math.random() * (h - cw) / cw) + } + } + + function blank() { + //Paint The Canvas + ctx.fillStyle = "black"; + ctx.fillRect(0, 0, w, h); + ctx.strokeStyle = "white"; + ctx.strokeRect(0, 0, w, h); + + } + + function check_borders() { + if (snake.x < 0 || snake.x > (w - cw) / cw || snake.y < 0 || snake.y > (h - cw) / cw) { + stop(gameloop); + showGameOver(); + } + } + + function paint_cell(x, y, color) { + ctx.fillStyle = color; + ctx.fillRect(x * cw, y * cw, cw, cw); + ctx.strokeStyle = "white"; + ctx.strokeRect(x * cw, y * cw, cw, cw); + } + + function check_food() { + if (food.x == snake.x && food.y == snake.y) { + var current = parseInt($('#current').text()); + current += 1; + $('#current').text(current); + checkScore(current); + placeFood(); + } -// moveSnake(); -}) + } + gameloop = start(); + placeFood(); + paint_cell(food.x, food.y, "grey"); + placeSnake(); + paint_cell(snake.x, snake.y, "green"); + + //Keyboard Controller + $(document).keydown(function (e) { + //39: RIGHT + //37: LEFT + //38: UP + //40: DOWN + var key = e.which; + if (key == "37") { + snake.x -= 1; + d = "LEFT"; + } else if (key == "38") { + snake.y -= 1; + d = "UP"; + } else if (key == "39") { + snake.x += 1; + d = "RIGHT"; + } else if (key == "40") { + snake.y += 1; + d = "DOWN"; + } else if(key == "32"){ + reset(); + } + + check_food(); + blank(); + color = "grey"; + paint_cell(food.x, food.y); + color = "green"; + paint_cell(snake.x, snake.y); + + }); + +}); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0a0da4a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,16 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "get-form-data": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-form-data/-/get-form-data-2.0.0.tgz", + "integrity": "sha512-YUpw0aTWeGliifqMYrTohe/YdqVmKLmaNwuscd2WlRNGfba57JHGuuvvv2c6LiZdFys285POVWANTh6SqcwFag==" + }, + "local-storage-library": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/local-storage-library/-/local-storage-library-1.2.5.tgz", + "integrity": "sha1-UtDZf8jD+ytC/bxMMLuNwd5IQHg=" + } + } +} diff --git a/przejsciowy/bg.png b/przejsciowy/bg.png new file mode 100644 index 0000000000000000000000000000000000000000..466840d8fbcf12a256bb02ea74f1348a8f0496ae GIT binary patch literal 15542 zcmeI3Pl()99LM7yq%JHdD#adZm|9RVlmD4X%uN5xY`Y7cx@=e6deFW}UUoufl9*&V zvwM)DJ+vZNdQk)q;!zR*;K_p`2n8?dpYUj(P=F4M0o(7iy~yZS3Ta#eohQwFfla%_rz?d+ zNkVq5vCP)|5VC4f<1A4wvn9PKs(M*c9%Us#)ObPXMTHYYL(mODWCx!@bq<}Gq3swe z^&^9H$f^`taU2*t-|O{?J-O(I>%6GzIxk4PByp$*7j1Yk=yP7QFAFk^Q-_fix805g58JQ^kGg*%m4B%)EBkcW1~FPbN#3LN-Gt8mmzYA&C8O)%V-gY?Un!5wf*fvZ_k# zLk(cLUc&WZlgCBl86U@kbr8d9qU8jQlY~`KHYCAN1x_d#f{+W6^~7Q{eA{(4ro>Q7 zhEmSQ$o0fypdDm`80;uYzHcs$Z5fUqc0gQpJ7691fwyk*s$}IHgpUxu(->awXf*fM%-_uwV+Y z(a6guLf3t(o9q`9Ix8)9TBbqF4f4Q-BiZ=(eReKye%`n=Oy`?F4*wd+X5AcGDUafG~o|4y+W0TX0m=Ml~zZq&wLFR#M%nRSxL?0@xnk=7*zz2RzK0? zC)&oVChNbJRMU1h?Jo)GhZmE>K%4jD+LM2w&HHifSo(zL##L#M4r|V-lBb~T27LlO zu*0gRsxsQ|cr&h8cKfisR(H{zG)nFWDjHa-!5veDCua$Bj)5?ntlXn@T0^r|^x%&E zGw`E74HM;cbRW8zC*u*_%&1r_ngjzvHYqMLAIwW}VL-?x#YN_Wc_}Uo2-&2#$b2v_ z#f1SOn-mwB59Xz~Fd$@;;v)0Gyc8D(gltk=WImXe;=+KCO^S=m2lG-~7!a~aagq68 zUWy9?LN+NbG9S!KabZBnCdEbOgLx?~3<%kzxX64kFU5rcA)6EznGfcrxG*4Olj0)t z!Mqd~283)JkWGq<%m?#QTo@3tNpX?+U|xy~141?_E;1j?OL1X9$R@=_ z=7V`DE({3Sq`1g@FfYZ00U?`2Tyx{saG{6Zz3riwYluWV`8!h^qld-Sz~FJ8EP*In$vv&=2Gj!!PD7mwY2dG{l4e)z_vA1>FY%54y-? OmKKiJ-#L8h`9A>=+tDHb literal 0 HcmV?d00001 diff --git a/przejsciowy/coin.png b/przejsciowy/coin.png new file mode 100644 index 0000000000000000000000000000000000000000..92318773066684ab6b2f00e442eeb8381168792e GIT binary patch literal 15233 zcmeI3dsGuw9>+(imc_N8RoZP&-570AF_}CFB(ouai3-&S0@hgBBg13@Q<6+b1`}{k zwP-znyB^ThR-ortSZ#HEK-IJB*6RA|!>z0MsH@#mDXp$rkFIMMWkuXONeGt^dfT4< zd2^D?FZX`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{>GdaHklfJU25F+wWoXCmq(6gZ(f`;d|Em)=I-bzQT4W)-xfQU#%1G0sSv@xrRO!^M-mh93|GezbyjMTovH!t^rs^{zx14Fxov$8qW&Eyb zE8--b|GcPL`&D}_wRvxYIU~7L+q!$d(DKKoa$k1M$;O}mxAO7yy<@E^&B(i+lb8Qe`q-2!V>LZ#miNYgckhZ;o{?me__5S)7*WLx$~<%d$@z+4&S4Q z&iz$WwyW=)Ui0j+#SeEp8C$t&$?5yOmnPQetyLXpn%?HPS8%{xbNLVTub-H^ z_N`?PHa&Xz`3s54<;%K9T)VY#)xKw15*}=7yuNaJ2brigHoX-8GQF`S;X>a1g6zlY zJJvs!Y)_hdXt(>{IceDwM$b60CL?vt?&)#91HOZ6>+3Tnr0raHD&bG11J-dQH!(E8!&x?v_MH#w%eEO7~6a`j)6<2oJ; zpZfMo>h!n1XnNu7hMVyRWp!5?v$k}0xt^=b-CMf7t10e{Gc{*hi{ literal 0 HcmV?d00001 diff --git a/przejsciowy/ghost1.png b/przejsciowy/ghost1.png new file mode 100644 index 0000000000000000000000000000000000000000..8b8d7b35cc12322c440af45d894c291f336a537b GIT binary patch literal 16358 zcmeI3dpuNmAIB%PTPcsCRETN1C>k?k%rIk2x#c>-kYp=k=3p{6b72%^(?x|Mxm0f5 zi>OqhEhU$YQo<^15~UkjwMsqZIfFP!dv>4K{&|kqIN$mGKA-RRocHfC=by8~#o1Ox zSyLH>LaEr>S-XK}BgJRJkKliuB~fR=(?pS-mjwJ)toV!(+?CN$C{ul|`%39bh7*-7 zM87^om zp%_4u49QqFfoO_0p%@ZK6jLMP#b_fufsDgba0Fv4oh<#Zqn4IPZGu4rgGfhp zO58(50L~4N2xVe6U=s}9%G}ZJUdr_w9-OZ-DSEzp?SP#79h;(Oz}7z%21bYm-YeBg z46vj^vAa;nqYun7moEs>R#u8xWrAMFV6nLZ1=mG1+(^^#h!5ujtXWckuJB^ku;~_}~lp}I5gdDD4=x8~>G(>0)h;n2Oa0PK#Qr6$f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rJUQ$=!-QZ=WzxQC%>(_Oup1HuY&)0axhnPvg$yO%HE`I7tQdrM5eq zZf{jyD8Cv_7 zHEaYn z_Gjfmw^IRfW_)7W znyjtEthq`jeYbNvyaJ}OU_T9A(;DuMb=Hra@92SxSIOl@InH`*6O*R3=sqWTiT6}a zS?u%FHa|;Q{L8#X%t7w3%C7qxIW@NW+cM{cVV)h^`)%2<2}7@E;%%#*KHV$3K(b6x z3Ql5%T2{XkX&%uFZ*1=RgJ9}7C-_$VgR@MhVaYkOk^-JL-ahu>!>JcZTA>T?1lpS# zhlHBbB%jt$I~vB1D_6*1wtn6+qRAuw;O6nO?az%?zW+SkWK3nDFKJt`(k|A}vfTE^ z8lTUn`(dwK8D4wgsqA#oO>985w@P+S-myKaG}V|YX|5wTJxMQAQ5l`d{G40*HNh;` z(A>*g7Uiko`RU1%xTiN0%+zyJ6Cagas#GiVOyWGqZTl$n@!s^dCU=JHbH_?EiO@%| zFEwdnTyF4m-Mh8ccW$q}*ikSyc42H{4bNmlVhxj1W85SzeQ*$r)UxD3yVP}HR>Dnn z-IzHllW%yA7_EMZMVwks$(S=C+_&r7*TABPv)r0!N8POEoDfw{;(ntNpW6kU*G?+p z>GY|hrj$c*tG~Y26}8>ZFplM9k!vK0ZF}7&lr?yI-d=m7@*TdSqGG~so9a`m_PlcI zsM;?n&&wgW%oE74d3Z9pBtLZH-r#`5=hmBRsz2fh$DSge<9>QbCbEmAa}yYrORyd4aCN + + + PacMan + + + + + +
+ +
+ + + + + diff --git a/przejsciowy/pacman.png b/przejsciowy/pacman.png new file mode 100644 index 0000000000000000000000000000000000000000..0714bf541f9f9ce49a000ea2e3976b58fd0b1c98 GIT binary patch literal 16739 zcmeI4dpuNmAIAq#$&^%^Bu$fSXv~apn=!`yRuSVG!k9TRE;D0h+*7C(U8RJ=s+5+b z5Ms-%2uX`}S8b)uC3Hn3R9Tld%GvC>2D~Zky zP@^%}UVvI?07sxkAjtZm92(sZ;G?_%Zzf9*{ieJEjbbwN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K@Nsc)+=nNxx}KD;p?+4X-@W~61XU!i^Oog}6Xre6;v@=6??g{~PsGReZ3P=! zvI^~PA5Y37JoBhZsOjHBs2@IcGxONpS2kw!`3irvHS3Pcc|Q12yq1BRapk3(z`V&z1HSV_aoivtTFFT+J6Vq%W4H+e@H{Woz*7u>IjNEE* z$9vCsA=)FYXIDxe(mo)dj`u({--n zZ9b_z&+1hoDt14z&+K2kCST6EMk$xw@QHdi<6K8FT`wJo1=9D~lp18Qs7;Bd2X1fPjI)ZC zR*M*p4dg1RI=OmoeyTn|M#vprh}`{oQ0eBCGmC4A;_Ggu-ZUa6KGgZ-e(Oz2TXTVGeByHH7|c;c=L)^Z`6IGLN3WY z5(8Y}$M01LiuBOhydsR`D3`ukInrbQ@wNM|k7p=lgsB;5xS&Yy={}chdziBFiO$5m zf>pB1*DB+I>VZqw*By2A*tl%qd1dbLY>;a(WPO%s>4FC|_v0oGxAw{5y$u>LU115$##-~O1KW~odB~NfNn=NSV+zvh we^;lXkNE^O1ea~xFEJ`+;nt}mF|LmwN_+W_|7x2d{5J@erq(8xjXY!i1>qp>>i_@% literal 0 HcmV?d00001 diff --git a/przejsciowy/snake.css b/przejsciowy/snake.css new file mode 100644 index 0000000..0fc68e0 --- /dev/null +++ b/przejsciowy/snake.css @@ -0,0 +1,55 @@ +body { + background-color: rgb(226, 238, 159); +} + +#container { + margin: auto; + width: 600px; +} + +#myCanvas { + background-color: #000000; + border: 3px red solid; + +} + +#popup { + position : absolute; + top: 150px; + left: 300px; + font-size: 20px; + text-align: center; + color: rgb(100, 219, 223); + display: none; +} +#continue_game{ + display: none; +} +#correct{ + display: none; +} +#incorrect{ + display: none; +} + +#score { + width: 600px; + height: 100px; + margin: auto; + background-color: grey; +} + +#current, #highest { + font-size : 25px; + color: black; + text-align: center; +} + +a { + text-decoration: none; + color : #FFFFFF; +} + +span { + color : #FFFFFF; +} diff --git a/przejsciowy/snake.html b/przejsciowy/snake.html new file mode 100644 index 0000000..870d824 --- /dev/null +++ b/przejsciowy/snake.html @@ -0,0 +1,42 @@ + + + + Snake Game + + + +
+ + + Your browser does not support the canvas feature + +
+
Current Score:0 +
+
High Score:3 +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/przejsciowy/snake.js b/przejsciowy/snake.js new file mode 100644 index 0000000..556eaa3 --- /dev/null +++ b/przejsciowy/snake.js @@ -0,0 +1,143 @@ + + +$(document).ready(function() { + + var canvas = $("#myCanvas")[0]; + var ctx = canvas.getContext("2d"); + var w = $("#myCanvas").width(); + var h = $("#myCanvas").height(); + var cw = 15; + var food; + var snake; + var d = "RIGHT"; + + var gameloop = setInterval(update, 100); + + function update() { + if (d == "RIGHT") + snake.x = snake.x + 1; + else if (d == "LEFT") + snake.x = snake.x - 1; + else if (d == "UP") + snake.y = snake.y - 1; + else if (d == "DOWN") + snake.y = snake.y + 1; + + check_borders(); + check_food(); + blank(); + paint_cell(food.x, food.y, "grey"); + paint_cell(snake.x, snake.y, "green"); + } + + function showGameOver() { + + var current = $('#current').text(); + $('#final').text(current); + $('#popup').fadeIn(); + $('#yes').click(function() { + if($('#yes').is(':checked')){ + $('#correct').fadeIn('slow'); + } + else{ + $('#incorrect').fadeIn(); + } + }) + } + + function updateHighScore() { + var current = $("#current").text(); + var highest = $("#highest").text(); + if (parseInt(current) > parseInt(highest)) { + $('#highest').text(current) + } + + } + + function placeFood() { + food = { + x : Math.round(Math.random()*(w-cw)/cw), + y : Math.round(Math.random()*(h-cw)/cw) + } + } + + function placeSnake() { + snake = { + x : Math.round(Math.random()*(w-cw)/cw), + y : Math.round(Math.random()*(h-cw)/cw) + } + } + + function blank(){ + //Paint The Canvas + ctx.fillStyle = "black"; + ctx.fillRect(0, 0, w, h); + ctx.strokeStyle = "white"; + ctx.strokeRect(0, 0, w, h); + + } + + function check_borders() { + if (snake.x < 0 || snake.x > (w-cw)/cw || snake.y < 0 || snake.y > (h-cw)/cw) { + clearInterval(gameloop); + showGameOver(); + } + } + + function paint_cell(x,y, color){ + ctx.fillStyle=color; + ctx.fillRect(x*cw,y*cw,cw,cw); + ctx.strokeStyle="white"; + ctx.strokeRect(x*cw,y*cw,cw,cw); + } + + function check_food() { + if (food.x == snake.x && food.y == snake.y) { + var current = parseInt($('#current').text()); + current += 1; + $('#current').text(current); + placeFood(); + } + + + } + + placeFood(); + paint_cell(food.x, food.y, "grey"); + placeSnake(); + paint_cell(snake.x, snake.y, "green"); + + //Keyboard Controller + $(document).keydown(function(e){ + //39: RIGHT + //37: LEFT + //38: UP + //40: DOWN + var key = e.which; + if(key == "37") { + snake.x -= 1; + d = "LEFT"; + } + else if(key == "38") { + snake.y -= 1; + d = "UP"; + } + else if(key == "39") { + snake.x += 1; + d = "RIGHT"; + } + else if(key == "40") { + snake.y += 1; + d = "DOWN"; + } + + check_food(); + blank(); + color = "grey"; + paint_cell(food.x, food.y); + color = "green"; + paint_cell(snake.x, snake.y); + + }); + +}); \ No newline at end of file diff --git a/przejsciowy/wall.png b/przejsciowy/wall.png new file mode 100644 index 0000000000000000000000000000000000000000..a82535862c5a372519d3952393fd8c2ec8cc0b06 GIT binary patch literal 4202 zcmbtX2UHX377i>3qOb@mWdj={3hNru2!SC4g-B5;QZ(S=W0(X8ge0Uuq6nyG)@SJTdVYzqVJ>nk-$ky2&2HUzE28)Pddck185g1H^bF63sN$i-*v32LcVDr=^hYalKF-;gu@mGc`l~1)_4?yfd zLy*SyrW*Qvbnx!tf{Ff8iPaQa42yE ziYH?6K_QC8TRK59#Y3UHwEZ$^W;s((Y z4;pKTLC*%G3mM;mNj%?$(V*$BI07zH+7k^z)0y-@I*ZQ}oW5z<`lGjbW3&dfE# zGXqJ303S9t5ag2?fuJuP&0+bH&|i!*BBe?J#LfCLSRj+ah6EC2*-^-1hartY1H6eC zQ)43x9z~=1;88|IZ#>G>+Z%@>fF?!+AIQg>hV>?)zf1GCRJIHrpUoA`n4EZi(%tMr z5Bl0V^ z7Q_UbH0t{#3>J?MvLO28iZlN8ichf5fPX&+2uYOY-iseh>HyqM_*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%XDNRZs7VH%w7U%-6R-T+&> zJmz2-pcNUwjgD0vb|r2$XqX>#cj%?O_Vz2v?+@G-2BaoISAZU1`EEhB+PdBGyL0;2 zo_btmlHl#}M|wJT>i!&L~V}G*;$Z2jSQsnexhGZ%uJa@_#7yS=ixqX{nrx z+6t~pgatKLq^NIUgG^L%BxUH0*B+r=vbwv+OxEpT48*Ty>nCkI?AcmTveLEoG>O_P z(gUFF4QI@Ye*celAZ|6cU%&b_XOk_wDL{6G%+P`MlIN=BW>8KLbxdu;oU-nXUOj(V zdv()w&Ae^g-S=gi<=}PA?jO_NMzyULmM@$w48 z>6X1nhNqx)e%(`;CWE4dNB5`&C_TEm&GU&u!-#;jK8`ASmcQ8L zng3_u*o)}A`K87Dvl{IhrY*gEWz6y>DF`g9V&<4dBb@@j57kC z#Mqz$ikBiH#8Lj>51MHRxMss0^2J=g{!} z@KZUb6mI3lKH&+qio=_KTvZ0wob#7Kq%17x;!ndO)}C+Sp-1Dp4m9LzhK;Iyz|f=tBS1m46Xp=AS_ nTEU0wIv3R!4t=WeZTXM3Q&@*VWI(FqPrcn52THD`*UtX}Dd}kn literal 0 HcmV?d00001 diff --git a/snake.css b/snake.css new file mode 100644 index 0000000..b6a2952 --- /dev/null +++ b/snake.css @@ -0,0 +1,71 @@ +body { + background-color: rgb(226, 238, 159); +} + +#container { + margin: auto; + width: 600px; +} + +#myCanvas { + background-color: #000000; + border: 3px red solid; + +} + +#add_question { + position : absolute; + top: 100px; + left: 1500px; +} +#popup { + position : absolute; + top: 150px; + left: 300px; + font-size: 20px; + text-align: center; + color: rgb(100, 219, 223); + display: none; +} + +#popup_question { + position : absolute; + top: 150px; + left: 1500px; + font-size: 20px; + text-align: center; + color: rgb(100, 219, 223); + display: none; + +} +#continue_game{ + display: none; +} +#correct{ + display: none; +} +#incorrect{ + display: none; +} + +#score { + width: 600px; + height: 100px; + margin: auto; + background-color: grey; +} + +#current, #highest, #session { + font-size : 25px; + color: black; + text-align: center; +} + +a { + text-decoration: none; + color : #FFFFFF; +} + +span { + color : #FFFFFF; +} diff --git a/snake.html b/snake.html index 6f7a448..1d3440a 100644 --- a/snake.html +++ b/snake.html @@ -1,20 +1,54 @@ - + + - - - - - The HTML5 Herald - - - + + Snake Game + -
-
+
+ + + + + Your browser does not support the canvas feature + +
+
Current Score:0 +
+
Session Score:0 +
+
+
+ + + + + - - - \ No newline at end of file + + diff --git a/wytyczne b/wytyczne.txt similarity index 100% rename from wytyczne rename to wytyczne.txt