Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

General guideline on how to make an HTML document while porting a SDL c++ game with emscripten.

A topic by docjenny created 69 days ago Views: 98 Replies: 2
Viewing posts 1 to 2

I'm working on an SDL c++ game and I've used emscripten to port it for web, If i upload the generated index.html file, it says no file to embed so i generated an index.js file and used this:


<body>
<center>
    <canvas id="canvas"></canvas>
    <script type='text/javascript'>
        var Module = {
            canvas: (function() { return document.getElementById('canvas'); })()
        };
    </script>
    <script src="index.js"></script>
</center>
</body>

Is there a general guideline on what i should add here in order to make it accessible to itch.io? Or can someone point me in the proper direction please. I m really lost here.

Moderator

Could you please paste the exact error message? If you already had an index.html then you shouldn't have to replace it. The problem could be from somewhere else. Did you tick the checkbox labeled "this file will be played in the browser" after uploading?

hello! I fixed the error! The above mentioned code seems to have worked! Sorry for wasting your time. 

I was uploading a rar file instead of a zip file. 

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.