A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Comm.Dan

  • one year ago

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

  • This Question is Closed
  1. Comm.Dan
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    The code is in this picture that I have attached.

  2. e.mccormick
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  3. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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)

  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.