Im new to using asciimatics, and im playing around with it to make a game. However, when i add a cross_hairs to a scene, it wont move to the next scene. How can i move to the next scene when i have cross_hairs?
Asked
Active
Viewed 75 times
0
-
Hard to say when there is no "cross hairs" code in asciimatics... You may want to share a simple app that shows the problem. – Peter Brittain Mar 16 '21 at 12:33
-
Check out the advice here for adding code... https://stackoverflow.com/help/minimal-reproducible-example – Peter Brittain Mar 16 '21 at 12:36
-
the code is based off of your sample code- interactive – ajcodes Mar 16 '21 at 23:11
1 Answers
0
Assuming you are using something very similar to this sample, asciimatics is playing a Scene with 2 or more Sprites.
If so, this sample already allows you to move to the next Scene by pressing space. Job done! :-)
In a little more detail... It relies on the default global key handler to do this. As covered here, it just raises the NextScene exception to tell asciimatics to move on.
If you want to move to a new Scene based off a different event (e.g. the cross hairs hitting another Sprite), you should just raise that Exception at the time you detect the condition.

Peter Brittain
- 13,489
- 3
- 41
- 57