Jump to content

Having a little trouble with a moving background


DashingBob
 Share

Recommended Posts

I set up a moving background with a png for my game.

It works great when testing it out in a browser but won't function on a mobile platform.

This is the way I have it set up

 

window.onload = function() {
 
 
var bgtile
 
var screenW = window.screen.width
 
 
     play.prototype = {

 

                        preload:function(){

 

                                                       game.load.image('bgtile', 'assets/Space.png');}

 

 

 

                          create:function(){

 
                                                   bgtile = game.add.tileSprite(0, 0, screenW, game.cache.getImage('bgtile').height, 'bgtile');
}
}
}

Any tips that could help? or does this just not transfer across platforms?
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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