Lesson 22 - Design a Game (error in code)

csd-unit-3-lesson-22

#1

Does anyone see why this error is occurring?


#2

You don’t need parentheses around randomNumber. It should be:

enemy1.x = randomNumber(0, 400);
enemy1.y = randomNumber(-300, -10);

Also, are the two negative values for y valid? What happens when you hover over the red box?