Ezowolf Posted November 30, 2016 Share Posted November 30, 2016 Hey all, still pretty new to Phaser. I'm trying to create destructable terrain akin to games like Worms. The problem I have now is that it seems the visual part of the land only seems to update on the first frame. However, the console logs stop, indicating that there's no longer an image, even though there's still visibly an image. This is the code I have now: Quote var land; var Game = { init: function() { game.renderer.renderSession.roundPixels = true; }, preload:function() { Game.load.image('land','Assets/Images/land.png') }, create:function() { game.stage.backgroundColor = "#4488AA"; land = Game.add.bitmapData(992, 480); land.draw('land'); land.update(); land.addToWorld(); }, update:function() { if((land.getPixel(game.input.mousePointer.x,game.input.mousePointer.y).a)>0) { console.log("Terrain Found"); DestroyTerrain(); } } } function DestroyTerrain() { land.blendDestinationOut(); land.circle(game.input.mousePointer.x,game.input.mousePointer.y, 16, 'rgba(1, 0, 0, 255)'); land.blendReset(); land.update(); } Anybody with more experience with Phaser know what might cause this? Link to comment Share on other sites More sharing options...
Recommended Posts