ios - Apply an impulse to SKNode to move across screen and detect collision -


i making basic app pushes shapes across screen , detects collision sprite kit. first attempt using moveto on nodes. issue had collision, objects rotate around each other instead of bounce.

therefore found need use applyforce or applyimpulse.

in situation have circle example position off screen @ start of life. determine target exit point, , want 'flick'/'push' node in direction.

i cannot figure out how applyimpulse towards target end position have cgpoint. need cgvector not sure needs done. had around , found ray tuts show applyforce or moveto. not sure how calculate this.

i found site explains 2d physics well.
http://www.rodedev.com/tutorials/gamephysics/

with worked out angle needed , have speed can control , works well.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -