Detecting collisions


show more Detecting collisions provides you with in-depth training on Developer. Taught by Paul Trani as part of the Flash Professional CS5: Creating a Simple Game for Android Devices show less
please wait ...

Detecting collisions

Essential to almost any game is going to be collision detection, so determining when items hit each other or if they go off the screen--some sort of detection to see where items are at and then giving a result there. In this case, I need to determine when these UFOs hit the bottom, when they hit my player, and then also when my lasers hit the UFOs, otherwise known as tempEnemy. So those are the different sort of collision detections that I need to do.

All right, and what I am going to do is I am going to go ahead and just have some trace statements anytime some thing gets hit. You can see I already have some laser hits the top, so that's a sort of collision detection that's currently going on. So let's just go into my Actions panel, and as I scroll down, let's jump into my player, the movePlayer. We can see that. And in moveLaser, you can see this trace("laser hits top").

Well, I really don't need this. In fact, that's probably going to get in the way, s...

Detecting collisions
Video duration: 7m 57s 3h 35m Intermediate

Viewers:

Detecting collisions provides you with in-depth training on Developer. Taught by Paul Trani as part of the Flash Professional CS5: Creating a Simple Game for Android Devices

please wait ...