Skip to content

Commit 9a1b843

Browse files
author
Eoin McGrath
committed
updates some mobile styling for post-mortem
1 parent ece3c6c commit 9a1b843

File tree

4 files changed

+51
-35
lines changed

4 files changed

+51
-35
lines changed

post-mortem/index.html

+20-14
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ <h3> Background </h3>
2929
<p>
3030
<a href="https://js13kgames.com/">Js13kGames</a> is an annual
3131
game jam that challenges developers to
32-
craft a game within a mere 13KB limit. The tools at your
32+
craft a game within a measly 13KB limit. The tools at your
3333
disposal are plain old HTML, JavaScript, and CSS. No fancy
34-
fonts or frameworksjust the basics. These limitations
34+
fonts or frameworksjust the basics. These limitations
3535
encourage creativity. In a web landscape dominated by bloated
3636
libraries, convoluted tooling, and an overwhelming torrent of
3737
new versions, it's refreshing to step back and build something
@@ -47,8 +47,11 @@ <h3> The Theme </h3>
4747
clear idea of the kind of game I wanted to make:
4848
<ul class="boom">
4949
<li> Fast paced, frentic and fun. </li>
50-
<li> Retro style, evoking the glory days of 8bit/16bit games (yep, I'm showing my age!) </li>
51-
<li> Mobile-friendly. Although mobile gaming hasn’t quite lived up to its early promise, it can still provide a fun-filled five minutes.</li>
50+
<li> Retro style, evoking the glory days of 8bit/16bit games
51+
(yep, I'm showing my age!) </li>
52+
<li> Mobile-friendly. Although mobile gaming hasn’t quite lived
53+
up to its early promise, it can still provide a fun-filled five
54+
minutes.</li>
5255
</ul>
5356
</p>
5457

@@ -145,8 +148,9 @@ <h3> Music </h3>
145148
</p>
146149

147150
<p>
148-
<a href="https://keithclark.github.io/ZzFXM/tracker/">ZZfxM’s tracker</a> is an excellent piece of
149-
software, but my musical expertise
151+
<a href="https://keithclark.github.io/ZzFXM/tracker/">ZZfxM’s
152+
tracker</a> is an excellent piece of software, but my musical
153+
expertise
150154
is even more lacking than my pixel-pushing skills, so I
151155
struggled to come up with an original soundtrack. As the
152156
deadline loomed, I grabbed a free Pico-8 tune and played it
@@ -161,22 +165,25 @@ <h3> Music </h3>
161165
</p>
162166
<p>
163167
<i>
164-
WARNING: Last-minute changes invite disaster and are the equivalent
165-
of deploying to production on a Friday afternoon.
168+
WARNING: Last-minute changes invite disaster and are the
169+
equivalent of deploying to production on a Friday afternoon.
166170
</i>
167171
</p>
168-
<img src="https://i.imgflip.com/93oxjd.jpg" alt="Never deploy big changes on a friday">
172+
<img src="https://i.imgflip.com/93oxjd.jpg"
173+
alt="Never deploy big changes on a friday">
169174
<h3> Bling </h3>
170-
<p> Or, <a href="https://www.youtube.com/watch?v=Fy0aCDmgnxg">Juice it or lose it</a>.
175+
<p> Or, <a href="https://www.youtube.com/watch?v=Fy0aCDmgnxg">
176+
Juice it or lose it</a>.
171177
The following techniques were put to use to make the game 'pop'
172178
</p>
173179
<p>
174180
<ul class="boom">
175181
<li>Plenty of explosions and particles to create general mayhem.</li>
176182
<li>Screen shake and flash when certain enemies die</li>
177-
<li> Our Gecko's tail is not static but moves in tune with the player's movements. </li>
183+
<li> Our Gecko's tail is not static but moves in tune with the
184+
player's movements. </li>
178185
</ul>
179-
<img src="gecko_move.gif" alt="Gecko's tail movement">
186+
<img src="gecko_move.gif" alt="Gecko's tail movement">
180187
</p>
181188

182189

@@ -244,7 +251,7 @@ <h3>Ok, ok just lemme play the game!</h3>
244251
document.body.className = '';
245252
window.scrollTo(0, 0);
246253
initAnimate();
247-
}, 200);
254+
}, 300);
248255

249256
const initAnimate = () => {
250257
let images = document.querySelectorAll('.animate img');
@@ -298,7 +305,6 @@ <h3>Ok, ok just lemme play the game!</h3>
298305
});
299306
</script>
300307

301-
302308
<!-- Global site tag (gtag.js) - Google Analytics -->
303309
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-149691096-1"></script>
304310
<script>

post-mortem/style.css

+12-6
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ body.loading h1 { transform: scale(0); }
1616
body.loading h2 { transform: scale(0) rotate(0deg); }
1717
body.loading #arcade { opacity: 0; }
1818

19-
::selection { background: rgba(234, 239, 44, 1); color: black; }
20-
::-moz-selection { background: rgba(234, 239, 44, 1); color: black; }
19+
::selection { background: rgba(234, 239, 44, 1); color: black; text-shadow: transparent 0px 0px; }
20+
::-moz-selection { background: rgba(234, 239, 44, 1); color: black; text-shadow: transparent 0px 0px; }
2121
a { color: #F7E26B;; text-decoration: none; border-bottom: 1px dashed #F7E26B; transition: all 0.2s linear}
2222
a:hover { color: #EB8931; text-decoration: none; border-color: #EB8931; }
2323

@@ -51,9 +51,7 @@ h2 {
5151
h2:hover { transform: rotate(3deg); }
5252

5353
h3 {
54-
/* background: rgba(0, 0, 0, 0.2); */
5554
margin: 3rem 0 1rem 0;
56-
padding-left: .5rem;
5755
font: 26px 'Press Start 2P', Arial, sans-serif;
5856
line-height: 2.3rem;
5957
text-shadow: #000 3px 3px 0;
@@ -62,7 +60,7 @@ h3 {
6260
img { max-width: 80%; margin: 2rem auto; }
6361
div.imgs img {
6462
display: inline-block !important;
65-
padding-right: 3rem;
63+
padding-right: 3rem;
6664
}
6765
div.imgs.big {
6866
margin-left: 1rem;
@@ -88,7 +86,7 @@ code {
8886
margin: 2rem auto;
8987
padding: 0 2rem;
9088
max-width: 600px;
91-
min-width: 250px;
89+
min-width: 260px;
9290
transition: opacity 2s linear;
9391
}
9492

@@ -172,10 +170,18 @@ footer .boss {
172170

173171
#tweet_me { position: absolute; top: 1em; left: 1em; }
174172

173+
@media (min-width: 320px) {
174+
#arcade { width: 260px; }
175+
div.imgs.big img { width: 26px; }
176+
}
175177
@media (min-width: 360px) {
176178
#arcade { width: 300px; }
177179
div.imgs.big img { width: 40px; }
178180
}
181+
@media (min-width: 410px) {
182+
#arcade { width: 350px; }
183+
div.imgs.big img { width: 50px; }
184+
}
179185
@media (min-width: 768px) {
180186
#arcade { width: 600px; }
181187
div.imgs.big img { width: 50px; }

scripts/encodeImages.js

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fs = require('fs');
2+
const showInfo = (process.argv.slice(2).indexOf('info') !== -1);
23

34
const files = fs.readdirSync('a'),
45
ext = '.gif',
@@ -16,24 +17,33 @@ function encode(img) {
1617

1718

1819
const results = [];
20+
let key;
1921
for (let n in files) {
2022
if (files[n].indexOf(ext) !== -1) {
21-
let file = 'a/' + files[n],
22-
key = files[n].replace(ext, '');
23+
key = files[n].replace(ext, '');
24+
let file = 'a/' + files[n];
2325
encoded[key] = encode('a/'+files[n]);
26+
27+
let size = fs.statSync(file).size,
28+
diff = Math.ceil((encoded[key].length / size) * 100) + '%';
2429
results.push({
2530
key: key,
26-
size: fs.statSync(file).size,
27-
encoded: encoded[key].length
31+
size: size,
32+
encoded: encoded[key].length,
33+
diff: diff
2834
});
2935
totalImages += 1;
3036
}
3137
}
3238

33-
console.table(results);
34-
35-
console.log('Total [files]: ', results.reduce((total, obj) => obj.size + total,0));
36-
console.log('Total [encoded]: ', results.reduce((total, obj) => obj.encoded + total,0));
39+
if (showInfo) {
40+
console.table(results);
41+
console.log('Total [files]: ', results.reduce((total, obj) => obj.size + total,0));
42+
console.log('Total [encoded]: ', results.reduce((total, obj) => obj.encoded + total,0));
43+
console.log('');
44+
console.log('--------------------------------');
45+
console.log('');
46+
}
3747

3848
encoded = JSON.stringify(encoded);
3949
encoded = encoded.replace(re, "'");

src/engine/game.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ export default class Game {
1818

1919
let ua = navigator.userAgent.toLowerCase();
2020

21-
// this.zzfx = zzfx;
22-
// this.zzfxM = zzfxM;
23-
// this.zzfxP = zzfxP;
24-
2521
this.android = ua.indexOf("android") > -1;
2622
this.ios = /ipad|iphone|ipod/.test(ua);
2723
this.mobile = this.android || this.ios;
@@ -87,9 +83,7 @@ export default class Game {
8783
Setup(this);
8884

8985
this.track1 = new P8(this.p8S, this.p8M);
90-
// this.audio = this.track1.music(0);
91-
// this.audio.stop();
92-
this.favIcon(this.draw.resize(this.imgs.gecko, 8));
86+
this.favIcon(this.draw.resize(this.imgs.donut, 8));
9387
document.querySelector('#l').style.display = 'none';
9488
this.c.style.display = "block";
9589
this.loop();

0 commit comments

Comments
 (0)