Moving a sprite (SpriteKit) along a UIBezierPath in steps -


i able generate uibezierpath use skaction.followpath in order make sprite follow path after calling runaction. this, can make sprite follow bezier path start of path endpoint.

however, i'm going following:

  1. generate fixed path, such uibezierpath
  2. this path have 10 points along it
  3. using button press, move sprite (currently on starting point along path) 1 "move" along next point.
  4. using button presses, i'll continuously move sprite along fixed path in 10 discrete steps

probably similar example i'm trying achieve candy crush level map. in this, have curvy path along there points move character along in discrete steps.

thank help!

world map

instead of using bezier path why not store points in array. each time touch button pop off end of array , skaction.moveto(yourpoint)


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -