i3Designer Posted November 11, 2014 Share Posted November 11, 2014 My game goes very slow on some computers, why?http://games.samuelesciacca.it/golden/ Link to comment Share on other sites More sharing options...
hellspawn_bg Posted November 11, 2014 Share Posted November 11, 2014 Works fine on mine Link to comment Share on other sites More sharing options...
lewster32 Posted November 11, 2014 Share Posted November 11, 2014 The large semi-opaque scrolling background will probably slow some devices down, so if you can instead change the colour of the background to what it is in the game, and reduce the size of it (chop off the bottom half which is just solid black) you reduce the amount of pixels the game has to draw on the screen (the 'fill rate', a limiting factor on many devices). From a code point of view, try to reduce the amount of collide and overlap calls as much as possible, and put your logic inside the callback depending on which two objects collide - each call to collide and overlap is fairly expensive. Also, turn off advanced timing as this can slow your game down somewhat. Finally, try not to update this.text every frame - do it only when necessary, i.e. when the text actually gets changed. The Phaser.Text object has a check in place to ensure it doesn't do anything unless the incoming text is different from the current text, but it's still a good general practice to bear in mind; there should be as little waste as possible, and you should strive to ensure only code that is absolutely necessary is being executed. Most of the above can be tested to see how effective they'll be by just changing bits of your code/commenting stuff out. For instance, get rid of the scrolling background and see how much that improves performance; remove the collide/overlap checks for the falling block; remove the score text etc etc. Link to comment Share on other sites More sharing options...
Recommended Posts