O'Reilly logo

3D Game Programming for Teens, Second Edition by Eric Grebler, Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collision Code

Above you learned the parts of the collision code. Let’s look at the actual code you use to create a collision. We’ll use this code in the next section to create our collision:

Collisions type_player,type_obstacle,2,2

Let’s look at the individual parts of this code:

Collisions—This is the actual code that tells Blitz3D that we are about to define a collision.

type_player—This is the name of the source object that will be doing the colliding. In this case, we’ve called our type player, but you can give your types any names you wish. Keep in mind that the types have to be defined before this code is entered. In the next section you’ll be shown how to define the types.

,type_obstacle,—This is the name of the object that your source ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required