Video Thumbnail

Sign up for a plan to instantly unlock all premium lessons.

UNLOCK LESSON

Premium Features

Download Video

Progressively Harder Enemies

At the moment, I'd say our game is too easy. As a result, we'll be covering how to make our enemies harder in two ways:

  1. By spawning them more quickly over time

  2. By increasing their velocity over time

We'll also be adding functionality that allows an enemy to end the game if they touch our player directly. You'll learn a bit more about spawn timers and how to affect object properties based on special events.

  • 00:00 Spawn enemies more quickly over time

  • 06:42 Increase grid velocity on bounce

  • 08:31 Kill player on touch

Comments

Want to participate?

Create a free Chris Courses account to begin

Login
e
eggman231 posted 4 years ago

hey, so i keep getting this error

main.js:610 Uncaught TypeError: Cannot read properties of undefined (reading 'x') and it seems to highlight this line as the culprit

Math.hypot(

invader.position.x - bomb.position.x,

ive tried everything to work it out and i even put in the source code from git hub but still receiving the same error is there anything i can do?

0
chris posted 4 years ago

You'll want to double check that you're selecting each invader and bomb individually. I'd console log out both invader and bomb, if one is undefined you know that you need to find where you're trying to select them and update that code. If that's not the issue, you'll want to double check your classes and make sure the position property is available on both. I'd start there and see if that fixes things 🧐

0
e
eggman231 posted 4 years ago

awesome thanks dude!

1
e
eggman231 posted 4 years ago

that worked thanks so much for getting back to me

1
N
Nick posted 4 years ago

Looking forward for the next parts ! Thanks !

1
e
eggman231 posted 4 years ago

awesome course thanks i learned alot from this !! out of curiosity is there more to come - like the UI and sprite animation and sound etc

thanks again

0
chris posted 4 years ago

There def will be, catching up on premium courses this month, so expect more to come after I finish updating the Games 101 course this and next week 🙌

0
e
eggman231 posted 4 years ago

awesome thanks ill keep and eye out for that!

1

Providing the lift to launch your development career

© 2026 Chris Courses. All rights reserved.