ios - How to vary impulse/velocity based on screen size/device -


i building game swift have sprites moving around screen have avoid. when test game on iphone 5, objects harder avoid on 6 or 6+. think because had velocity same across board (i adjusting sizes based on screen size). changed original impulse try , vary based on screen size matching numbers had cgvectors

let gonex = screenwidth/6 let goney = screenheight/9 let gtwox = screenwidth/6 let gtwoy = screenheight/9  ghostone.physicsbody?.applyimpulse(cgvectormake(gonex, -goney)) ghosttwo.physicsbody?.applyimpulse(cgvectormake(-gtwox, gtwoy)) 

i did this, , helped enough notice difference between devices, still not acceptable. objects still harder or easier avoid based on device.

is there other way can vary impulse?


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -