Is there a way to check the maximum FPS a device supports before setting the FPS which your app will run at?
Not really. In theory you could run a small benchmark in config.lua before setting the FPS value, but… probably not a good idea other than as test of things you could do.
I am making a space shooter game and I have the bullets fly the height of the screen over the course of 1 second with a moveBy() and it looks terrible and choppy on 30 fps devices, what can I do to make the movement of the bullets smoother?
There are a couple of things. First, most modern devices should be able to run at 60 fps. Secondly, depending on how your config.lua is setup, you might want to use transition.to() since it will do sub-pixel moves. The other thing, if you’re moving a object say 480 points (assuming your shooting along the long side of the device and your content area is 320x480) and 30 frames per second, you’re bullets have to move 16 points per frame. 60 fps, it has to move 8 points. You may not be able to get all the jitter out.
Rob
Okay I tried and switch from moveBy() to transition.to() and think I can notice a slight difference. Is there something I actively have to do to get this sub-pixels movement you are speaking of?
No. I may have confused with with the term sub-pixel moving. Your config.lua defines a content area in points. Depending on the device your point might be represented by multiple pixels or it might be represented by fractional pixels. A point could be made up of 3.5 physical pixels. The transition.to() call will move your object with floating numbers, not integers (or whole points). If your device resolution vs. your defined content area are not pixel perfect, it will be moving by fractional values.
If you moved it yourself by doing object.x = object.x + 1, it could cause some jitter since one content point could represent multiple pixels.
Rob
Not really. In theory you could run a small benchmark in config.lua before setting the FPS value, but… probably not a good idea other than as test of things you could do.
I am making a space shooter game and I have the bullets fly the height of the screen over the course of 1 second with a moveBy() and it looks terrible and choppy on 30 fps devices, what can I do to make the movement of the bullets smoother?
There are a couple of things. First, most modern devices should be able to run at 60 fps. Secondly, depending on how your config.lua is setup, you might want to use transition.to() since it will do sub-pixel moves. The other thing, if you’re moving a object say 480 points (assuming your shooting along the long side of the device and your content area is 320x480) and 30 frames per second, you’re bullets have to move 16 points per frame. 60 fps, it has to move 8 points. You may not be able to get all the jitter out.
Rob
Okay I tried and switch from moveBy() to transition.to() and think I can notice a slight difference. Is there something I actively have to do to get this sub-pixels movement you are speaking of?
No. I may have confused with with the term sub-pixel moving. Your config.lua defines a content area in points. Depending on the device your point might be represented by multiple pixels or it might be represented by fractional pixels. A point could be made up of 3.5 physical pixels. The transition.to() call will move your object with floating numbers, not integers (or whole points). If your device resolution vs. your defined content area are not pixel perfect, it will be moving by fractional values.
If you moved it yourself by doing object.x = object.x + 1, it could cause some jitter since one content point could represent multiple pixels.
Rob