From add6d625b173bbca970b88aced5d78a4a5e97ce2 Mon Sep 17 00:00:00 2001 From: Simon Giesel Date: Thu, 26 Apr 2018 20:18:34 +0200 Subject: [PATCH] Add more features --- TODO.md | 4 +- assets/NoSleep.min.js | 2 + assets/block_dirt_x2.png | Bin 0 -> 1771 bytes assets/block_grass_x2.png | Bin 0 -> 2074 bytes assets/char_luigi_x2.png | Bin 0 -> 930 bytes assets/char_luigi_x2_left.png | Bin 0 -> 933 bytes assets/char_mario_x2.png | Bin 0 -> 983 bytes assets/char_mario_x2_left.png | Bin 0 -> 969 bytes server.js | 13 ++- src/views/client.hbs | 34 ++++-- src/views/server.hbs | 210 ++++++++++++++++++++++++++-------- 11 files changed, 201 insertions(+), 62 deletions(-) create mode 100644 assets/NoSleep.min.js create mode 100644 assets/block_dirt_x2.png create mode 100644 assets/block_grass_x2.png create mode 100644 assets/char_luigi_x2.png create mode 100644 assets/char_luigi_x2_left.png create mode 100644 assets/char_mario_x2.png create mode 100644 assets/char_mario_x2_left.png diff --git a/TODO.md b/TODO.md index 90cf64d..123d946 100644 --- a/TODO.md +++ b/TODO.md @@ -1,2 +1,2 @@ -* Fix collision while in air -* Fix jumping while in air (disallow) \ No newline at end of file +* Detect duplicate connection +* (add trampoline) \ No newline at end of file diff --git a/assets/NoSleep.min.js b/assets/NoSleep.min.js new file mode 100644 index 0000000..3768ef7 --- /dev/null +++ b/assets/NoSleep.min.js @@ -0,0 +1,2 @@ +/*! NoSleep.min.js v0.7.0 - git.io/vfn01 - Rich Tibbett - MIT license */ +!function(A,B){"object"==typeof exports&&"object"==typeof module?module.exports=B():"function"==typeof define&&define.amd?define([],B):"object"==typeof exports?exports.NoSleep=B():A.NoSleep=B()}(this,function(){return function(A){function B(e){if(Q[e])return Q[e].exports;var o=Q[e]={i:e,l:!1,exports:{}};return A[e].call(o.exports,o,o.exports,B),o.l=!0,o.exports}var Q={};return B.m=A,B.c=Q,B.d=function(A,Q,e){B.o(A,Q)||Object.defineProperty(A,Q,{configurable:!1,enumerable:!0,get:e})},B.n=function(A){var Q=A&&A.__esModule?function(){return A.default}:function(){return A};return B.d(Q,"a",Q),Q},B.o=function(A,B){return Object.prototype.hasOwnProperty.call(A,B)},B.p="",B(B.s=0)}([function(A,B,Q){"use strict";function e(A,B){if(!(A instanceof B))throw new TypeError("Cannot call a class as a function")}var o=function(){function A(A,B){for(var Q=0;Q.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return o(A,[{key:"enable",value:function(){n?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location.href="/",window.setTimeout(window.stop,0)},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){n?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),A}();A.exports=E},function(A,B,Q){"use strict";A.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9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0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}); \ No newline at end of file diff --git a/assets/block_dirt_x2.png b/assets/block_dirt_x2.png new file mode 100644 index 0000000000000000000000000000000000000000..cfc8f3c0157ae95ef11cdffdc56702584fa21da4 GIT binary patch literal 1771 zcmV;P)WFU8GbZ8()Nlj2>E@cM*00vJu|Z5nMM2@ zcdxZ|+E(G0{Bc{q$GGdX?DGo)^9`&mu3KxH6XWvF68Dd78V%&Z_k&N^|NQgOiK}f} z^n{1;6PE}2OynBajS+(rD*bpvm9=5W%*+L$7(e6&T<_ocIFN_ixd`}9iIHd zMvOWQfL$Ob1ra(Unng6`w-^`pcg+sUEhX9OW`Tu(HG%eBj}m$MnE`b^l>?0AwZ7Q&LqcMGArskQH1&iy zP%d6y^1fJ&oz<=mKsAV&(fS=)dBskOMpqN}E3x*}1fuDo<>4`|tnzq|5~IjEia%-T0 zLxQenTm(QvPpSUE4c{pK12DyT zmUx)yki1%)Hrg4|S^#=s;EAI)V6NGWg09w9Ootl&48__72Xj-Lk6#3+gR`@y&P$16 zEP**{BTDE$x9bU~iN0wic~^(K7GQ1NN=h_;SBG(a za&UWFy9Z~L*;U|~W2$QpSv8jCC4b2>UH?ZOt5BGXy25o4FqR_9@7XKcy04_VYM)(# zti(T<$=RV-f>4Vj&#iWsX>5BtO}b{uYk{ALqXNb6E&@tf()kI3)rZc+rW1nl`=k68 zCm639moy`})BxMs;oK0LwBbcKu0<@dUWu}yVHx_OuXOf4v_Y1Nf!0??N z7J`Q85xB<#$O-lq=d7cEb>W_Ni-!{uE&`sIWw%rlwN`+q(=^w2Z{hxV^%n15kGtw^Nm{Gu8}IkAKmdGc@1V(HVN&;3T947V3p_ zQf@>@{9n$IdWoFPpl`Y=6h(Rw@N{sT+r#=vN?*Ua#JaxFWE<@0d^g`8ouw~+1210N zH<_YBvI@?hQcFM)x@51509`HBYH4=0cLd0j6{G|7c|D+xY_2Ob>O4e-)E3fp*4khC z|I{ZCedE#yc@Y4gy=F;_$h$zLj*#SQWpN-XSqJD0m}q%;fG!?nNl)_jiqcDWIi?ug zF^b=hxCoeCKeMfyTi!j#`jb4^(Xkg#@#)TrQ~KYlKjXUJ?CekU`hfNxm*^B^sjCAd z3;0X@{Hzfc)%9DbiSOPEG#>PQB`ZRg4v;Fbsar{&kH0xn*nT?JeJNN*_C^p}70VVr^G%h{+OP0mr*v5lG830yOqbb%6q=)B*m|d4l^KFK@Ki_(9aK>k0mR{sHF%^BJJfwx$38 N002ovPDHLkV1ggELWlqW literal 0 HcmV?d00001 diff --git a/assets/block_grass_x2.png b/assets/block_grass_x2.png new file mode 100644 index 0000000000000000000000000000000000000000..5ab181d6d7ac03452d4c066add3037e63c47e75b GIT binary patch literal 2074 zcmV+#2<7*QP)WFU8GbZ8()Nlj2>E@cM*00(|aL_t(|+U;9QcHB4& zBtiDqc9J*qUQRamzrZY4tTo zIJ}WU{Lpf7^ASLfAb~b4Ckf0YG`3KOO@psmc|Nti^{mh;`^3ccya!* zZ#O^RM)3IEN5->%oJH0|fcmb|<=EFbjLBEn-49>QD~Q-2n-+P<&QXID52MENzE*aG z4JueTV(I|l0ILInuJl-;#S%7_SQKOUSoz7kjcvSkz!2rB79+CnC%Pp$jw$_mt6=#Y zhYE7)06~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bUN_yB4c~5Yxf^>Au&_%$uDt=Dj!H)6VSd@aDt!_kF+jW(_##*ySb@ z0(yTpZ@>rDAYd}QlCe@#>wf0=#bm}%ix2=408Dcm)bWwHFQjA{9JBUh~FE#nmkUK&&<5idf(X)zXvjiZ*UPSxv+p5wBhfew7{SkL`)4 zth^*2Azo)X>P-MB{AN8ecA=}{^{KhVis!e^M{NnolhjsvG~R6jz(6vM@;UBp>MQ`@ zOKy$1{{H;3?fv5QbpU|54_|{l+t-R-c(A=i=zE?NX=1b&05EmywIUtkn`ED-JR(x$ zB_hP1=e;Dahun%hH8I-4c!x*<%kr-}eDRW#w*v1W*GWy@;PZs$y6J1DgziVbf1dee z$n7D1*5~DxOti5b0I*re#R1^N__Mqka~a`lMTx(R>ySliDXatzhLR z^zXZmj{ty?&k@_|a!P1*2+`Xdey7YSshwtd^{ebb?@8vkFLk8USxTNmzVE`0J-x^z zIQ8E8?x2xqC(UX#A}t}`s?3UvXhN&Ewhsps4k#Q@IG}Jqs;tXIdujCv@q5on;Zqr00000NkvXX Hu0mjfES;~= literal 0 HcmV?d00001 diff --git a/assets/char_mario_x2.png b/assets/char_mario_x2.png new file mode 100644 index 0000000000000000000000000000000000000000..0b290cd7e8a945d6f68097fe2b4652d1f52a080a GIT binary patch literal 983 zcmV;|11S87P)WFU8GbZ8()Nlj2>E@cM*00TQoL_t(&-tC!BXcIvc z#=o^`n-C&3O=)8rwWmVup@@P81W$noB8Y+&FDm5VK`7!)L`3jVB&Ek3DhU1or67WV z2tDe-gO~Q;wXG(#Nvni3sa4m*=1FIq-JK>;ceeX3o5{{@W`6nJdoyn|w8(CT!@AY| zyQ{03%zJjhVW!D;oE#q30iakYH1&gaq#Q@cXGVgzM#-dRX8{2FMn|EfhI~AkYPk#m zs8lNdWkAmJvVTQ}v~)Wj2LMd3uWM=$x)+NvUS&t#zz1E=hAa(u7`X)nYD6-A#>yM5dgr%^gH1Thz!|EA#ZYj zPH`{e37L^0?eJuHTUuJQ?04*XR#Qtub|y>4Ok2vXhkg?x?eIogGSdh}WV7d}ADLY| za(<+KpSh?5K&@PodI1s0yjZZzb$rfJcVD($BX3HbhGn)_-^<8kwPP1|#uDuP*J;&r zS+m~8d!20DQNKR)_I{G~ZR9Q;GK98EMqNSzQbMf&h}Ow8Rbo?*Q2)@>cK}E(-)gh! zm+id+0QmUfn&v7(GP$e`00u)L06?|Avt8cU008Li?JXUUI)wU%rgSM0Zf**nYg9{) zBjgRJX)n9FKEZewZ;$<_003RyU*>5@(kMdn_NDm7&{D*x)CarI8#T+)Q*CDv>h0_l zk|HuYPeWCkvyTh4mqt7)wuY2?ZlBf?NNWiMfPpT_ z9o~Q%-IwWGbJe(>6Xv!=YLNM!>P2Q1d-vutv#j4}U+=vo*)(sVviWT?MV_O8(hQl37z%N?CW+hr9v(bq$eryuWN~ z?axeZ3bL-R)&&-enf4&m4^Gsek+m05kK&pYC2UQq7RJL!nnp zyC?X^kt~%=YBHqMC3O72ZXqE75mU(ZD;*#G5D{}6pWFU8GbZ8()Nlj2>E@cM*00S*aL_t(&-tC%ANEBfh z$A43%>n=-vY^kMojI>LKpbR>A5DX%age>S_u!jy}gohv^B)Ui#9XbfrB`PSq1PPvk zz=9$?sNks&wOw&nqh)i=Vmgd3?!3eLVpEGc%f+ga94j`{X15Bkk=4k&-2oD>_1DJM}|}c-*ud z3WWf;-_oLIlk$#-dV@h7;P%8sLEdqaAXOO-7ipFW5<&+80n5N2nGD+*Clm5cmdST$ zC#N_kGTyD!U9Azz-j!PY13V^A=|NyiuwB3)-

}xW%V$-6>?C_fjEC<2K4qL=vc1g7J5~GI{MO<3G5}sh$AGQRG{#4) z+`6 z=6lGWb#%2x#KrFg7@bb6SgnG{UdlJqyf { type: getPlayerFromId(req.params.id).type, }); else - res.render('client', { layout: false }); //TODO change to error + res.render('error', { layout: false }); }); const monitorNSP = io.of('/monitor'); const clientNSP = io.of('/client'); +let count = 0; + clientNSP.on('connection', socket => { let id = socket.request.headers.referer.split('/').slice(-1)[0]; if (!getPlayerFromId(id)) { console.error('Wrong ID'); return; } console.log('Client connected.'); monitorNSP.emit('clientConnect', getPlayerFromId(id).type); - - // monitorNSP.emit('updateGameState', 1); + count++; + if (count === 2) + setTimeout(() => monitorNSP.emit('updateGameState', 1), 2000); let pl = getPlayerFromId(socket.request.headers.referer.split('/').slice(-1)[0]); socket.on('moveStart_left', () => { diff --git a/src/views/client.hbs b/src/views/client.hbs index f5ad3b9..3c93ae7 100644 --- a/src/views/client.hbs +++ b/src/views/client.hbs @@ -1,6 +1,7 @@ MARIO Controller +