WARN! This version is absolute, please switch to js-dos 6.22

Grand Prix Circuit

Play in the legendary game Grand Prix Circuit in browser. (Uploaded by: colin)


Fullscreen

Read more

Risk The Word Conquest

Play in the legendary game Risk The Word Conquest in browser. (Uploaded by: @nib)


Fullscreen

Read more

Utopia The Creation of a Nation

Play in the legendary game Utopia in browser. (Uploaded by: @BlockHeadVincent)


Fullscreen

Read more

Donkey Kong

Play in the legendary game Donkey Kong in browser. (Uploaded by: @megalanya)


Fullscreen

Read more

Alley Cat

Play in the legendary game Alley Cat in browser.


Fullscreen

Read more

Dangerous Dave in the Haunted Mansion

Play in the legendary game Dangerous Dave in the Haunted Mansion in browser.


Fullscreen

Read more

Xonix

Play in the classic game Xonix in browser.


Fullscreen

Read more

Digger

In getting started tutorial we will launch Digger game in browser.


Fullscreen

Details

  • Digger was created in 1983
  • Creator Windmill Software
  • Category Arcade
  • Age rating +0
  • Platform PC

Digger is one of the first PC game. The game was created in 1983. Let`s try to bring this legendary game in our time.

To run this game in browser you will need a zip archive with game, and a server that can host static web page. You can start with a template plunk, codepen:

 1 <!doctype html>
 2   <html lang="en-us">
 3     <head>
 4       <meta charset="utf-8">
 5       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 6       <title>js-dos api</title>
 7       <style type="text/css">
 8         .dosbox-container { width: 640px; height: 400px; }
 9       </style>
10     </head>
11     <body>
12       <div id="dosbox"></div>
13       <br/>
14       <button onclick="dosbox.requestFullScreen();">Make fullscreen</button>
15       
16       <script type="text/javascript" src="https://js-dos.com/cdn/js-dos-api.js"></script>
17       <script type="text/javascript">
18         var dosbox = new Dosbox({
19           id: "dosbox",
20           onload: function (dosbox) {
21             dosbox.run("https://js-dos.com/cdn/digger.zip", "./DIGGER.COM");
22           },
23           onrun: function (dosbox, app) {
24             console.log("App '" + app + "' is runned");
25           }
26         });
27       </script>
28     </body>
29   </html>

First of all we should prepare viewport where dosbox will render the game. Look at line 8 we set the dosbox-container size to 640x400 px. This means that Digger will runs in screen with resolution 640x400 px.

At line 16 the js-dos-api.js was included. After processing this line, browser will download js-dos internals and prepare js-dos engine to work.

Finally we should bootstrap Digger game in browser.

1 var dosbox = new Dosbox({
2     id: "dosbox",
3     onload: function (dosbox) {
4       dosbox.run("https://js-dos.com/cdn/digger.zip", "./DIGGER.COM");
5     },
6     onrun: function (dosbox, app) {
7       console.log("App '" + app + "' is runned");
8     }
9   });
  • id - a HTML element id where dosbox will create the dosbox canvas
  • onload - a callback that was called when dosbox is initialized
  • onrun - a callback that was called when dos application was runned

On line 4 we actually start the game:

1 dosbox.run("https://js-dos.com/cdn/digger.zip", "./DIGGER.COM");
  • First argument is the place where archive with digger is located
  • Second argument is a executable file name

Now you can run Digger or any other dos game in browser.

Have fun!