Time for action – examining the Players and Actors groups

The game file to import and load for this session is 5961_03_07.st encyl.

  1. Click on Players in the right-hand panel (under the GROUPS heading).
  2. Examine the buttons at the bottom of the main panel in the Collides With section; make a note of which group or groups are selected.
  3. Click on Actors in the right-hand panel (under the GROUPS heading).
  4. Examine the buttons at the bottom of the main panel in the Collides With section; make a note of which groups are selected.
  5. Click on the OK button to hide the Game Setting dialog box.

What just happened?

We examined the collision settings for the Players group and the Actors group, and we should have noted that any actor in the Players group can detect collisions with tiles only. We should also have noted that actors in the Actors group can detect collisions with both Tiles and other actors in the Actors group.

It's useful to know that actors do not have to detect collisions with other actors in the same group.

The ability to configure collisions between actors in different groups gives us an amazing amount of flexibility in our game, when we need to manage collisions between actors and tiles.

Let's put this new found knowledge into practice!

Note

The collision groups entitled Doodads and Regions have special features that we will not be using. However, it's useful to note that actors in the Doodads group will never cause collision events to occur, and that Regions is a special type of group that enables us to specify arbitrary areas of a scene that can cause collision events.

Creating a new collision group

We know from our previous game test, that the monkey completely ignored the enemy actors that it ran past. If we need to remind ourselves what happened, we can test the game again; the monkey is able to run straight through the enemy actors without a collision occurring!

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

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