Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (comm.dan):

How to fix local functions that cannot reference themselves errors in Swift? The project is a SpriteKit game. I will post the code in a sub-post of this question

OpenStudy (comm.dan):

The code is in this picture that I have attached.

OpenStudy (e.mccormick):

That looks like it would cause an infinite loop. While I do not know the language, I would say the solution would be for it not to be a local function and for it to have some system of preventing infinite recursion.

OpenStudy (anonymous):

You may want to move your 5 makeBouncerAt() calls outside the definition of the function (outside the nearest { and }). Complete the definition of the makeBouncerAt function, ending with that } (the one after addChild(bouncer), then call it the 5 times. Also it doesn't look like that makeBouncerAt function has a meaningful definition, because I don't see anything using the "position" parameter. (Good luck! I'm staying with Objective-C for now)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!