Energy Smart Avery
The purpose of the game is to turn off appliances, so we need to give Avery the ability to turn them off!
- We’re going to use the space key to turn off the laptop, but Avery can only turn off the laptop when she’s touching it.
- Add this code to the laptop sprite.
- Avery needs to be able to turn the laptop on and off as she pleases. You’ll notice the laptop sprite has two costumes “on” and “off”. We can just cycle between them using the “next costume” block.
- Test your code.
- To make the game more exciting, we want to measure the power usage so that we can use it to give the player a challenge later.
- To do this, we want to increase the power usage variable whenever the laptop is on.
- 0.012 is the number of Watt Hours an average (50 watt) laptop uses in a second.
- Add this code to the Laptop Sprite.
- Test your code.