• Ok. Well for the rest: as you explore, you track the distance along edges that it took you to get to each node. For example, if we take a path to get to a node along an edge with distance 4 and an edge with distance 3, the distance would be 7. This is necessary to find the shortest path. So imagine we have two paths to a node. Along one path, the distance is 7. But say we come back later and the distance is only 4! If this is the case, we change the node's distance to 4 and readjust the parents. In this way, when we trace a path back, that path is always the shortest, because we explore all possible paths and always pick the shortest one we find.

  • It might be useful to write a top-level except BaseException as exc handler that logs the exception, and then crash on purpose with os.abort(). That's probably more user-friendly than showing the debug console with a traceback, or silently logging the exception and pretending that nothing happened.

  • https://atom.io is a wonderful editor that I highly recommend. If you add the package linter-flake8, Atom will catch indentation issues and a multitude of other errors in your Python code in realtime as you type! I find that it consistently saves me several run-and-crash cycles on Mac, Windoze, and Linux. See the video at https://atom.io/packages/linter-flake8

  • @omz (or anyone else reading this)

    I finally got an implementation of the modal_scene working (took me long enough), it brings up the modal scene and everything. But it still gives me the same initial error at the moment that the modal scene is called. Is there anything I can do about that?

    Thank you for the scene-change code by the way, it works like a charm. Although I was curious why this works:

    self.menu = Scene2() self.present_modal_scene(self.menu)

    But not this:


    I guess I'm misunderstanding the use of self.menu, I assumed it was basically a pointer, a stand-in for the other phrasing of the code (Scene2()).

  • @omz

    Huh okay! Very small detail that I would have missed but makes sense now. Thanks :)

  • @omz

    You have been more than generous with your time and knowledge and this brief conversation has seriously helped me more than the countless hours of reading and searching that I've been doing so far. After the stuff you just clarified and explained, I've already been able to display the grid in a scene and hook it up to a touch event to re-generate the grid. I could ask more questions but I think they should wait awhile while I poke around more :).


Internal error.

Oops! Looks like something went wrong!