User Tools

Site Tools


en:guides:beginners:timeline_tracks

This is an old revision of the document!


Part 17 - Timeline Tracks

We could set up a spawner to create a load of monsters for us, but we'll use a timeline instead. A timeline can issue commands.

Our timeline will simply issue the same create object command over and over in a loop.

Before we do this, remove the single monster from the Scene. We don't need it any more:

[Scene]
ChildList = PlatformObject # MiddlePlatformObject #
TopLeftPlatformObject # TopPlatformObject #
TopRightPlatformObject #
StarObject

Now to create a simple track:

[MonsterMakerTrack]
1    = Object.Create MonsterObject
Loop = True

This will create monsters over and over evey second. But if we run it now, all monsters will drop from the same position. The monster needs to start at a random position. Change the monster object to have a range of starting x positions:

[MonsterObject]
Graphic      = MonsterGraphic1
AnimationSet = MonsterAnimationSet
Position     = (20, 0, 0) ~ (600, 0, 0)
Scale        = 2.0
Body         = MonsterBody

Finally, to actually use the track which will create monsters, add it to the TrackList property in the Scene section:

[Scene]
ChildList = PlatformObject # MiddlePlatformObject #
TopLeftPlatformObject # TopPlatformObject #
TopRightPlatformObject #
StarObject
TrackList = MonsterMakerTrack

Looking great! Monsters should be dropping in all over the place:

Some tweaks can be added to the monster and the body to improve things a little:

[MonsterObject]
Graphic      = MonsterGraphic1
AnimationSet = MonsterAnimationSet
Position     = (20, 0, 0) ~ (600, 0, 0)
Speed        = (-20, 0, 0) ~ (20, 0, 0)
Scale        = 2.0
Body         = MonsterBody
 
[MonsterBody]
Dynamic            = true
PartList           = MonsterBodyPart
AllowGroundSliding = false
AngularDamping     = 5

This will give the monsters a little left/right movement (speed) and stop them from slipping along the floor (AllowGroundSliding ). Also stops them from flipping over so much (AngularDamping).

That should work a little better.

Next: Making the monsters explode.

en/guides/beginners/timeline_tracks.1445652835.txt.gz · Last modified: 2017/05/30 00:50 (7 years ago) (external edit)