Lesson 22 - Design a Game (error in code)

Does anyone see why this error is occurring?

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?

1 Like