Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

My HTML game don't work

A topic by FantasyPaperDolls created Oct 05, 2021 Views: 1,495 Replies: 10
Viewing posts 1 to 3

Hi! When I upload my .zip file with everything in it, nothing but the index.html works.  Someone knows why could this be happening?

Moderator

What do you mean by "nothing but the index.html works"? Are there any errors in the browser console?

In my computer it works, but when I upload it here, the only thing that shows up are the buttons (it is a really small dress up game I made following a tutorial). I'll took some screenshots.

This is what happens.

How are you referring to other files within the index.html? They should be relative paths, either flat within the same directory like src="spritesheet.png" or in subdirectories like src="images/spritesheet.png", and if they're in subdirectories then the zip file needs to have the same directory shape.

Like this (it is a small dress up game): 

<link rel="stylesheet" type="text/css" href="css/style.css">

<script src="js/code.js"></script>

Try using your browser's development console. It varies from browser to browser a little, but it can show you what requests the page is making when you load it and you can see whether it's requesting the files you think it's requesting and whether they're coming back as 404 errors.

In Firefox, you'd open your game's iframe in its own tab, then in that tab press-control-shift-K, then the "Network" tab of the console UI that appears. I think Chrome is similar but with control-shift-J, or possibly some other combination if you happen to be on a Mac.

Thank you! It said error 403 on .css and .js files, I'm going to see what it is and what it happens!

Now that I look better, it also says there is a 404 error

Your zip file's subdirectory structure might not have the files in the right places. Try unzipping your zip file into a new folder locally and seeing if the files end up landing in the relative locations they're supposed to be in.

They are in their right folders :( Thank you anyway, I'll keep looking for other options. 

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