IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Vous êtes nouveau sur Developpez.com ? Créez votre compte ou connectez-vous afin de pouvoir participer !

Vous devez avoir un compte Developpez.com et être connecté pour pouvoir participer aux discussions.

Vous n'avez pas encore de compte Developpez.com ? Créez-en un en quelques instants, c'est entièrement gratuit !

Si vous disposez déjà d'un compte et qu'il est bien activé, connectez-vous à l'aide du formulaire ci-dessous.

Identifiez-vous
Identifiant
Mot de passe
Mot de passe oublié ?
Créer un compte

L'inscription est gratuite et ne vous prendra que quelques instants !

Je m'inscris !

Le CSS est-il un langage de programmation ? La question divise les développeurs
Surtout au vu de la qualité de certains jeux vidéo mis sur pied en s'appuyant uniquement sur le CSS

Le , par Patrick Ruiz

1PARTAGES

26  0 
Le langage CSS (en anglais Cascading Style Sheets, qu'on peut traduire par feuilles de style en cascade) sert d’habitude à gérer l'aspect visuel d'une page web. En d'autres termes, le langage CSS gère la présentation d'une page web : la couleur du texte, l'utilisation de telle ou telle police, les images ou couleurs d'arrière-plan, les espaces et marges des différents éléments, le positionnement des éléments, etc. Ce dernier est donc d’abord connu comme un langage pour le web. Certains intervenants de la filière sont néanmoins d’avis que c’est limiter le CSS qui est un langage de programmation à part entière. Et pour cause : il existe toute une niche de jeux vidéo mis sur pied en s’appuyant uniquement sur le CSS.


« CSS est un langage de feuille de style personnalisé et ne fonctionne pas comme un langage de programmation. CSS définit l'apparence du balisage plutôt que la manière de mettre sur pied une application », soulignent des intervenants de la filière d’avis que le CSS n’est pas un langage de programmation à part entière.


C’est un positionnement sujet à contradiction quand on sait qu’un langage de programmation peut être défini de façon simple comme un code de communication entre un humain et une machine. L’humain s’appuie sur le code pour donner des instructions à la machine qui les exécute. Et la disponibilité de jeux vidéo comme The Mine, mis sur pied en s’appuyant uniquement sur le CSS, l’illustre. Les trois grandes étapes de la programmation informatique sont respectées : l’analyse qui décrit le problème rencontré de façon claire ; l’algorithme qui décrit la solution au problème sous une forme très simple compréhensible par tous ; le programme qui traduit l’algorithme sous une forme numérique compréhensible par un appareil numérique.


« La logique sous-jacente est en fait relativement simple et utilise une technique vieille de plus de 7 ans. En cliquant sur une flèche (dans ce cas un label), il vérifie l'entrée pertinente et en utilisant le pseudo-sélecteur : checked, nous pouvons parcourir le DOM le nombre correct d'itérations et déplacer l'ensemble de la fenêtre de visualisation d'un "segment" entier. Les ascenseurs fonctionnent de la même manière, sauf que lorsque nous cliquons vers le bas, nous vérifions le segment du dessous.

En ce qui concerne la logique de jeu, nous utilisons à nouveau le même concept. La pioche, par exemple, est une étiquette pour une case à cocher. Lorsque nous cliquons dessus, la case est cochée, puis, lorsque nous cliquons sur le rocher, nous demandons à css de vérifier si les entrées du rocher et de la pioche sont toutes deux cochées », indique l’auteur de The Mine à propos de certains aspects algorithmiques du jeu dont le code source est disponible.

Code CSS : Sélectionner tout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
-# Game grid variablesb
	-# Make sure these are reflected in the SASS
	- rows = 4;
	- columns = 12;
	- tilesPerSegment = 3;
	- tilePerSegmentVertical = 7;
	- hasIntro = true;
	- hasLoader = true;
	-# Game
	.game
	    -# Loader
	    - if(hasLoader == true)
	        .game_loader
	            .game_loader__inner
	                .logo
	                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/mineLogo.gif'}
	                .subtitle
	                    %h1 A no JS Adventure game
	                .bar
	                    .bar_inner
	                %span Loading checkboxes...
	    -# Intro
	    - if(hasIntro == true)
	        .game_intro 
	            %input#intro-1{:class => 'dialogue', :type => 'radio', :name => 'intro', :checked => 'checked'}
	            .dialogue
	                Ahhhhhhh!!
	                %label{:for => 'intro-2'}
	                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	            %input#intro-2{:class => 'dialogue', :type => 'radio', :name => 'intro'}
	            .dialogue
	                The floor just collapsed under me
	                %label{:for => 'intro-3'}
	                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	            %input#intro-3{:class => 'dialogue', :type => 'radio', :name => 'intro'}
	            .dialogue
	                Geez it sure is dark in here
	                %label{:for => 'intro-4'}
	                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	            %input#intro-4{:class => 'dialogue', :type => 'radio', :name => 'intro'}
	            .dialogue
	                Let me light my torch...
	                %label{:for => 'intro-5'}
	                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	            %input#intro-5{:class => 'dialogue', :type => 'radio', :name => 'intro'}
	            .dialogue.end
	                Better. Need to find a way out.
	            %input#intro-6{:class => 'dialogue', :type => 'radio', :name => 'intro'}
	            .overlay
 
	    -# Padlock game
	    %input#interactiveObject--lock{:type=> 'checkbox'}
	    .padlock
	        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/padlockBig.png'}
	    -(1..3).each do |col|
	        -(1..9).each do |i|
	            - if(i == 9)
	                %input{:type=> 'checkbox', 'value' => i, :id => "padlock#{col}-#{i}", :checked => 'checked'} 
	                    %span{:id => "span-#{col}"} #{10 - i}
	            - else
	                %input{:type=> 'checkbox', 'value' => i, :id => "padlock#{col}-#{i}"} 
	                    %span{:id => "span-#{col}"} #{10 - i}
	    %label.check{:for => 'interactiveObject--lock'} check
 
	    -# Game items
 
 
	    %input#interactiveObject1{:type => 'radio', 'data-reference' => '1', 'data-debug' => "Empty box 1"}
	    %input#interactiveObject2{:type => 'radio', 'data-reference' => '2', 'data-debug' => "Pickaxe"}
	    %input#interactiveObject3{:type => 'checkbox', 'data-reference' => '3', 'data-debug' => "Boulder"}
	    %input#interactiveObject4{:type => 'radio', 'data-reference' => '4', 'data-debug' => "Dynamite plunger"}
	    %input#interactiveObject5{:type => 'checkbox', 'data-reference' => '5', 'data-debug' => "Dynamite door"}
	    %input#interactiveObject6{:type => 'radio', 'data-reference' => '6', 'data-debug' => "Planks"}
	    %input#interactiveObject7{:type => 'checkbox', 'data-reference' => '7', 'data-debug' => "Plank gap"}
	    %input#interactiveObject8{:type => 'radio', 'data-reference' => '8', 'data-debug' => "Note 1"}
	    %input#interactiveObject9{:type => 'radio', 'data-reference' => '9', 'data-debug' => "Note 2"}
	    %input#interactiveObject10{:type => 'radio', 'data-reference' => '10', 'data-debug' => "Note 3"}
	    %input#interactiveObject11{:type => 'radio', 'data-reference' => '11', 'data-debug' => "Lock door"}
	    %input#interactiveObject12{:type => 'radio', 'data-reference' => '12', 'data-debug' => "Handle"}
	    %input#interactiveObject13{:type => 'checkbox', 'data-reference' => '13', 'data-debug' => "Cog"}
	    %input#interactiveObject14{:type => 'checkbox', 'data-reference' => '14', 'data-debug' => "Waterfall"}
	    %input#interactiveObject15{:type => 'radio', 'data-reference' => '15', 'data-debug' => "Dynamite"}
	    %input#interactiveObject16{:type => 'radio', 'data-reference' => '16', 'data-debug' => "Fuses"}
	    %input#interactiveObject17{:type => 'checkbox', 'data-reference' => '17', 'data-debug' => "End door"}
	    %input#interactiveObject18{:type => 'radio', 'data-reference' => '18', 'data-debug' => "Empty box 2"}
	    %input#interactiveObject19{:type => 'radio', 'data-reference' => '19', 'data-debug' => "Empty box 3"}
	    %input#interactiveObject20{:type => 'radio', 'data-reference' => '20', 'data-debug' => "Empty box 4"}
	    %input#interactiveObject21{:type => 'radio', 'data-reference' => '21', 'data-debug' => "Empty box 5"}
	    %input#interactiveObject22{:type => 'radio', 'data-reference' => '22', 'data-debug' => "Empty box 6"}
 
	    -# Checkboxes for movement
	    -(1..rows).each do |row|
	        -(1..columns).each do |index|
	            - if(row == 1 && index == 2)
	                %input{:id => "indexRow#{row}-#{index}", :type => "radio", :name => "trigger", :checked => 'checked'}
	            - else
	                %input{:id => "indexRow#{row}-#{index}", :type => "radio", :name => "trigger"}
 
	    -# Game character
	    .game_character
 
	    -# Game intermediates
	    .game_key
 
	    -# Game segments
	    .viewport
	        %img.level{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/tilemaps.png'}
	        -(1..rows).each do |row|
	            -(1..columns).each do |index|
	                .game_segment
	                    .drip_container
	                        -(1..4).each do
	                            .drip
	                    .tiles
	                        -(1..tilesPerSegment * tilePerSegmentVertical).each do |tile|
	                            -if (row == 1 && index == 3 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject1', 'data-reference' => '1'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-24.png'}
	                                        .response
	                                            Nothing useful in here
	                            -if (row == 1 && index == 12 && tile == 14)
	                                .tile
	                                    %label{:for => 'interactiveObject2', 'data-reference' => '2'}
	                                        %img.object{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_035.png'}
	                                        .response
	                                            A pickaxe. This should come in handy
	                            -if (row == 1 && index == 7 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject3', 'data-reference' => '3'}
	                                        %img.forced{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_062.png'}
	                                        .responseSuccess
	                                            Ha! That got it
	                                        .forcedResponse
	                                            I need a tool to get past this
	                                            %label{:for => 'interactiveObject3'}
	                                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                            -if (row == 1 && index == 8 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject4', 'data-reference' => '4'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_166.png'}
	                                        .response
	                                            That seemed to do something...
	                            -if (row == 3 && index == 7 && tile == 13)
	                                .tile.beam
	                                    %label{:for => 'interactiveObject5', 'data-reference' => '5'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/beam.gif'}
	                                        .responseSuccess
	                                            door gone
	                                        .forcedResponse
	                                            Something must blow this up
	                                            %label{:for => 'interactiveObject5'}
	                                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                            -if (row == 2 && index == 6 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject6', 'data-reference' => '6'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_094.png'}
	                                        .response
	                                            A Plank of wood
	                            -if (row == 3 && index == 5 && tile == 13)
	                                .tile
	                                    %label{:for => 'interactiveObject7', 'data-reference' => '7'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_169.png'}
	                                        .responseSuccess
	                                            planks on
	                                        .forcedResponse
	                                            CSS won't let me jump this
	                                            %label{:for => 'interactiveObject7'}
	                                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                            -if (row == 1 && index == 6 && tile == 13)
	                                .tile
	                                    %label{:for => 'interactiveObject8', 'data-reference' => '8'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_094.png'}
	                                        .response
	                                            A strange note
	                            -if (row == 1 && index == 10 && tile == 13)
	                                .tile
	                                    %label{:for => 'interactiveObject9', 'data-reference' => '9'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-24.png'}
	                                        .response
	                                            A strange note
	                            -if (row == 3 && index == 5 && tile == 14)
	                                .tile
	                                    %label{:for => 'interactiveObject10', 'data-reference' => '10'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-24.png'}
	                                        .response
	                                            A strange note  
	                            -if (row == 3 && index == 4 && tile == 13)
	                                .tile.door
	                                    %label{:for => 'interactiveObject--lock', 'data-reference' => '11'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/doorLocked.png'}
	                                        .response
	                                            A locked door
	                            -if (row == 3 && index == 2 && tile == 13)
	                                .tile
	                                    %label{:for => 'interactiveObject12', 'data-reference' => '12'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_094.png'}
	                                        .response
	                                            Cog handle
	                            -if (row == 4 && index == 10 && tile == 13)
	                                .tile
	                                    %label{:for => 'interactiveObject13', 'data-reference' => '13'}
	                                        %img.forced{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_148.png'}
	                                        .responseSuccess
	                                            That turned off the water
	                                        .forcedResponse
	                                            There's no handle
	                                            %label{:for => 'interactiveObject13'}
	                                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                            -if (row == 4 && index == 11 && tile == 13)
	                                .tile.water
	                                    %label{:for => 'interactiveObject14', 'data-reference' => '14'}
	                                        %img.forced{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/waterOn.gif'}
	                                        .forcedResponse
	                                            Cant get through here
	                                            %label{:for => 'interactiveObject14'}
	                                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                            -if (row == 2 && index == 3 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject15', 'data-reference' => '15'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_161.png'}
	                                        .response
	                                            Dynamite sticks
	                            -if (row == 4 && index == 12 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject16', 'data-reference' => '16'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_094.png'}
	                                        .response
	                                            Box of fuses
	                            -if (row == 2 && index == 12 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject17', 'data-reference' => '17'}
	                                        %img.forced{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_168.png'}
	                                        .forcedResponse
	                                            If only i had some dynamite & fuses
	                                            %label{:for => 'interactiveObject17'}
	                                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                            -if (row == 2 && index == 7 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject18', 'data-reference' => '18'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-24.png'}
	                                        .response
	                                            Nothing useful in here
	                            -if (row == 2 && index == 10 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject19', 'data-reference' => '19'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_094.png'}
	                                        .response
	                                            Full of junk
	                            -if (row == 3 && index == 9 && tile == 15)
	                                .tile
	                                    %label{:for => 'interactiveObject20', 'data-reference' => '20'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-24.png'}
	                                        .response
	                                            Just an empty box
	                            -if (row == 1 && index == 12 && tile == 13)
	                                .tile
	                                    %label{:for => 'interactiveObject21', 'data-reference' => '21'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-25.png'}
	                                        .response
	                                            Nothing i can use
	                            -if (row == 4 && index == 8 && tile == 13)
	                                .tile
	                                    %label{:for => 'interactiveObject22', 'data-reference' => '22'}
	                                        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_094.png'}
	                                        .response
	                                            Nope empty
	                            .tile
	                    %label{:for => "indexRow#{row}-#{index}"}
	                        .game_segment__control
	                            -if (index != 1)
	                                .forward
	                                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                            -if (index != columns)
	                                .backward
	                                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                    %label{:for => "indexRow#{row}-#{index}"}
	                        .game_segment__control
	                            .down
	                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
	                    %label{:for => "indexRow#{row - 1}-#{index}"}
	                        .game_segment__control
	                            .up
	                                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/arrowMovement.png'}
 
	    -# Game inventory
	    .game_inventory
	        %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyBackpack.png'}
	        .game_inventory__item
	            .item.pickaxe{'data-reference' => '0'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/apple.gif'}
	                .details A healthy snack
	                .name Apple
	            .item.pickaxe{'data-reference' => '2'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/pickInventory.gif'}
	                .details A sturdy looking pickaxe
	                .name Pickaxe
	            .item.pickaxe{'data-reference' => '6'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/plankInventory.gif'}
	                .details A thick plank of wood
	                .name Plank
	            .item.pickaxe{'data-reference' => '8'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/note1.gif'}
	                .details A mysterious note
	                .name Note 1
	            .item.pickaxe{'data-reference' => '9'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/note2.gif'}
	                .details A mysterious note
	                .name Note 2
	            .item.pickaxe{'data-reference' => '10'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/note3.gif'}
	                .details A mysterious note
	                .name Note 3
	            .item.pickaxe{'data-reference' => '12'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/handleInventory.gif'}
	                .details Looks like its used to turn something
	                .name Handle
	            .item.pickaxe{'data-reference' => '15'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/dynamiteInventory.gif'}
	                .details No good without any fuses
	                .name Dynamite sticks
	            .item.pickaxe{'data-reference' => '16'}
	                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/fusesInventory.gif'}
	                .details Some fuses for dynamite
	                .name Fuses
	    -# Game conditional checks 
	    .game_win
	        .game_win__inner
	            .character
	            %p Thanks for playing
	            %a{:href => 'https://www.codepen.io/jcoulterdesign', :target => '_blank'} Follow me on codepen
	            %span for more shenanigans
 
Raw
script.js
	// Nope, nothing here. Just a big long list of checkboxes and radio buttons.... You see, what happens is, let's say you click on the boulder, the input for the boulder is checked but the input for the pickaxe isn't. So CSS check to see if the checkbox is checked and the other checkbox is checked to check if the rule should apply. If the checkbox of the pickaxe is not checked then the check shows that the checkbox checked state of the previous checkbox isnt checked and thus the current checked box doesnt apply the checked checkbox state. Got that? Great. Me neither.
Raw
scripts
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Raw
style.scss
	$rows: 4 !global;
	$columns: 12 !global;
	$gameObjects: 22;
	$tileSize: 48px;
	$walkSpeed: 1s;
	$tilesPerSegment: 3;
	$tilesPerSegmentVertical: 7;
	$segmentHeight: $tileSize * $tilesPerSegmentVertical;
	$debug: false;
 
 
	* {
	    box-sizing: border-box;
	}
 
 
	@font-face {
	    font-family: pixles;
	    src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/04B_03__.TTF);
	}
 
 
	/* ------------------------------------------------------------------------------------
 
	Game styling
 
	--------------------------------------------------------------------------------------- */
 
 
	body {
	    background: #141415;
	    overflow: hidden;
	    font-family: pixles;
	    font-size: 15px;
	    -webkit-user-select: none;
	    -moz-user-select: none;
	    user-select: none;
	    height: 100vh;
	    margin: 0;
 
 
	    & .game {
	        width: $tileSize * $tilesPerSegment * $columns;
	        position: absolute;
	        left: calc(50% - 72px);
	        right: 0;
	        top: calc(50% - 212px);
	        margin: auto;
 
	        input {
	            display: none;
	        }
 
	        // End screen styles
 
	        &_win {
	            position: fixed;
	            left: 0;
	            top: 0;
	            background: #141415;
	            z-index: 9;
	            width: 100%;
	            height: 100%;
	            opacity: 0;
	            pointer-events: none;
	            transition: all 1s 0s;
 
	            &__inner {
	                position: absolute;
	                left: 0;
	                right: 0;
	                margin: auto;
	                width: 300px;
	                top: 50%;
	                transform: translateY(-50%);
	                text-align: center;
	                opacity: 0;
	                transition: all 1s 2s;
 
	                p {    
	                    color: white;
	                    margin-bottom: 30px;
	                }
 
	                span {
	                    color: white;
	                    opacity: 0.4;
	                }
 
	                a {
	                    margin-bottom: 16px;
	                    color: #78f148;
	                    text-align: center;
	                    width: 100%;
	                    display: block;
	                }
	            }
 
	            .character {
	                width: 48px;
	                height: 48px;
	                position: relative;
	                left: -60px;
	                margin: auto;
	                background: red;
	                background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/corridorMainCharacter.gif');
	                animation: walk-1 $walkSpeed infinite;
	                z-index: 1;
	                background-position: 0 0;
	                transform: translateY(-50%) translateX($tileSize * ($tilesPerSegment / 2) - 8);
	                transition: all $walkSpeed linear;
	                z-index: 1;
	                pointer-events: none;
	            }
	        }
 
	        // Side inventory styles
 
 
	        &_inventory {
	            position: fixed;
	            z-index: 9;
	            left: 0;
	            color: white;
	            top: 50%;
	            -webkit-transform: translateY(-50%);
	            font-size: 11px;
	            right: 0;
	            margin: auto;
	            left: -420px;
	            width: 140px;
	            padding-left: 15px;
	            transform: translateY(-50%);
	            height: 64px;
	            cursor: pointer;
	            transition: all .6s .3s;
 
 
	            &:hover {
	                height: 371px;
	                transition: all .6s .2s;
 
 
	                .item {
	                    opacity: 1;
	                    left: 0px;
	                    transition: all 0.3s;
	                    -webkit-filter: blur(0px);
 
 
	                    &:first-child {
	                        display: block;
	                    }
	                }
	            }
 
 
	            h1 {
	                font-weight: normal;
	                font-size: 12px;
	            }
 
 
	            img {
	                transform: scale(3);
	                image-rendering: pixelated;
	                cursor: pointer;
	                transform-origin: 0 0;
 
 
	                &:hover {
 
 
	                }
	            }
 
 
	            &__item {
	                margin-top: 70px;
	                text-align: center;
	                position: relative;
	                left: -24px;
	                width: 100%;
	                height: 100%;
 
 
	                .item {
	                    margin: 10px 0 30px 0;
	                    display: none;
	                    opacity: 0;
	                    left: 0px;
	                    position: relative;
	                    transition: all 0s;
	                    float: left;
	                    margin-right: 10px;
	                    width: 34%;
 
 
	                    &:hover {
	                        z-index: 15;
 
	                        .details {
	                            opacity: 1;
	                            top: -4px;
	                        }
	                    }
 
	                    .name {
	                        position: relative;
	                        top: 11px;
	                    }
 
	                    .details {
	                        padding: 7px;
	                        opacity: 0;
	                        border-radius: 4px;
	                        position: absolute;
	                        font-size: 13px;
	                        text-align: center;
	                        transition: all 0.2s .2s;
	                        pointer-events: none;
	                        background: white;
	                        color: #141415;
	                        width: 120px;
	                        top: -4px;
	                        left: 50px;
	                        z-index: 20;
	                    }
 
 
	                    img {
	                        transform: scale(2);
	                        transform-origin: 50% 50%;
	                    }
	                }
	            }
	        }
 
 
	        // Padlock stuff
 
	        .padlock {
	            display: none;    
	            position: absolute;
	            width: 280px;
	            top: 71px;
	            left: -70px;
	            height: 280px;
	            background: #301f41b8;
	            z-index: 4;
	            border-radius: 324px;
	            border: 4px solid #ffb128;
 
	            img {
	                position: absolute;
	                left: 80px;
	                top: 35px;
	            }
	        }
 
	        %o {
	            display:block;
	            position: absolute;
	            left: 0;
	            right: 0;
	            top: 220px;
	            margin: auto;
	        }
 
 
	        .check {
	            display: none;
	            width: 80px;
	            cursor: pointer;
	            height: 80px;
	            position: absolute;
	            z-index: 6;
	            top: 303px;
	            left: 30px;
	            text-align: center;
	            line-height: 77px;
	            background: wheat;
	            color: #615133;
	            border-radius: 100px;
	            border: 3px solid #ffb128;
	            transition: all 0.3s;
 
 
	            &:hover {
	                background: #ffb128;
	                color: white;
	            }
	        }
 
	        input#interactiveObject--lock:not(:checked) {
	            + span {
	                display: none;
	            }
	        }
 
	        input#interactiveObject--lock:checked {
	            + .padlock {
	                display: block;
 
 
	                $y: '';
	                $x: ' + span ';
 
	                + input {
	                    display: block;
	                    @for $i from 1 through 26 {
 
 
	                        $y: $y + ' + span + input';
	                        $x: $x + ' + input + span ';
 
	                        #{$y} {
	                            display: block;
	                        }
	                            #{$x} {
	                            display: block;
	                        }
	                        #{$y} + span + label {
	                            display: block;
	                        }   
	                    }
	                }
	            }
	        }
 
 
	        #padlock1-1,#padlock2-1,#padlock3-1 {
	            &:after {
	                display: block !important;
	            }
	        }
 
 
	        #padlock1-9,#padlock2-9,#padlock3-9 {
	            &:after {
	                display: none !important;
	            }
	        }
 
	        input[id*="padlock"] {
	            @extend %o;
 
 
	            z-index: 3;
	            outline: none;
	            display:none;
	            -webkit-appearance: none;
 
 
	            + span {
	                @extend %o;
 
 
	                background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/padlockBG.png);
	                width: 10px;
	                width: 22px;
	                height: 36px;
	                left: 0;
	                display: none;
	                line-height: 40px;
	                text-align: center;
	                position: fixed;
	                color: #444444;
	                top: 50%;
	                transform: translateY(9px) translateX(-35px);
	            }
 
 
	            @for $i from 1 through 34 {
	                &:nth-of-type(#{$i}) {
	                    z-index: $i + 10;
 
 
	                    &:checked {
	                        z-index: 64 + $i;
 
	                        & + span {
	                            z-index: 64 - $i;
	                        }
	                    }
	                }
	            }
 
 
	            &:checked {
	                z-index: 30;
 
 
	                &:before {
	                    display: none;
	                } 
 
 
	                & + span {
	                    & + input {
	                        &:after {
	                            display: none;
	                        }
	                    }
	                }
	            }
 
 
	            &:after {
	                background: red;
	                display: block;
	                content: '';
	                top: 48px;
	                position: absolute;
	                cursor: pointer;
	                height: 23px;
	                left: -7px;
	                width: 22px;
	                background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/padlockDown.png);
	            }
 
 
	            &:before {
	                display: block;
	                content: '';
	                position: absolute;
	                height: 23px;
	                width: 22px;
	                left: -7px;
	                top: -30px;
	                color: white;
	                background: red;
	                cursor: pointer;
	                background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/padlockUp.png);
	            }
 
 
	            &[id*="padlock1"] {
	                left: 19px;
	                + span {
	                  left: -27px;  
	                }
	            }
 
	            &[id*="padlock2"] {
	                left: 64px;
	                + span {
	                  left: 66px;  
	                }
	            }
 
	            &[id*="padlock3"] {
	                left: 106px;
	                + span {
	                  left: 149px;  
	                }
	            }
	        }
 
	        // Loading screen styles
 
 
	        &_loader {
	            position: fixed;
	            z-index: 15;
	            background: #141415;
	            left: 0;
	            top: 0;
	            width: 100%;
	            height: 100%;
	            pointer-events: none;
	            opacity: 1;
	            animation: fadeOut 1.5s 7s forwards;
 
 
	            &__inner {
	                position: absolute;
	                left: 0;
	                right: 0;
	                margin: auto;
	                top: 50%;
	                transform: translateY(-50%);
	                font-size: 12px;
	                width: 200px;
	                text-align: center;
 
 
	                h1 {
	                    font-weight: normal;
	                    font-size: 12px;
	                }
 
 
	                & .logo {
	                    width: 200px;
	                    height: 70px;
	                    margin: auto;
	                    margin-bottom: 10px;
	                    transform: scale(0);
	                    opacity: 0;
	                    animation: logo 2s forwards;
 
	                    img {
	                        width: 100%;
	                    }
	                }
 
 
	                span {
	                    color: rebeccapurple;
	                    display: block;
	                    opacity: 0;
	                    margin-top: 8px;
	                    animation: fadeIn 1.5s 3s forwards;
	                }
 
 
	                & .bar {
	                    background: #3c3c3e;
	                    position: relative;
	                    height: 2px;
	                    margin-top: 30px;
	                    opacity: 0;
	                    animation: fadeIn 1.5s 2.5s forwards;
 
 
	                    &_inner {
	                        width: 0px;
	                        height: 100%;
	                        background: white;
	                        position: absolute;
	                        top: 0;
	                        animation: bar 3s 3s forwards;
	                    }
	                }
 
 
	                & .subtitle {
	                    color: #f49112;
	                    margin: -18px 0px 40px 0;
	                    opacity: 0;
	                    animation: fadeIn 1.5s 1.5s forwards;
	                }
	            }
	        }
 
	        // Our little character
 
 
	        &_character {
	            width: 48px;
	            height: 48px;
	            background: red;
	            background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/corridorMainCharacter.gif');
	            position: absolute;
	            top: 216px;
	            left: -16px;
	            z-index: 1;
	            background-position: 0 0;
	            transform: translateY(-50%) translateX($tileSize * ($tilesPerSegment / 2) - 8);
	            transition: all $walkSpeed linear;
	            z-index: 1;
	            pointer-events: none;
 
	            img {
	                position: absolute;
	                border: 512px solid #0c0c0d;
	                transform: translateY(-685px) translateX(-670px);
	                opacity: 1;
	            }
	        }
 
 
	        // Intro dialogue
 
	        &_intro {
	            position: absolute;
	            top: 38px;
	            left: -33px;
	            z-index: 14;
 
 
	            input {
	                display: none;
	            }
 
 
	            input[type="radio"]:checked + div {
	                opacity: 1;
	                top: 140px;
	                transition: all 0.5s 0.8s;
	                pointer-events: all;
 
 
	                label {
	                    opacity: 1;
	                    bottom: -10px;
	                }
	            }
 
	            input#intro-1[type="radio"]:checked + div {
	                top: 140px;
	                opacity: 0;
	                transition: all 0.5s 0.8s;
	                animation: dialogueIn .5s 9s forwards;
	                pointer-events: all;
	            }
 
 
	            input#intro-1[type="radio"]:not(:checked) + div {
	                opacity: 0;
	                top: 160px;
	                transition: all 0.5s 0.8s;
	            }
 
 
	            input[type="radio"]#intro-5:checked + div + input + div {
	                opacity: 0;
	                pointer-events: none !important;
	            }
 
	            input[type="radio"]#intro-5:checked + div {
	                opacity: 0;
	                animation: showResponse 2s 2s forwards;
	            }
 
 
	            & .overlay {
	                position: fixed;
	                top: 0 !important;
	                width: 140%;
	                left: 0;
	                opacity: 1;
	                height: 260%;
	                background: #141415;
	                z-index: -1;
	                pointer-events: all;
	                transition: all 4s .7s !important;
	            }
 
 
	            & .dialogue {
	                position: absolute;
	                top: 160px;
	                opacity: 0;
	                width: 170px;
	                left: 20px;
	                padding: 15px;
	                border-radius: 4px;
	                font-size: 13px;
	                text-align: center;
	                transition: all 0.2s .2s;
	                pointer-events: none;
	                background: white;
	                color: #141415;
 
	                &.end {
	                    position: absolute;
	                    width: 130px;
	                    left: 0;
	                    text-align: center;
	                    right: 0;
	                    pointer-events: none;
	                    top: 100px !important;
	                    margin: auto;
	                    transform: translateY(140px) translateX(39px);
	                    background: white;
	                    color: #141415;
	                    padding: 8px;
	                    border-radius: 5px;
	                }
 
 
	                label {    
	                    border-radius: 5px;
	                    position: absolute;
	                    right: -6px;
	                    bottom: -20px;
	                    z-index: 1;
	                    opacity: 0;
	                    cursor: pointer;
	                    transition: all 0.4s 1s;
 
 
	                    img {
	                        transform: scale(2);
	                        image-rendering: pixelated;
	                    }
 
 
	                    &:hover {
	                        right: -13px;
	                        background: #66bf60;
	                    }
	                }
	            }
	        }
 
	        // Viewport
 
 
	        .viewport {
	            position: relative;
	            z-index: 0;
	            transition: all $walkSpeed linear;
 
 
	            .level {
	                position: absolute;
	                left: 0;
	                z-index: 1;
	                transform: scale(3);
	                transform-origin: 0 0;
	                image-rendering: pixelated;
	            }
	        }
 
 
	        &_segment {
	            width: $tileSize * $tilesPerSegment;
	            height: $segmentHeight;
	            border: 0px solid white;
	            float: left;
	            z-index: 1;
	            position: relative;
	            color: white;
 
 
	            .drip_container {
	                position: relative;
	                top: 80px;
	                display: none;
	                z-index: 10;
 
 
	                & .drip {
	                    width: 3px;
	                    height: 20px;
	                    background: #81eeef;
	                    position: absolute;
	                    height: 0;
	                    top: 14px;
	                    opacity: 1;
 
 
	                    @for $i from 1 through 5 {
	                        &:nth-of-type(#{$i}) {
	                            left: random(144) + 0px;
	                            animation: drip 1.25s random(52) / 10 + 0s linear infinite;
	                        }
	                    }
	                }
	            }
 
 
	            @keyframes drip {
	                0% {height: 0;}
	                2% {height: 6px;}
	                5% {height: 6px;top:14px}
	                22% {top:158px; height:4px;opacity:1;}
	                23%{opacity: 0;height:0px}
	                100%{opacity: 0}
	            }
 
 
	            & .tiles {
	                & .tile {
	                    width: $tileSize;
	                    height: $tileSize;
	                    float: left;
	                    image-rendering: pixelated;
 
	                    // Special tiles
 
 
	                    &.door {
	                        position: absolute;
	                        top: 92px;
	                        height: 144px;
	                        left: -12px;
	                        width: 60px;
 
	                        img {
	                            position: relative;
	                        }
	                    }
 
	                    &.beam {
	                        position: absolute;
	                        top: 95px;
	                        height: 108px;
	                    }
 
 
 
	                    &.water {
	                        position: absolute;
	                        top: 107px;
	                        height: 108px;
	                    }
 
 
	                    &:before {
	                        display: none;
	                        content: ' ';
	                        position: absolute;
	                        width: 4px;
	                        height: 10px;
	                        border-left: 4px solid #e69c69;
	                        border-right: 4px solid #e69c69;
	                        z-index: 1;
	                        left: 67px;
	                        top: 140px;
	                        transition: all 1s linear;
	                    }
 
 
	                    &:after {
	                        top: -48px;
	                        transition: all 1s linear;
	                        height: 40px !important;
	                        display: block;
	                        overflow: hidden;
	                        pointer-events: none;
 
 
	                        img {
	                            position: relative;
	                            top: -400px;
	                        }
	                    }
 
 
	                    img {
	                        width: 100%;
	                        cursor: pointer;
 
 
	                        &:hover {
	                            -webkit-filter: drop-shadow(2px 0px white) drop-shadow(-2px 0px white) drop-shadow(0px -2px white);
	                        }
	                    }
 
 
	                    label {
	                        pointer-events: none;
 
 
	                        .response, 
	                        .forcedResponse, 
	                        .responseSuccess {
	                            display: none;
	                            position: absolute;
	                            width: 130px;
	                            left: 0;
	                            text-align: center;
	                            right: 0;
	                            pointer-events: none;
	                            top: calc(50% - 46px);
	                            margin: auto;
	                            background: white;
	                            color: #141415;
	                            padding: 8px;
	                            border-radius: 5px;
	                        }
 
 
	                        .forcedResponse {
	                            pointer-events: all !important;
 
 
	                            label {
	                                border-radius: 5px;
	                                position: absolute;
	                                right: -6px;
	                                cursor: pointer;
	                                bottom: -14px;
	                                transform: scale(2);
	                                z-index: 3;
	                                cursor: pointer;
	                                transition: all 0.4s 1s;
 
 
	                                &:hover {
	                                    right: -2px;
	                                }
	                            }
	                        }
	                    }
 
 
	                    &:after {
	                        display: block;
	                        width: $tileSize;
	                        height: $tileSize;
	                        transform: scale(3);
	                        image-rendering: pixelated;
	                        transform-origin: 0 0;
	                    }
	                }
	            }
 
	            // Game controls
 
 
	            &__control {
	                div {
	                    position: absolute;
	                    opacity: 0;
	                    pointer-events: none;
	                    border-radius: 4px;
	                    top: 50%;
	                    cursor: pointer;
 
 
	                    img {
	                        transform: scale(3);
	                        image-rendering: pixelated;
	                        position: relative;
	                        left: 0;
	                        top: 0;
	                        transition: all 0.3s;
	                    }
	                }
 
 
	                & .forward {
	                    transform: translateY(50px) translateX(-$tileSize);
	                    left: 66px;
	                    transition: all 0.3s 0s;
 
 
	                    &:hover {
	                        img {
	                            left: 4px;
	                        }
	                    }
	                }
 
 
	                & .backward {
	                    transform: translateY(50px) translateX(47px);
	                    right: 65px;
	                    transition: all 0.3s .1s;
 
 
	                    &:hover {
	                        img {
	                            left: -4px;
	                        }
	                    }
 
 
	                    img {
	                        transform: rotate(180deg) scale(3);
	                    }
	                }
 
 
	                & .up {
	                    top: 90px !important;
	                    left: 50%;
	                    transform: translateX(-50%) translateY(25px);
	                    transition: all 0.3s .2s;
 
 
	                    &:hover {
	                        img {
	                            top: -4px;
	                        }
	                    }
 
 
	                    img {
	                        transform: rotate(-90deg) scale(3);
	                    }
	                }
 
 
	                & .down {
	                    bottom: 350px !important;
	                    left: 50%;
	                    opacity: 0;
	                    top: auto;
	                    transform: translateX(-50%) translateY(10px);
	                    transition: all 0.3s .2s;
 
	                    &:hover {
	                        img {
	                            top: 4px;
	                        }
	                    }
 
 
	                    img {
	                        transform: rotate(90deg) scale(3);
	                    }
	                }
	            }
	        }
	    }
	}
 
 
	/* ------------------------------------------------------------------------------------
 
	Calculate the way an animated sprite should be shown from its width and frame count
	then animate the background image
 
	--------------------------------------------------------------------------------------- */
 
 
	@function walkCycle($frames, $width, $height, $row) {
 
 
	    $t: 100 / $frames;
	    $o: 0;
	    $p: '';
 
 
	    @for $i from 1 through $frames {
	        $o: $o + $t;
	        $p: $p + ($o - .1) + '%{background-position:-' + ($i - 1) * $width + 'px ' + $height * ($row - 1) + 'px;}';
	        $p: $p + $o + '%{background-position:-' + $i * $width + 'px ' + $height * ($row - 1) + 'px;}';
	        @if($o != 100) {
	            $p: $p + ($o + .1) + '%{background-position:-' + $i * $width + 'px ' + $height * ($row - 1) + 'px;}';
	        } @else {
	            $o: 100;
	        }
	    }
 
 
	    $v: '1%{background-position: 0px ' + $height * ($row - 1) + 'px;}' + $p;
 
 
	    @return unquote($v);
	}
 
 
	/* ------------------------------------------------------------------------------------------------------
 
	Name: Traverse through scenes
	Description: Makes it incredibly easy to trigger scene changes using the checkbox *hack*
	Instead of doing  input#index39:checked + input + div + div { props }
 
	--------------------------------------------------------------------------------------------------------- */
 
 
	@mixin traverse($n: 4) {
	    $div: "" !global; // Empty div string
	    $input: "" !global; // Empty input string
	    $input2: "" !global;
	    $input3: "" !global;
	    $input4: "" !global;
	    $label: "" !global; // Empty input string
	    $label2: "" !global;
	    $label3: "" !global;
	    $label4: "" !global;
	    $inputOffset: "+ input " !global;
 
 
	    // This needs to be made dynamic
 
 
	    @for $i from 1 through 47 {
	        $input: $input + "+ input " !global;
	        $inputOffset: $inputOffset + "+ input " !global;
	    }
 
 
	    @for $i from 1 through 35 {
	        $input2: $input2 + "+ input " !global;
	    }
 
 
	    @for $i from 1 through 23 {
	        $input3: $input3 + "+ input " !global;
	    }
 
 
	    @for $i from 1 through 11 {
	        $input4: $input4 + "+ input " !global;
	    }
 
 
	    @for $i from 1 through $columns {
	        @keyframes walk-#{$i} {
	            animation: walkCycle(6, 48, 48, 1);
	        }
	    }
 
 
	    @for $i from 1 through $n {
	        $div: "+ div" !global;
	        $position: $i !global; // Make this global so we can pass it in to our content
	        $i: $i !global;
	        $label: $label + "+ div " !global;
 
 
	        @if ($i > 1) {
	            $input: str_slice($input, 0, -9) !global; // Slice out the last input string
	            $input2: str_slice($input2, 0, -9) !global; // Slice out the last input string
	            $input3: str_slice($input3, 0, -9) !global; // Slice out the last input string
	            $input4: str_slice($input4, 0, -9) !global; // Slice out the last input string
	            $label2: $label2 + "+ div " !global;
	        }
 
 
	        @content;
	    }
	}
 
 
	/* ------------------------------------------------------------------------------------
 
	When in specified semgent, show the down arrow and the up arrow of the segment below
 
	--------------------------------------------------------------------------------------- */
 
 
	@mixin moveVerticleOnTile($row, $tile) {
 
 
	    $totalInputs: $rows * $columns - ($row * $columns - ($columns - $tile));
	    $totalDivs: $row * $columns - ($columns - $tile) + $columns + 2;
	    $id: $row * $columns - ($columns - $tile);
	    $tInput: '';
	    $tDiv: '';
	    $tInputDown: '';
 
 
	    @for $i from 1 through $totalInputs {
	        $tInput: $tInput + ' + input ';
	    }
 
 
	    @for $i from 1 through $totalDivs {
	        $tDiv: $tDiv + ' + div ';
	    }
 
 
	    @for $i from 1 through $totalInputs - $columns {
	        $tInputDown: $tInputDown + ' + input ';
	    }
 
 
	    .game_segment:nth-of-type(#{$id}) .tile:nth-of-type(14):after {
	        content: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/corridorLift.png');
	        position: relative;
	        display: block;
	    }
 
 
	    .game_segment:nth-of-type(#{$id}) .tile:nth-of-type(14):before {
	        display: block;
	    }
 
 
	    input#indexRow#{$row}-#{$tile}:checked #{$tInput} + div + div + .viewport > .game_segment:nth-of-type(#{$id + $columns})  {
	        & .down {
	            opacity: 1;
	            pointer-events: all;
	            transition: all 0.3s 1.1s;
	            transform: translateX(-50%) translateY(0px);
	        }
	    }
 
 
	    input#indexRow#{$row + 1}-#{$tile}:checked #{$tInputDown} + div + div + .viewport > .game_segment:nth-of-type(#{$id}) {
	        .tile:nth-of-type(14):after {
	            top :288px;
	        }
 
 
	        .tile:nth-of-type(14):before {
	            height: 373px;
	        }
	    }
 
 
	    input#indexRow#{$row + 1}-#{$tile}:checked #{$tInputDown} + div + div + .viewport > .game_segment:nth-of-type(#{$id + $columns}) {
	        & .up {
	            opacity: 1;
	            pointer-events: all;
	             transition: all 0.3s 1.1s;
	            transform: translateX(-50%) translateY(15px);
	        }
	    }
	}
 
 
	/* ------------------------------------------------------------------------------------
 
	Prevent movement labels showing on specified sement
 
	--------------------------------------------------------------------------------------- */
 
 
	@mixin makeWallAt($row, $tile) {
 
 
	    $totalInputs: $rows * $columns - ($row * $columns - ($columns - $tile));
	    $totalDivs: $row * $columns - ($columns - $tile) + $columns + 2;
	    $id: $row * $columns - ($columns - $tile);
	    $tInput: '';
	    $tDiv: '';
	    $tInputBack: '';
	    $tInputDown: '';
 
 
	    @for $i from 1 through $totalInputs + 1 {
	        $tInput: $tInput + ' + input ';
	    }
 
 
	    @for $i from 1 through $totalInputs - 1 {
	        $tInputBack: $tInputBack + ' + input ';
	    }
 
 
	    input#indexRow#{$row}-#{$tile - 1}:checked #{$tInput} + div + div + .viewport > .game_segment:nth-of-type(#{$id})  {
	        & .forward {
	            display: none !important;
	        }
	    }
 
 
	    input#indexRow#{$row}-#{$tile + 1}:checked #{$tInputBack} + div + div + .viewport > .game_segment:nth-of-type(#{$id})  {
	        & .backward {
	            display: none !important;
	        }
	    }
	}
 
 
	/* ------------------------------------------------------------------------------------
 
	Compare two inputs then do something
 
	--------------------------------------------------------------------------------------- */
 
 
	@mixin checkWinCondition($criteria, $criteria2, $result) {
 
 
	    $totalInputs: 48 + ($gameObjects - $criteria - 2);
	    $tInput: '';
 
 
	    @for $i from 1 through $totalInputs {
	        $tInput: $tInput + ' + input ';
	    }
 
	    input#interactiveObject#{$criteria}:checked + input:checked + input:checked #{$tInput} + div + div + div + div + div {
	        opacity: 1;
	        pointer-events: all;
	        & .game_win__inner {
	            opacity: 1;
	        }
	    }
 
	    input#interactiveObject#{$criteria}:checked + input:checked + input:checked #{$tInput} + div + div + div + div {
	        display: none;
	    }
 
	    input#interactiveObject#{$criteria}:checked + input:checked + input:checked #{$tInput} + div + div + div {
	        animation: end 2s forwards;
	        .forcedResponse {
	            display: none !important;
	        }
	    }
	}
 
 
	/* ------------------------------------------------------------------------------------
 
	Compare two inputs then do something
 
	--------------------------------------------------------------------------------------- */
 
 
	@mixin compare($input, $segment, $tile, $destroy, $waterfall, $plank) {
 
 
	    $totalInputs: 48 + ($gameObjects - $input - 1);
	    $tInput: '';
 
 
	    @for $i from 1 through $totalInputs {
	        $tInput: $tInput + ' + input ';
	    }
 
 
	    input#interactiveObject#{$input}:checked + input:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment - 1}) {
	        .game_segment__control {
	            display: block !important;
 
 
	            .backward, .forward {
	                display: block !important;
	            }
	        }
	    }
 
 
	    input#interactiveObject#{$input}:checked + input:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment + 3}) {
	        .game_segment__control {
	            display: block !important;
 
 
	            .backward, .forward {
	                display: block !important;
	            }
	        }
	    }
 
 
	    input#interactiveObject#{$input}:checked + input:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment + 1}) {
	        .game_segment__control {
	            display: block !important;
 
 
	            .forward {
	                display: block !important;
	            }
 
 
	            .backward {
	                display: block !important;
	            }
	        }
	    }
 
	    @if($destroy) {
	        input#interactiveObject#{$input}:checked + input #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment}) {
	            .tile img {
	                display: none;
	            }
	        }
 
 
	        input#interactiveObject#{$input}:checked + input #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment - 1}) {
	            .game_segment__control {
	                .backward,.forward {
	                    display: block !important;
 
 
	                }
	            }
	        }
	    }
 
 
	    input#interactiveObject#{$input}:checked + input:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment}) {
	        .game_segment__control {
	            .backward {
	                display: block !important;   
	            }
	        }
 
 
	        @if($waterfall) {
	            & + div .tiles .tile:nth-of-type(13) {
	                content: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/waterOff.gif');
 
	                img {
	                    display: none;
	                }
	            }
	        }
 
 
	        @if($plank) {
	            & + div .tiles .tile:nth-of-type(13) {
	                content: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/creepyCorridor-_170.png');
	                img {
	                    display: none;
	                }
	            }
	        }
	    }
 
 
	    input#interactiveObject#{$input}:checked + input:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment}) .tiles .tile:nth-of-type(#{$tile}) {
	        img {
	            display: none;
	        }
 
 
	        .forcedResponse {
	            display: none;
	        }
 
 
	        .responseSuccess  {
	            display: block;
	            animation: showResponse 2s forwards;
	        }
	    }
	}
 
 
	// Show the rain element on specific segment
 
 
	@mixin makeRainAt($segment) {
	    .viewport .game_segment:nth-of-type(#{$segment}) .drip_container {
	        display: block;
	    }
	}
 
 
	/* ------------------------------------------------------------------------------------
 
	Create an interactive object
 
	--------------------------------------------------------------------------------------- */
 
 
	@mixin makeInteractiveObject($reference, $segment, $tile, $force, $animate, $plank) {
 
 
	    $totalInputs: ($rows * $columns) + ($gameObjects - $reference);
	    $tInput: '';
 
 
	    @for $i from 1 through $totalInputs {
	        $tInput: $tInput + ' + input ';
	    }
 
 
	    @if($force) {
	        input#interactiveObject#{$reference}:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment + 1}),
	        input#interactiveObject#{$reference}:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment - 1}){
	            .game_segment__control {
	                display: none;
	            }
	        }
	    }
 
 
	    input#interactiveObject#{$reference}:checked #{$tInput} + div + div + div + div .game_inventory__item .item[data-reference="#{$reference}"] {
	        display: block;
	    }
 
 
	    @if($animate) {
	        input#interactiveObject#{$reference}:checked #{$tInput} + div + div + div {
	            animation: shake 1s forwards; 
	        }
	    }
 
 
	    input#interactiveObject#{$reference}:checked #{$tInput} + div + div + div > .game_segment:nth-of-type(#{$segment}) .tiles .tile:nth-of-type(#{$tile}) {
	        img {
	            pointer-events: none;
 
	            &.object {
	                display: none;
	            }
 
	            &.forced {
	                pointer-events: all;
	            }
	        }
 
 
	        .response  {
	            display: block;
	            animation: showResponse 2s forwards;
	        }
 
 
	        .forcedResponse {
	            display: block;
	            animation: forcedResponse 2s forwards;
	        }
	    }
	}
 
 
	// Check padlock code. The math is floored in this and so its not currently dynamic TODO
 
 
	@mixin checkCode($one, $two, $three, $segment, $tile) {
 
 
	    $diff: 2;
	    $diff2: 6; // 13
	    $diff3: 13; // 2
	    $diff4: 3; // 4
 
 
	    $inputPadlock: '';
	    $inputPadlock2: '';
	    $inputPadlock3: '';
	    $inputPadlock4: '';
	    //7,9,4
	    $totalInputs: 48 + ($gameObjects);
	    $tInput: '';
 
 
	    @for $i from 1 through $totalInputs {
	        $tInput: $tInput + ' + input ';
	    }
 
 
	    @for $i from 1 through $diff {
	        $inputPadlock: $inputPadlock + ' + input + span ';
	    }
 
 
	    @for $i from 1 through $diff2 {
	        $inputPadlock2: $inputPadlock2 + ' + input + span ';
	    }
 
 
	    @for $i from 1 through $diff3 {
	        $inputPadlock3: $inputPadlock3 + ' + input + span ';
	    }
 
 
	    @for $i from 1 through $diff4 {
	        $inputPadlock4: $inputPadlock4 + ' + input + span ';
	    }
 
 
	    input#interactiveObject--lock:not(:checked) + div #{$inputPadlock} + input:checked + span #{$inputPadlock2} + input:checked + span #{$inputPadlock3} + input:checked + span #{$inputPadlock4} + label #{$tInput} + div + div + div .game_segment:nth-of-type(#{$segment}) .tiles .tile:nth-of-type(#{$tile}) {
	        img {
	            display:none;
	        }
	        content: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/doorUnlocked.png')
	    }
 
	    input#interactiveObject--lock:not(:checked) + div #{$inputPadlock} + input:checked + span #{$inputPadlock2} + input:checked + span #{$inputPadlock3} + input:checked + span #{$inputPadlock4} + label #{$tInput} + div + div + div .game_segment:nth-of-type(#{$segment}) {
	        .forward,.backward {
	            display: block !important;
	        }
	    }
 
	     input#interactiveObject--lock:not(:checked) + div #{$inputPadlock} + input:checked + span #{$inputPadlock2} + input:checked + span #{$inputPadlock3} + input:checked + span #{$inputPadlock4} + label #{$tInput} + div + div + div .game_segment:nth-of-type(#{$segment - 1}) {
	        .forward,.backward {
	            display: block !important;
	        }
	    }
	}
 
 
	@include checkCode(7, 3, 6, 28, 13);
 
 
	/* ------------------------------------------------------------------------------------
 
	Assign an image/gif at a specific tile
 
	--------------------------------------------------------------------------------------- */
 
 
	@mixin assignTileAt($segment, $tiles, $id) {
	    @each $tile in $tiles {
	        .game_segment:nth-of-type(#{$segment}) .tiles .tile:nth-of-type(#{$tile}) {
	            content: url($id);
	        }   
	    }
	}
 
 
	/* ----------------------------------
 
	Init the traverse
 
	------------------------------------- */
 
 
	$animationIndex: 1;
 
 
 
 
	@include traverse($rows * $columns) {
 
 
	    /* ----------------------------------
 
	    Global scene transitions
 
	    ------------------------------------- */
 
 
	    $animationRow: floor($position / $columns);
	    $animationIndex: $position - ($animationRow * $columns);
	    $inputMap: $input, $input2, $input3, $input4;
 
 
	    @for $m from 1 through 4 {
	        input#indexRow#{$m}-#{$i}:checked #{nth($inputMap, $m)} #{$div} {
	            animation: walk-#{$animationIndex} $walkSpeed forwards;
	            //static-#{$animationIndex} 2s $walkSpeed infinite
	            //background-position: 0 48px;
 
 
	            & + div + div {
	                @if($debug) {
	                    left: (-$tileSize * $tilesPerSegment) * ($i - 1) / 2;
	                        } @else {
	                            left: (-$tileSize * $tilesPerSegment) * ($i - 1);   
	                                }
 
 
	                @if($debug != true) {
	                    clip-path: circle(140px at ((215px - ($tileSize * $tilesPerSegment)) + (($i - 1) * ($tileSize * $tilesPerSegment))) 212px + $segmentHeight * ($m - 1));
	                }
 
 
	                @if($debug) {
	                    top: -($segmentHeight *  ($m - 1)) / 2;
	                } @else {
	                    top: -$segmentHeight * ($m - 1);
	                }
 
 
	            }
	    }
 
 
	        input#indexRow#{$m}-#{$i}:checked #{nth($inputMap, $m)} #{$div} + div + .viewport > .game_segment:nth-of-type(#{$i + 1 + (($m - 1) * $columns)}) {
	            & .forward {
	                opacity: 1;
	                pointer-events: all;
	                transform: translateY(39px) translateX(-48px);
	                transition: all 0.3s .9s;
	            }
	        }
 
 
	        input#indexRow#{$m}-#{$i}:checked #{nth($inputMap, $m)} #{$div} + div + .viewport > .game_segment:nth-of-type(#{#{$i + (($m - 1) * $columns)}}) {
	            label {
	                pointer-events: all !important;
	            }
	        }
 
 
	        input#indexRow#{$m}-#{$i}:checked #{nth($inputMap, $m)} #{$div} + div + .viewport > .game_segment:nth-of-type(#{$i - 1 + (($m - 1) * $columns)}) {
	            & .backward {
	                opacity: 1;
	                pointer-events: all;
	                transform: translateY(39px) translateX(47px);
	                transition: all 0.3s 1s;
	            }
	        }
	    }
	}
 
 
	// Assign all our animated tiles
	@include assignTileAt(2, 10, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/spookyEyes.gif');
	@include assignTileAt(19, 10, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/spookyEyes.gif');
	@include assignTileAt(23, 11, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/spookyEyes.gif');
	@include assignTileAt(7, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/spookyEyes.gif');
	@include assignTileAt(5, 17, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/spookyEyes.gif');
	@include assignTileAt(3, 7, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(3, 7, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(6, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(8, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(15, 7, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(18, 7, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(10, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(30, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(27, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(21, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(24, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(44, 8, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
	@include assignTileAt(12, 7, 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/swingingLantern.gif');
 
 
	// Create objects
	@include makeInteractiveObject(1, 3, 15, false, false, false); // Empy crate
	@include makeInteractiveObject(2, 12, 15, false, false, false); // Pickaxe
	@include makeInteractiveObject(3, 7, 15, true, false, false); // Rock
	@include makeInteractiveObject(4, 8, 15, false, true, false); // Dynamite plunger
	@include makeInteractiveObject(5, 31, 13, true, false, false); // Dynamite door
	@include makeInteractiveObject(6, 18, 15, false, false, false); // Planks
	@include makeInteractiveObject(7, 29, 13, true, false, true); // Plank gap
	@include makeInteractiveObject(8, 6, 13, false, false, false); // Note 1
	@include makeInteractiveObject(9, 10, 13, false, false, false); // Note 2
	@include makeInteractiveObject(10, 29, 15, false, false, false); // Note 3
	@include makeInteractiveObject(11, 27, 13, false, false, false); // Lock door
	@include makeInteractiveObject(12, 26, 13, false, false, false); // Handle
	@include makeInteractiveObject(13, 46, 13, false, false, false); // Cog
	@include makeInteractiveObject(14, 47, 13, false, false, false); // Waterfall
	@include makeInteractiveObject(15, 15, 15, false, false, false); // Dynamite
	@include makeInteractiveObject(16, 48, 15, false, false, false); // Fuses
	@include makeInteractiveObject(17, 24, 15, false, false, false); // End door
	@include makeInteractiveObject(18, 19, 15, false, false, false); // Empty box 1
	@include makeInteractiveObject(19, 22, 15, false, false, false); // Empty box 2
	@include makeInteractiveObject(20, 33, 15, false, false, false); // Empty box 3
	@include makeInteractiveObject(21, 12, 13, false, false, false); // Empty box 4
	@include makeInteractiveObject(22, 44, 13, false, false, false); // Empty box 5
 
 
	// Compare game logic
	@include compare(2, 7, 15, false,false, false); // Compare pick to rock
	@include compare(4, 31, 13, true,false, false); // Compare plunger to door
	@include compare(6, 29, 13, false,false, true); // Compare planks to gap
	@include compare(12, 46, 13, false,true, false);
 
 
	// Check win condition
	@include checkWinCondition(15, 16, 17);
 
 
	// Create vertical tiles
	@include moveVerticleOnTile(1,5); //e.g make elevator between row 1 segment 5 and the tile below it
	@include moveVerticleOnTile(1,11); 
	@include moveVerticleOnTile(2,2);
	@include moveVerticleOnTile(2,8);
	@include moveVerticleOnTile(3,9);
 
 
	// Create walls
	@include makeWallAt(1,1);
	@include makeWallAt(1,8); // Blocking dynamite plunger
	@include makeWallAt(1,9);
	@include makeWallAt(1,13);
	@include makeWallAt(2,13);
	@include makeWallAt(2,4);
	@include makeWallAt(2,1);
	@include makeWallAt(3,1);
	@include makeWallAt(3,3);
	@include makeWallAt(3,4);
	@include makeWallAt(3,6); // door
	@include makeWallAt(3,10);
	@include makeWallAt(4,7);
	@include makeWallAt(4,13);
	@include makeWallAt(4,11);
 
 
	// Effects
	@include makeRainAt(3);
	@include makeRainAt(7);
	@include makeRainAt(15);
	@include makeRainAt(29);
	@include makeRainAt(22);
	@include makeRainAt(31);
	@include makeRainAt(47);
	@include makeRainAt(18);
 
 
	// Animations
	@keyframes showResponse {
	    0% {opacity:1; top: calc(50% - 36px);}
	    70% {opacity: 1;top: calc(50% - 46px);}
	    100% {opacity:0; top: calc(50% - 46px);}
	}
 
 
	@keyframes forcedResponse {
	    0% {opacity:1; top: calc(50% - 36px);}
	    70% {opacity: 1;top: calc(50% - 46px);}
	    100% {opacity:1; top: calc(50% - 46px);}
	}
 
 
	@keyframes logo {
	    0%{opacity: 0; transform: scale(0)}
	    100%{opacity: 1; transform: scale(1)}
	}
 
 
	@keyframes fadeIn {
	    0%{opacity: 0;}
	    100%{opacity: 1;}
	}
 
 
	@keyframes fadeOut {
	    0%{opacity: 1;}
	    100%{opacity: 0;}
	}
 
 
	@keyframes bar {
	    0%{width: 0%;}
	    100%{width: 100%;}
	}
 
 
	@keyframes dialogueIn {
	    0%{opacity: 0;left: 20px;}
	    10%{left: 20px;}
	    20%{left: 0px;}
	    30%{left: 20px;}
	    40%{left: 4px;}
	    50%{left: 18px;}
	    60%{left: 8px;}
	    70%{left: 20px;}
	    80%{left: 5px;}
	    90%{left: 16px;}
	    100%{opacity: 1;left: 20px;}
	}
 
 
	@keyframes shake {
	    0%{transform: translateX(0px)}
	    10%{transform: translateX(6px)}
	    20%{transform: translateX(-6px)}
	    30%{transform: translateX(6px)}
	    40%{transform: translateX(-6px)}
	    50%{transform: translateX(6px)}
	    60%{transform: translateX(-6px)}
	    70%{transform: translateX(6px)}
	    80%{transform: translateX(-6px)}
	    90%{transform: translateX(6px)}
	    100%{transform: translateX(0px)}
	}
 
 
	@keyframes end {
	    0%{transform: translateX(0px);opacity:1}
	    10%{transform: translateX(6px)}
	    20%{transform: translateX(-6px)}
	    30%{transform: translateX(6px)}
	    40%{transform: translateX(-6px)}
	    50%{transform: translateX(6px)}
	    60%{transform: translateX(-6px)}
	    70%{transform: translateX(6px)}
	    80%{transform: translateX(-6px)}
	    90%{transform: translateX(6px)}
	    100%{transform: translateX(0px);opacity:0;}
	}
 
 
	@keyframes shake-debug {
	    0%{transform: translateX(0px) scale(0.5)}
	    10%{transform: translateX(10px) scale(0.5)}
	    20%{transform: translateX(-0px) scale(0.5)}
	    30%{transform: translateX(10px) scale(0.5)}
	    40%{transform: translateX(-10px) scale(0.5)}
	    50%{transform: translateX(10px) scale(0.5)}
	    60%{transform: translateX(-10px) scale(0.5)}
	    70%{transform: translateX(10px) scale(0.5)}
	    80%{transform: translateX(-10px) scale(0.5)}
	    90%{transform: translateX(10px) scale(0.5)}
	    100%{transform: translateX(0px) scale(0.5)}
	}
 
 
 
 
	// Trailer
	// Labels are out

Source : Jamie Coulter

Et vous ?

Le CSS est-il un langage de programmation à part entière ? Sinon dans quelle catégorie le placez-vous ? Pour quelles raisons ?
Y a-t-il des raisons techniques de choisir le CSS pour la mise sur pied d'un jeu comme The Mine plutôt qu'un langage comme le Javascript ?

Une erreur dans cette actualité ? Signalez-nous-la !

Avatar de Pyramidev
Expert éminent https://www.developpez.com
Le 09/02/2024 à 19:36
Ça me rappelle une image de CommitStrip publiée le 15 mars 2019 suite à l'ajout des fonctions trigonométrique dans CSS :

7  0