drula Posted April 4, 2014 Share Posted April 4, 2014 Hi guys, Today I want to try make some simple game with Phaser, but I stuck at the beginning. I can't set background image, also there is no tutorial or examples about basics.I have a code like this: http://jsbin.com/solerulu/5/edit And I don't have any idea why it's not working. In firebug I see background.png is loaded but nothing happends. I see black rectangle only. Could soimeone help me? Link to comment Share on other sites More sharing options...
rich Posted April 8, 2014 Share Posted April 8, 2014 Hi, There are loads of examples (several hundred in fact) at http://examples.phaser.io and you'll find getting started tutorials as well. However your code wouldn't run at all for me inside jsbin, the phaser.min.js file wouldn't load, nor would the image. After changing a load of paths to files that I know exist and aren't locked down under CORs it worked fine:// main.jsvar game = new Phaser.Game(1000, 600, Phaser.CANVAS, 'game_div');var main_state = { preload: function() { game.load.image("background", "http://gametest.mobi/phaser095/assets/pics/aya_touhou_teng_soldier.png"); }, create: function() { game.add.tileSprite(0, 0, 1000, 600, 'background'); }, update: function() { }};game.state.add('main', main_state); game.state.start('main'); lpbr 1 Link to comment Share on other sites More sharing options...
lpbr Posted February 21, 2018 Share Posted February 21, 2018 Thank you for the heads up rich! Link to comment Share on other sites More sharing options...
Recommended Posts