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
Post a Comment