Jump to content

Load Sprite from .zip on hosted site


Recommended Posts

So as the title says really. I participated in the #CandyJam and got a game made in short time. I never participate in game jams because i try to put a lot into the games  try to make. But my issue anyway is its being hosted on itch.io and for html it requires a .zip file.

I've uploaded the file numerous times and still have the same problem. Now i know its nothing to do with how i've coded the sprites because i have a backdrop that is loaded the same way and that has no issues at all loading on the site. 

Its loading the group ive created but without the images and giving me the black boxes with green lines on them.

Here how I'm adding it in anyway just for referencing sake.

function preload(){	game.load.image('sweet1', 'assets/sweet1.png');	game.load.image('sweet2', 'assets/sweet2.png');	game.load.image('sweet3', 'assets/sweet3.png');	game.load.image('backdrop', 'assets/candyBG.png');}
    sweetgroup = game.add.group()    for(var i = 0; i < numofSweets; i++)    {   	sweet1 = sweetgroup.create(game.world.randomX,game.world.height - 30, 'sweet1');   	sweet2 = sweetgroup.create(game.world.randomX,game.world.height - 30, 'sweet2');   	sweet3 = sweetgroup.create(game.world.randomX,game.world.height - 30, 'sweet3');   	sweet1.body.gravity.y = game.rnd.integerInRange(1.5,3);   	sweet2.body.gravity.y = game.rnd.integerInRange(1.5,3);   	sweet3.body.gravity.y = game.rnd.integerInRange(1.5,3);    sweetgroup.collideWorldBounds = true;    }

I've declared sweet1,sweet2 and sweet3 as vars above. 


Any ideas why it's not loading from the zip file?

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...