Skip to content

Commit ea1a97a

Browse files
committed
Fullscreen
1 parent ef8e699 commit ea1a97a

7 files changed

Lines changed: 434 additions & 361 deletions

File tree

assets/web/game.css

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
html,
22
body {
3-
width: 100vw;
4-
height: 100vh;
3+
width: 100%;
4+
height: 100%;
55
margin: 0;
66
padding: 0;
77
background-color: black;
8+
margin-top: 0.5px
89
}
910

10-
@media (orientation: portrait) {
11+
@media (orientation: landscape) {
1112
html,
1213
body {
13-
margin-top: -25px;
14+
width: 100vw;
15+
height: 100vh;
1416
}
1517
}
1618

@@ -21,10 +23,21 @@ body * {
2123
user-select: none;
2224
}
2325

24-
.game {
26+
.game,
27+
.game_container {
28+
display: block;
29+
touch-action: none;
2530
margin: auto;
26-
width: 100vw;
27-
height: calc(100vh - env(safe-area-inset-bottom, 0px));
31+
width: 100%;
32+
height: 100%;
33+
}
34+
35+
@media (orientation: landscape) {
36+
.game,
37+
.game_container {
38+
width: 100vw;
39+
height: calc(100vh - env(safe-area-inset-bottom, 0px));
40+
}
2841
}
2942

3043
canvas {

converter/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ function transformLevel(spec) {
304304
const n = j * format.size.width + i;
305305
format.room[n] = {};
306306
format.room[n].id = spec.layout[n];
307-
let next = 1;
307+
let next;
308308
let eventID;
309309
if (spec.layout[n] !== -1) {
310310
// Copy tiles

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
<script src="src/tiles/Torch.js"></script>
6161
</head>
6262
<body oncontextmenu="return false;">
63-
<div class="game" id="gameContainer"></div>
63+
<div class="game">
64+
<div class="game_container" id="gameContainer"></div>
65+
</div>
6466
<script type="text/javascript">
6567
window.onload = () => {
6668
let game = new Phaser.Game(640, 400, Phaser.AUTO, "gameContainer", null, false, false);

0 commit comments

Comments
 (0)