Now that we have created and tested the startAnimation and stopAnimation variables, we want to change their values with code, and not through the entity menu. To do this, we’ll make both variables private, then create a function to set startAnimation to true and stopAnimation to false.
- Use the keyword private to make the startAnimation and stopAnimation variables private.
- Below the tick function, create a new function called startOpeningLidAnimation
- Inside this function, set this.startAnimation to true and set this.stopAnimation to false.