totenkreuz Posted July 25, 2016 Share Posted July 25, 2016 Hi so, I'm trying to make a FlappyBird game with Day/Night Cycle so to do this I have 2 Background images set up on my game; one morning and another one for evening. I understand that I can just use loadTexture on this.background, but I want to Tween it for a better effect (hence the 2 background images). The animation that I wanted was to Tween this.nextBackground's opacity from 0 to 1. In my create function I have the following: this.game.physics.startSystem(Phaser.Physics.ARCADE); this.background = this.game.add.sprite(0, 0, 'morning'); this.nextBackground = this.game.add.sprite(0, 0, 'evening'); If it helps, I have a pipeGenerator timer that generates the pipes. this.pipeGenerator = this.game.time.events.loop(Phaser.Timer.SECOND * 1.25, this.generatePipes, this); and I'm planning to implement a dayNightCycler timer that changes from morning to night and vice versa by tweening. But as is, I'm already having poor performance while just adding the nextBackground. I noticed that whenever I create this.nextBackground, I am having poor performance issues, anyway I can make this work? Sorry was new to Phaser. Link to comment Share on other sites More sharing options...
3ddy Posted July 25, 2016 Share Posted July 25, 2016 I'm not sure if it does matter or not, but what size is your game and what size are your background images? Link to comment Share on other sites More sharing options...
totenkreuz Posted July 26, 2016 Author Share Posted July 26, 2016 23 hours ago, 3ddy said: I'm not sure if it does matter or not, but what size is your game and what size are your background images? I tried setting mode to CANVAS and it works perfectly now. It seems also that when testing on Simulator, I receive massive framerate drop, testing it on an actual device works good! Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts