New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sprites #4
Comments
The game engine itself can't but you can add it yourself. You can add a new property to sprite objects called 'visible' which contains a boolean (True or False). The property does not have to be in every sprite, but if it is and 'visible' == False then do not render the sprite. To use this feature you just need to add 'visible' to any sprite you want to hide. For example, on the server in the ServerMap class, you could hide all players on the sprite layer like this (not tested so it may have some errors)
Make them visible again using one the lines of code below:
Now the data is in place so now you need to use it. On the client look for 'visible' and do not render the sprite, it's label, or it's speechText. You could modify several methods on the ClientMap to do this or just remove thees sprites before the map is rendered. An easy way is to extend the blitMap() method of the ClientMap class so that is looks for 'visible' in the sprites and removes them. Keep in mind the the client gets a new list of sprites each step so we don't need to worry about putting them back. Something like this should work (again untested):
It this does not work please post the error and we can work it out. |
Also, if this works for you please let me know and also close this issue. |
Thank you soooo much!!! We were in desperate straits, but your timely message made so much sense. Today, we tried it and it was flawless. Absolutely flawless. You have our deepest gratitude! : ) Working with Lancaster has really taught us the intricacies of programming with Python, and we're so glad something like this exists. Please tell Ms. Wear you think we're cool B) |
Is it possible to hide certain sprites in a layer using something like setLayerVisablitybyName with changes made to it, or is it not possible?
Ex.
Player 1, Player 2, and Player 3
With advancing dialog, each player's screen shows the same thing, but only player 1 is visible, and player 2,3 is off-screen, with no name tag.
With something like "show Player 2" player 1 and 2 is visible, and player 3 is not.
The text was updated successfully, but these errors were encountered: