Ian Renton commited on
Commit
5be30bb
1 Parent(s): 55dcd78

But can it run DOOM? (yes)

Browse files
Files changed (4) hide show
  1. code.js +22 -0
  2. index.html +1 -1
  3. misc/doom.png +0 -0
  4. style.css +7 -0
code.js CHANGED
@@ -2,6 +2,28 @@
2
  function newWindow(element) {
3
  $(element).show();
4
  $(element).selectWindow();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  }
6
 
7
  $( function() {
 
2
  function newWindow(element) {
3
  $(element).show();
4
  $(element).selectWindow();
5
+
6
+ if (element == '#doom') {
7
+ loadDoom();
8
+ }
9
+ }
10
+
11
+
12
+ // Load DOOM, because we can
13
+ function loadDoom() {
14
+ $.getScript('https://js-dos.com/6.22/current/js-dos.js', function() {
15
+ Dos(document.getElementById("doomcanvas"), {
16
+ wdosboxUrl: "https://js-dos.com/6.22/current/wdosbox.js",
17
+ cycles: 1000,
18
+ autolock: false,
19
+ }).ready(function (fs, main) {
20
+ fs.extract("https://js-dos.com/cdn/upload/DOOM-@evilution.zip").then(function () {
21
+ main(["-c", "cd DOOM", "-c", "DOOM.EXE"]).then(function (ci) {
22
+ window.ci = ci;
23
+ });
24
+ });
25
+ });
26
+ });
27
  }
28
 
29
  $( function() {
index.html CHANGED
@@ -90,7 +90,7 @@
90
  <div class="windowtitle">DOOM</div>
91
  </div>
92
  <div class="windowinner">
93
- <img src="misc/doom.png"/>
94
  </div>
95
  </div>
96
  </body>
 
90
  <div class="windowtitle">DOOM</div>
91
  </div>
92
  <div class="windowinner">
93
+ <canvas id="doomcanvas"></canvas>
94
  </div>
95
  </div>
96
  </body>
misc/doom.png DELETED
Binary file (193 kB)
 
style.css CHANGED
@@ -143,4 +143,11 @@ textarea.fullwindowdosprompt {
143
  .icon p.highlight {
144
  background-color: darkblue;
145
  color: white;
 
 
 
 
 
 
 
146
  }
 
143
  .icon p.highlight {
144
  background-color: darkblue;
145
  color: white;
146
+ }
147
+
148
+ /* DOOM */
149
+ #doomcanvas {
150
+ background-color: black;
151
+ width: 640px;
152
+ height: 480px;
153
  }