I am trying to code what I can as I have more control, but as I am getting more into things I am getting confused on referrencing and clock cycles.
Lets say I have a HEALTHBAR object and a PLAYER object (HEALTHBAR being a child of PLAYER, not that it should matter).
Okay the HEALTHBAR has it’s own “healthbar.py” script which animates based on percentage, linked to the ALWAYS sensor
The PLAYER has it’w own “player.py” script which does game logic, linked to an always sensor.
What is the ideal method here? If I want to update the HEATHBAR object, should I call it from player.py (if I can even reference those objects and variables)
Should I create a class called “player” that has logic and healthbar in it?
I sit here asking myself "okay cycle comes through and says “Key X is pressed, do that logic” then I will get SPACEKEY is released(for the healthbar.py logic) that logic to is attached to a “always” sensor. Two ALWAYS sensors are going to eventually “bump” into each other giving not accurate results,
Well what about a game w/ multiple scripts and multiple objects? Is this all done via one script that calls other scripts/logic? Is everyone copying datasets from passive object to active object? Please help, what’s the recommended action to address this as best practice?
Thanks for any attempt to try and explain the best answer / best practice.