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 will be colliding into. In this case we’ve called the type obstacle, but again, you can give your types any names you wish.

2,2—The first number defines the method, and the second number defines the response. The list of different methods and responses can be found in the previous section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.10.45