There are a couple of ways that he can do this, and it looks like he's chosen to check the visibility property of one of the sprites in a conditional, then set the velocity of the shot accordingly (lines 56-60).
The main problem is in lines 61-63. Right now they are always run, so even though the if statement sets the velocity to -5 when the player is visible (and the space bar is pressed), lines 61-63 will always set it back to 5. Instead, lines 61-63 should only run when the condition in line 56 is not true. Your student can fix this either by using an
else in the conditional and putting those lines inside, or by creating a new conditional that checks whether the other sprite is visible.