Chefo Posted March 24, 2018 Share Posted March 24, 2018 Hello, I'm using Phaser CE trying to make a very simple game were two cowboys shoot them but in the middle there is a Cactus which gets destroyed with every shot. I followed this example https://phaser.io/tutorials/coding-tips-002 run nice in every browser. So I have almost everything working in chrome but in Firefox I cant see anything drawn over the BMP. It's hard to simplify my original code. So I tried to build a very simple one to showcase my problem by extracting code from the example link. I just want to draw a whole when pressing key A. I also tried with different blending modes. It still does run ok in chrome but not in FF nor safari. Has it anything to do with my code or with the browsers...? var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var background; var landBMP; function preload() { game.load.image('land','assets/images/land.png'); game.load.image('background','assets/images/background.png'); } function create() { boomKey = game.input.keyboard.addKey(Phaser.Keyboard.A); boomKey.onDown.add(drawBoom, this); // Load Background background = this.add.sprite(0, 0, 'background'); // Load bmp data landBMP = this.add.bitmapData(992, 480); landBMP.draw('land'); landBMP.update(); landBMP.addToWorld(); } function drawBoom(){ landBMP.blendDestinationOut(); landBMP.circle(300, 400, 60, 'rgba(0, 0, 0, 255'); landBMP.blendReset(); landBMP.update(); } function update() { } Any help is apreciated PS: I attached my results with chrome and firefox after pressing A key Link to comment Share on other sites More sharing options...
Chefo Posted March 30, 2018 Author Share Posted March 30, 2018 I added a Codepen to try it https://codepen.io/MrChef/pen/KooZmo Link to comment Share on other sites More sharing options...
Recommended Posts