-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Lock system with text indicator #36
Conversation
Updating to ywmaa's latest
…ple usage of a pause key (letter 'p')
…ow the game shows a label message if the player is locked.
1-
currently for this system, this is the right way! 2- maybe add another signal :signal Lock_Removed(lockName:String) 3- Using PausedAttribute.gdin the first place I made GameAttribute for stuff like health and stamina, your use of it is quite interesting, but also having it as a GameAttribute is quite inpsiring for Template users to use GameAttribute Creatively. |
Thanks :) That's great to know :) I considered adding a function, but didn't want to go too far out of scope for a first commit! :) 2Thank you, I've added the signal for removing locks in, that was an oversight on my part. :) 3At work, we just use NavigationManager.IsLocked and InteractionManager.IsLocked, so I feel it could be simplified without any real headaches. :) It could be nice to have some lock states as player attributes (e.g. to track player abilities, status effects), however it is very likely overkill, not to mention, a true pause would be a more global game-level variable. I'll demote the UI to read is_locked, as that's plenty for just manipulating player navigation. |
…the lock system - now uses the wonderful Signal system! :) Also repathed the project.godot icon to prevent an error, and added a few debug functions to LockSystem
3 - Using PausedAttribute.gdOne better, I'm using signals, as they are wonderful and much easier than making a node just to enable the label object! :) |
Looks good, thanks for the very nice system. |
To add feature/issue #33 (locks) I've implemented a system we use at my workplace.
Presently it's a simple implementation, and I've tried to keep things very minimal.
It's possible to extend this by adding multiple lock components for various things (physics update, camera controls etc), but I'd like to make sure this works as designed, and follows the principles of existing code before overdoing it.
It uses the GameAttribute system to display a brief message explaining that the user needs to press p to restore movement.
To stop the player running for eternity, I reset their movement in PlayerController.gd. This might not be best practice, and thought it was worth drawing attention to in case it's a terrible way to solve the problem! :)
In terms of use cases, locks can be applied to practically any element of a game or character system