Publishing to desktop

The second platform that Construct 2 can export your game to is the desktop. In publishing to the desktop, Construct 2 has a very straightforward way of exporting. The easiest way is exporting using the node-webkit; node-webkit is just like a Chrome web browser, but it is designed as standalone software. Being a standalone version, it doesn't have an address bar, a back button, and tabs.

Exporting using node-webkit

An advantage of exporting using node-webkit is that your final game file can be played on all the major desktop operating systems, such as Windows, Mac OS, and Linux. You only need to perform one export process for all three platforms as follows:

  1. Publishing using node-webkit is also easy; as usual click, on the File menu and then on Export project. Scroll down to the bottom, select node-webkit, and click on Next.

    The export options that you will see next are just the same as when you export to the Web. After deciding where to put the exported files, just click on the Export button. Here, you'll see the export options for node-webkit. I will explain these options to you in a nutshell:

    • Single instance: If this is checked, you only allow one instance of the game to run; no two games can run alongside each other
    • Window frame: Checking this will show the game's border; uncheck it if you want to hide the window frame
    • Resizable window: Checking this will allow the player to resize the game window
    • Kiosk mode: If you check this, you'll disable the minimize and maximize controls for the window; this is for games that are intended to be played at a kiosk/booth at exhibition places

    These modes can be seen in the following screenshot:

    Exporting using node-webkit
  2. You can leave the node-webkit options at the default configurations with the first three options checked, or you can customize something yourself.
  3. Clicking on the Export button will package the game to the place you specified earlier in the export process. In this exported folder, there are four more folders: linux32, linux64, osx for Macintosh, and win32; each folder contains the game files for their target platforms. The files needed to play the game for each OS are inside the respective folders; for Windows, you only need to double-click on the .exe file.
    Exporting using node-webkit

Tip

You can separate and rename each of these four folders. It's usually a good idea to rename them, so if you want to share the game with someone who only has a Mac, you only need to give them the osx version.

Publishing as an Open Web App

An Open Web App is an HTML5-based app format that any digital application store can use; this format is invented by Mozilla. Even though it is intended to be able to be used by as many application stores as possible, right now, only Mozilla is using it for their Firefox marketplace. Firefox marketplace apps can be installed on the desktop from the Firefox browser or even from Firefox on Android.

As a game exported on a Firefox marketplace can be played on a desktop and mobile, it is advised that you check whether the player plays it from their desktop or phone. You can do this from the tips I gave in Chapter 9, Mastering the Best Practices. Exporting to the Firefox marketplace is a good alternative compared to using node-webkit; it is almost as easy, and it's ready to be distributed to a lot of people using Firefox.

  1. First, open your project properties; remember that you can do this by clicking on the project's name in the Projects bar and fill out the Name, Description, and Author fields. Fill them out with the game's name, game's description, and the developer's name, respectively. This is one of the requirements for the Firefox marketplace.
    Publishing as an Open Web App
  2. Export your project as usual; but this time, select the Open Web App as the platform to export to. The export options are the same as the ones you see when exporting to any other platforms.
  3. After you click on Next, the Open Web App options window comes up. There are two kinds of Open Web App games you can make: packaged app and hosted app.

    Note

    A packaged app is a package that contains all your game files; the player can play it directly on their PC or mobile devices, while a hosted app is like a website but distributed as an app; you'll need your own server hosting for a hosted app.

  4. In the lower section of this options window is the Permissions section. If your game uses geolocation or the file-storage feature, you need to check either of these checkboxes. This is needed to ask for user permission before enabling these features on the game.
    Publishing as an Open Web App

Exporting a packaged app

A packaged app is the easiest way to export to the Firefox marketplace, because you don't need your own hosting. If you don't need any permission from the player, you can just click on the Export button. After the exporting is done, go to the exported files folder and archive all of them to a ZIP file. This ZIP file is the file you submit to the Firefox marketplace.

To make a ZIP file, first select all the files you want to archive and then right-click on them and select Add to archive…:

Exporting a packaged app

A dialog window will show up; change the archive format to ZIP and rename it to whatever you want to, but it's better to name it similar to the game you're uploading. When you're done, click on the OK button, and the files will be archived.

Exporting a packaged app

Make sure that you package all the files in the folder to a ZIP file and not the exported folder where all the files are placed. This is important, as the index.html file must be at the top level in your ZIP file. This is because when submitting to the Firefox marketplace, the marketplace will look for the index.html file at the top level of your ZIP file. If you zip the folder where all the files are located, the marketplace won't find your index.html file, and your game will be rejected.

Exporting a hosted app

Exporting a hosted app is a bit difficult because you must also set up your hosting. Perform these steps to export a hosted app:

  1. When you're exporting a hosted app, you must supply the server path. This path is relative to the domain and must be set depending on where your game will be uploaded. So, if your game is located at http://www.yoursite.com/games/gameName/, the server path should be set to /games/gameName/. After that, you can export your game.
  2. After you're done, the final files you get will be similar to other HTML5 website files. You only need to upload these files to the Web. If you don't have a web host already, start looking for one that is.
  3. You also need to configure your server MIME types; if you don't know what this means, then contact your website support centre. There are a few MIME types to set, such as the following ones:
    • application/x-web-app-manifest+json: This is for the .webapp file extension. This is a must; the Firefox marketplace won't allow you to submit an app if this is not done right.
    • text/cache-manifest: This is for .appcache so that offline support works.
    • audio/ogg: This is for .ogg so that the .ogg audio files can play.
    • audio/mp4: This is for .m4a so that the .m4a format audio files can play.

Note

More information on exporting to Open Web App can be found at https://www.scirra.com/tutorials/430/how-to-export-an-open-web-app-for-firefox-marketplace.

Again, if you are not sure about setting MIME types, ask your web host support team; if you want to know more about MIME types yourself, visit https://www.scirra.com/manual/168/mime-types.

Submitting to the Firefox marketplace

Now that all the files are prepared, it's time to submit your game to the Firefox marketplace. To start, go to https://marketplace.firefox.com/developers/ and sign up for a developer account. After that, you can submit your game through https://marketplace.firefox.com/developers/submit/. For a hosted app, you need to provide the full URL to the .webapp file, while for the packaged app, you simply need to upload your game's ZIP file.

When submitting, you can also provide more details of your game and select what devices you support. Since Construct 2 is a cross-platform engine, you should be able to support all platforms.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset