I've been writing a 2D Surfaceview game for what seems an eternity now and I simply cannot get my head around screen independence for Android.
Basically, my sprite jumps like so: Y value is decreased by an amount (I call it the 'step amount'), then the step amount is reduced by say, 1 and that goes on until the step amount is a negative number which then in effect gets added to the sprite's Y value and it 'falls' back down - works perfectly (This is the way I've always made sprites 'jump').
The problem comes when I run this on a different DPI screen - it still works, but the sprite jumps to a completely different height relative to the screen size.
I understand why this is happening, but I just can't work out a way to fix it!
How do I get it 'jumping' to the correct height on all screen res? (I'm working mainly with 160 and 240 DPI at the moment)
Thanks, would really appreciate any comments.
Regards