Friday 15 January 2010

What am I doing wrong with this Code Xcode Swift? -



What am I doing wrong with this Code Xcode Swift? -

im trying background image not working me. first skspritenode leave screen want add together skspritenode next , want repeat forever. endless background. in flappy bird sky background , ground moves forever. how this? thanks. have far not doing want do.

override func didmovetoview(view: skview) { // background in 0...3{ allow background = skspritenode(imagenamed: "background") background.setscale(1.0) background.zposition = 0 background.position = cgpoint(x: cgfloat(i) * background.frame.size.width, y:0) background.runaction(moveforeveraction(background)) addchild(background) } func moveforeveraction(node: skspritenode) -> skaction { allow movenode = skaction.movebyx(0, y:node.size.height, duration: nstimeinterval(cgfloat(gamespeed) * node.size.width)) allow resetposition = skaction.moveto(cgpoint(x: node.frame.origin.x, y:node.frame.origin.y), duration: 0.0) allow movenodeforever = skaction.repeatactionforever(skaction.sequence([movenode, resetposition])) homecoming movenodeforever }

xcode swift background repeat

No comments:

Post a Comment