Hello,
I am programming an app and I’ve got a problem with a function that is supposed to push a Node from the edge of the right screen to the middle. The code is like this:
Hi,
at first thank you for the answer. I want to push a Node that I called “blue” to the mid (x: frame.midX, frame.midY) from a starting position that is on the right site of the screen (x: frame.maxX, y: frame.midY) Now I’ve typed in what you told me: “That is returning a type. The func declaration says it should return an instance of SKAction. Maybe you meant to return MoveBlueToMid?” And this error message was gone. Thank you for that!! Now there is a second error in the line that says:
let repeating = SKAction.repeatForever(moveBlue())
The error message in this line says:
“Editor placeholder in source file”
Below (moveBlue()) is a read line, so moveBlue() is the problem.
I want that the Node “blue” is getting pushed in the middle of the screen (x: frame.midX, y: frame.midY) by the function moveBlue and that this is repeating all the time. I know that I have to make a function that pushes the node back to the start point wich is x: frame.maxX, y: frame.midY. How would you code it and what can I do against this error message? I’m pretty sure that it is such a simple error .
Thank you already for your answer it already helped me.
Have a great day!