How do I make a node move in sprite kit swift -


i have been wondering how long time using sprite kit swift, problem don't know how make node move skactions basicly when go on scene put on see node moving (name node sprite) ,i not understand how works can please show me explained example on how this, thank in advance!

to move sprite in sprite-kit can use skactions.

for example:

let action = skaction.movebyx(3, y: 2, duration: 10) 
  • this make sprite move 3 units along x-axis , 2 units along y axis in 10 seconds.

if want sprite move specific place, can do:

let action2 = skaction.moveto(location: cgpoint, duration: nstimeinterval) 

hope helped!


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -