Hello,
I have made a simple android game, similar to flappy birds. When testing, I have found what the speed of the movements such as flying up or falling are good on my One Plus One (1920x1080 401 ppi), but when I tested on a smaller phone with a resolution of 480 x 854 and 196 ppi I found that it was a lot faster flying up and falling.
Is there any way of keeping the speed the same across all device sizes and types?
This is my movement code:
In my bird sprite file:
When rendering:
When jump is triggered:
Feel free to ask for more information Thankyou to anyone who helps.
I have made a simple android game, similar to flappy birds. When testing, I have found what the speed of the movements such as flying up or falling are good on my One Plus One (1920x1080 401 ppi), but when I tested on a smaller phone with a resolution of 480 x 854 and 196 ppi I found that it was a lot faster flying up and falling.
Is there any way of keeping the speed the same across all device sizes and types?
This is my movement code:
In my bird sprite file:
Java:
private int GRAVITY_LIMIT = -30;
public int gravity = 0;
//gravity
if(gravity>GRAVITY_LIMIT){
gravity= gravity-2;
}
//fall
y= y-gravity;
When rendering:
Java:
canvas.drawBitmap(bmp1, x, y, null);
When jump is triggered:
Java:
bird.gravity=30;