Time Lines

In many games certain things must happen at certain moments in time. You can try to achieve this by using alarm events but when things get too complicated this won't work any more. The time line resource is meant for this. In a time line you specify which actions must happen at certain moments in time. You can use all the actions that are also available for the different events. Once you create a time line you can assign it to an instance of an object. This instance will then execute the actions at the indicated moments of time. Let us explain this with an example. Assume you want to make a guard. This guard should move 20 time steps to the left, then 10 upwards, 20 to the right, 10 downwards and then stop. To achieve this you make a time line where you start with setting a motion to the left. At moment 20 you set a motion upward, at moment 30 a motion to the right, at moment 50 a motion downwards and at moment 60 you stop the motion. Now you can assign this time line to the guard and the guard will do exactly what you planned. You can also use a time line to control your game more globally. Create an invisible controller object, create a time line that at certain moments creates enemies, and assign it to the controller object. If you start to work with it you will find out it is a very powerful concept.

To create a time line, choose Create Time Line from the Resources menu. The following form will pop up.

It looks a bit like the object properties form. At the left you can set the name and there are buttons to add and modify moments in the time line. Next there is the list of moments. This list specifies the moments in time steps at which assigned action(s) will happen. Then there is the familiar list of actions for the selected moment and finally there is the total set of actions available.

To add a moment press the button Add. Indicate the moment of time (this is the number of steps since the time line was started). Now you can drag actions to the list as for object events. There are also buttons to delete the selected moment, to change the time for the selected moment, to duplicate a moment and to clear the time line.

Finally there are two special buttons. With the Merge button you can merge all moments in a time interval into one. With the Shift button you can shift all moments in a time interval forwards or backwards by a given amount of time. Make sure you do not create negative time moments. They will never be executed.

There are two actions related to time lines.

Set a time line
With this action you set the particular time line for an instance of an object. You indicate the time line and the starting position within the time line (0 is the beginning). You can also use this action to end a time line by choosing No Time Line as value.

Set the time line position
With this action you can change the position in the current time line (either absolute or relative). This can be used to skip certain parts of the time line or to repeat certain parts. For example, if you want to make a looping time line, at the last moment, add this action to set the position back to 0. You can also use it to wait for something to happen. Just add the test action and, if not true, set the time line position relative to -1.

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)