From 3cbce7cddb2d9b275f021bdd77b6893944c44e86 Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Thu, 31 Aug 2017 13:54:57 +0200 Subject: [PATCH] Add fancy pixel font --- src/assets/PixelText.ttf | Bin 0 -> 7456 bytes src/assets/styles.css | 7 +++++++ src/bubble.js | 4 ++-- src/stasis.js | 13 +++++++++---- 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 src/assets/PixelText.ttf diff --git a/src/assets/PixelText.ttf b/src/assets/PixelText.ttf new file mode 100644 index 0000000000000000000000000000000000000000..bcb7cc48a9b882409966b5cea47f850780c4459e GIT binary patch literal 7456 zcmeHMTWl298UD{)c6N=iF=oxp3$_}Uv1iU@&VRoDe$LL2Afg)b$)pR14he zZ#zD)xAW^S_RkWDG4zKnPGqnA@DFFcOk^I!*zm>KnI>v6UM8~M#B=L~?DUm<9xGGh zE%c)=T>i?Xu{#Hvh-}brSR5P8j+j$BkK)-9u6<(|ux^UmSZfFRJH{qv=FYuJUqU~J z>-y!Xi`jqt^RusE=^x82#Y-j}t^&x-jeV`3e`TZ(24*oM^0SP4(KE+I4m7>o>$3Hg4Ly zWou(%+xDhrYDwrF8zRdndz5WA_A;u3MdE&{V zPaS*u_=#su4h)_ediM00;pfgie=ZF6KejIfbmxP{e_P9ZLT&nQKMm3hy@y!7CpL*L zF(}5wOX8d2yW(B(k@&jP2;v{m@Q_HIc(0FubV$JKQixHHP$Zc zh&5upWW8a%XMJcb*-^XAK4_2F*X_6MckSQXcO%u2uE>eV)yOv@KZ^V+ax3y_HYiOVLQQDS9A!Iyw{mc61@S7+s20$J%0EY&bR-doA{U?2oZ~RgG1t zsuTFT1nVJAMJJ-yB!~9g5VW^%!LjI0=Z%Pct8c+H(4-qC58FJv;6%i~`W9gNJDqM_ zb6u-jmuwO1K3!Zi=06*1F)jrj;UNZ0&O04xH{O~t+=StA@#Wov!r?h^mYndBe=x5; zBiw{Y%DeC7JV9!v$8#|;pObSp5^YQ;({4J6HLG8&|t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7y8NzcYVq5#^`SFaRp278b0?o1}vpn9z`_UCn>^yr%qz&*rt*Rki|G`#O6( zPN}Xs??6p*Z^%h`LyQ!fSg9z3qjI0*z>ua@3xK*nkVA({n2t~FkU_-@02!3e8+^bK zzMNj>#!^5B`pn8_-DJj*L10(RnoJY$tA3ksZjiFW83C*AVa%Yt91A{d^U*!wl;Mqs z0<0WjRbg>XkXQ_*^sK`*7p&oX%B~R1!><{s6B8(f32I$D#=kmCP(9Af;6vtZeR41u zT;_=T`yrn@@9&3!KX9J8zaMfGh0im=&UAl2T>Up1k`78v@b4%7oppadREgUU@;9^- z>@OaE!N}hN|Hu6h*w_zq^8Js@{QCWmeD}tij(iJL;5Oh|)x3d#f7lpncvu5@BA#*F zayy)ovlJ_MUnEb>2~qK_5su3~fYcs^wtQ=cUm<*sH4%X!t~5(PtHE~{<$Xlev_-cC zXnS=VA2et{w@qrGmv!61oS*8pP3!1m-HuR9Sg@9`u+P#aDG|2?t*2H!ZUF0X-8ShV z8rE$KbH1nBHZ{=)x*fszT{=lqG)*HkN|WGdjIwA?(ThYUr=~|nCkMu|BU9*|pmCbR zq|124Jc`x~hQ{YcFAt8+p?M5rBbafGCeRrj8NY_Q(#k#M77L^GgjQZ1cL=yw!TvZ{ zo`h&A{B_`y64xp8X=wE7^!U_dQ!3T5CzVQJWc3A=o%!9J3mva4SquqygNcl6BW9wo zR~1gC)rg)NU62AmT&;qC4goLL(wfiH#I!4keY;LFBNdH{CYg}1(K z)DBzi2Ge^b^PNEMqBQNJZhRYggnHmJeUzd7_%`C4jM*lQaw d#ybsbLFfyWn(>>@-}#t3H|N^>x#sVJ{{}tQjAQ@+ literal 0 HcmV?d00001 diff --git a/src/assets/styles.css b/src/assets/styles.css index 8f8ba22..30fb891 100644 --- a/src/assets/styles.css +++ b/src/assets/styles.css @@ -1,3 +1,8 @@ +@font-face { + font-family: pixel; + src: url(PixelText.ttf) +} + body { background-color: black; margin-top: 50px; @@ -46,4 +51,6 @@ canvas { display: block; position: absolute; text-align: left; + font-family: pixel; + font-size: 3em; } diff --git a/src/bubble.js b/src/bubble.js index 40a49ad..f2c1926 100644 --- a/src/bubble.js +++ b/src/bubble.js @@ -11,7 +11,7 @@ dom.innerHTML = ''; dom.style.left = position[0]*8; - dom.style.top = position[1]*8; + dom.style.top = position[1]*8-18; var parts = text.split(' '); var showFragment = function() { @@ -40,7 +40,7 @@ } bubble.skip('talk'); var text = texts.shift(); - return show(text, position || [5, 44]) + return show(text, position || [5, 52]) .then(function(what) { if (what === 'talk') { return Promise.resolve(what); diff --git a/src/stasis.js b/src/stasis.js index f06f23c..66aa493 100644 --- a/src/stasis.js +++ b/src/stasis.js @@ -8,7 +8,8 @@ var doorSprite = null; var roomState = { isDoorOpen: false, - isLightOn: false + isLightOn: false, + isIntroRunning: true }; stasis.init = function() { @@ -35,6 +36,7 @@ kontra.sprite({x: 15, y: 12, width: 3, height: 2, image: kontra.assets.images.stasis_lightSwitch})) .addCallback(function() { + if (roomState.isIntroRunning) return; if (!roomState.isLightOn) { roomState.isLightOn = true; muri.get('bubble') @@ -52,9 +54,12 @@ muri.get('bubble') .story([ [['Beep', 'Bip, Bip'], [20, 15]], - [['Urgh ... ...', 'Where I am?', 'What happened?'], [35, 40]], - [['I can\'t see a thing ...', '... need to turn on the light ...'], [35, 40]] - ]); + [['Urgh ... ...', 'Where I am?', 'What happened?'], [40, 35]], + [['I can\'t see a thing ...', '... need to turn on the light ...'], [40, 35]] + ]) + .then(function() { + roomState.isIntroRunning = false; + }); } };