Project 536: Skyjumper

9. Activate the function

If you were to test this game out now, nothing would happen. Right now, it's like a piece of code in Scratch without a "when green flag clicked" or "when I receive message 1" yellow block. Code always needs an event to activate it, so create an event listener to activate the "open" function.
Starting point file for this challenge

Steps

1. Create a powerup Touched event

At the end of your code, after your function, create an event that will activate when your powerup is touched. 

This is kind of like an imaginary Scratch block called "when powerup is touched." 

powerup.Touched

2. When the powerup is touched, run your "upgrade" function

Connect your "upgrade" function when the door is touched. This is like making an imaginary Scratch code that says something like "When powerup is touched, upgrade player." 

powerup.Touched:Connect(upgrade)

3. Test this out

Test your new code out! What happens when you run over a powerup? Are you able to jump up to the higher platforms?