peterbrittain / asciimatics

A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Apache License 2.0
3.62k stars 237 forks source link

running a ray-tracing maze after an animation #297

Closed ajhcodes closed 3 years ago

ajhcodes commented 3 years ago

I am trying to run a ray-tracing maze (the same code as your demo, but with a different maze) after an animation. All that it does is play the maze at the start. How could this be fixed?

peterbrittain commented 3 years ago

Hard to say without any code... My guess is that you haven't created the right Scene sequence. You would want to have 2 Scenes - one for the animation (which stops after a fixed time or moves on when you press a certain key) and then the other to run the ray casting game.

ajhcodes commented 3 years ago

Thankyou! I have fixed it, so it works now. One last question though- how would I get the maze to close and go to the next scene when you get to the end of the maze?

peterbrittain commented 3 years ago

You'd need to put some logic into the program somewhere to detect that you have got to the end of the maze (e.g. in the Gamecontroller) and raise a suitable Exception (https://asciimatics.readthedocs.io/en/stable/widgets.html#exceptions)

peterbrittain commented 3 years ago

I'm assum8ng that answered the question....

ajhcodes commented 3 years ago

yes, it did thankyou :) sorry for not answering, i have been busy.

peterbrittain commented 3 years ago

No problem.