Hey,
I am currently working on my first project here and I am about to get used to Studio.
The question that I have is how to inform the player about a mistake that they made. Specifically in my game the player should select exactly one card and then hit a button (one of some options).
If they select none or multiple card, I want to tell them to not do that. (I solved the issue by selecting exactly one card a time and unselecting the previous. But I am more curious about general solutions.)
The ways that I know is to put
alert("My message")
in javascript ("mygame.js"). Positive about this is that the server is not involved in the process. Negative is the ugly window and the fact that I find it very penetrative.
Also working is to call for PHP and
throw Exception("My message")
there. Or especially BgaUserException. But I am not familiar with other Exceptions that are implemented on BGA.
What would you do to inform players? Are there nice Exceptions or javascript-based ways, that I am not aware of?s
I am currently working on my first project here and I am about to get used to Studio.
The question that I have is how to inform the player about a mistake that they made. Specifically in my game the player should select exactly one card and then hit a button (one of some options).
If they select none or multiple card, I want to tell them to not do that. (I solved the issue by selecting exactly one card a time and unselecting the previous. But I am more curious about general solutions.)
The ways that I know is to put
alert("My message")
in javascript ("mygame.js"). Positive about this is that the server is not involved in the process. Negative is the ugly window and the fact that I find it very penetrative.
Also working is to call for PHP and
throw Exception("My message")
there. Or especially BgaUserException. But I am not familiar with other Exceptions that are implemented on BGA.
What would you do to inform players? Are there nice Exceptions or javascript-based ways, that I am not aware of?s