julilopez Posted March 12, 2014 Share Posted March 12, 2014 Hello, I have a question. I add a group to my game, and try to repeat that over a time interval. monkeyObstacle = game.add.group();monkeyObstacle.createMultiple(5, 'monkey_obstacle');this.timerMonkey = this.game.time.events.loop(2000, this.addMonkey, this); addMonkey: function() { var monkey = monkeyObstacle.getFirstDead(); monkey.reset(1300, 47); monkey.body.velocity.x = - 200; monkey.outOfBoundsKill = true; ;}But not always respect the allocated time interval (2000). Red circles in the selected interval is respected, but the green leaves of respect. What could be the cause? Link to comment Share on other sites More sharing options...
temporalix Posted March 13, 2014 Share Posted March 13, 2014 when I've used timer , sometimes its seems like the fps drops or something and things happen sooner or later than what they should be, when I set up bullets to shoot at a constant rate every few seconds there would be lag. It could be that there is only 5 monkeys in the group and they aren't being removed quick enough when out of bounds, try increasing the amount in the group maybe? and see if that helps Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 13, 2014 Share Posted March 13, 2014 5 instances in the group can be low and i think that we would need to have access to your code since it might be other problem. Your code seems to be fine Link to comment Share on other sites More sharing options...
Recommended Posts