isTouching Issues in Game

The following information is from one of my 7th grade students working on the Unit 3 Gaming Project in Game Lab.

**Game Lab - Code.org
What I expect to happen: The alien is to avoid the a1-a7, but if they touch the game is to restart.
What actually happens: The isTouching feature isn’t working.
What I’ve tried: looked back over the code, and reviewed the isTouching code, but to no luck.

@thelma.johnson,

It appears that they have a double conditional. The space key has to be pressed and the collision has to happen … both at the same time, for the isTouching to work.

If you move the 2nd conditional outside the first, that may help, but they have also created the a1 sprite inside the conditional, so that results in an error.

I would suggest creating all sprites before the draw loop. Then, keep them invisible and only make them visible when necessary (rather than creating them inside the draw loop).

Hopefully this gives them a starting point for debugging.

Mike