view.showFPS = true
--> shows me that my game has 30 fps. it is verry laggy and my game needs an higher fps(frames per sec).
Why does my game have a low fps and how can I make this higher? I commented most of the code out and it still has low fps!
Thanks for everyone that will (try to) help to fix this.
Because your game is too graphics heavy and/or your programming is poor.
FPS stands for "frames per second". It is a quantitative measurement of the number of frames of your game that can be drawn in one second. Depending on your target hardware, there are a number of factors that could cause this. They are:
Too many graphics: Each sprite or character in your game, as well as backgrounds, enemies, entities, etc all must be drawn by the graphics processor. Each one of these takes a couple of milliseconds to draw. If the graphics are not optimized properly for your platform, then will game will slow down as the graphics hardware starts to lag behind the speed of your program.
Inefficient code: Game logic will be able to be executed very quickly in order for things to proceed properly. If your game uses a lot of functions that take time to execute, or has to do many complicated calculations often, then your game will slow down. In this case, I would recommend moving game logic to a separate thread or optimize your code. In Xcode, Instruments is a very useful tool for identifying slow sections of code so that you can speed them up.
Incapable hardware: It could be that your computer/device that your game runs on is simply not able to handle your game, whereas newer hardware may be able to. If this is the case, you may need to consider dropping support for older hardware. Running games in fullscreen mode is a very useful but often overlooked way to increase performance, as many operating systems suspend compositing and other graphics services so that your video card gets to dedicate more time to your program.
Here's the basics:
If you want your game to run at at least 60 FPS, then each frame must be able to be rendered in .0166666666666 milliseconds. As you can probably tell, that's not much time. That's why you must take the above suggestions seriously.