I have an instance variable, which represents the health of a type of an in-game enemy. Can I represent that instance variable as a global variable, which changes depending on certain conditions?
Develop games in your browser. Powerful, performant & highly capable.
You can set instance variable to global variable (or vice-versa) on every tick, or on specific event. If you have multiple enemy instances, you need to pick the right instance first.
Thank you. It seems like a useful idea.