Creating containers

As the name implies, containers are objects that can contain other objects. This is useful for creating activities that rely on objects being recognised and either accepted or rejected by another object. Any object that does not match all the chosen properties is rejected, whenever someone attempts to put it into the container.

You can select container properties and therefore define the container's behaviour, in the 'Container' section of the Property Browser.

For details of available container properties, see Reference > Properties > Container properties.

For details of how to change properties, see Changing object properties.

Here we explain container rules, how to create a container and add a reward sound:

Container rules

Create a container

Here we show you how to turn a shape object into a container that can contain one specific object, but will reject any others.

  1. Select Shape and create three shapes, one larger than the others. In the picture, we have created a yellow square, the container and two triangles, one red, one blue.
    For this example, we changed the 'Name' property of the object to be contained to 'Red Triangle' in the 'Identification' section of the Property Browser.

  2. Select the largest shape, in our case the yellow square.

  1. Open the Property Browser and scroll down to the 'Container' section.

  2. In the 'Container' section, set the properties. In the picture, we set the following:

    1. Can Contain to Specific Object. This means only one particular object can be put in the yellow square container.

    2. Contain Object to Red Triangle. The yellow square can only contain the red triangle.

    3. Contain Rule to Completely Contained. The red triangle must be placed inside the container.

 

 

  1. Next, select the object to be contained. In our example we selected the red triangle.

    In the Container section of the Property Browser set Return if not Contained to True. If the red triangle is not completely contained, it will then automatically return to its starting position.

  2. Select the blue triangle and set Return if not Contained to True.

If you try to put the blue triangle into the container, it will automatically return to its starting position.

 This will happen even if the object is completely contained.

  1. Test the container. In the example, only the red triangle, but not the blue one, can be put in the container.

When an item has been contained, you can move it out of the container in one movement. Any further movements, when the object is not being contained will return it to the starting position.

 

Add a reward sound

A reward sound is a sound file that plays when an object is correctly contained.

Here we show you how to add a reward sound to a container:

  1. Create the container as shown above.

  2. In the 'Container' section of the Property Browser, set the sound properties:

    1. Set Reward Sound to True.

    2. Set Reward Sound Location to the location of the sound file you want to play when an object is correctly contained. In the picture, this is the file a.wav.

  1. Test the container. When the correct object is put into the container, the Sound Controller opens and plays the chosen reward sound.

    The Sound Controller remains on the screen until you close it.

 

Set the 'Reward Sound' property on the container, not the contents.