I want to fill a glass or an object with water. How do I check if the water in the glass reaches a certain level?
Use an instance variable to keep track of the water level as a value.
Compare instance variable.
Use an instance variable to keep track of the water level as a value. Compare instance variable.
How can I do this after the water hits the glass? Do you have an example of that?
Develop games in your browser. Powerful, performant & highly capable.
I do not have an example, nor do I have any idea how you're handling the water. Whatever condition/action you are using to add water, you can add to an instance variable at the same time.