During the summer I was working with several classes of year 3/4 children who were creating their own animated stories using 2CaSS. One of the pupils had an idea for a story that involved a character going for a ride on a roller coaster. He had drawn out his roller coaster (with a loop), and was wanting to see how to make his character travel along the rails.
I pointed out to him the "path follow" feature that allows an element to follow a pre-drawn route across the screen, and he set about using this. However he encountered problems whenever he tried to add his character to the roller coaster car he had drawn, and no matter what he did there were times during the loop when the character "fell out" of the coaster car.
I've tried to recreate his idea at home, and I too have the same issue; my character "falls out" out of the car as it loops the loop.
However, after thinking about this and looking long and hard at just how the path follow works, I have found a solution that will work in the future if the following steps are taken.
1) Create the page background - ground / sky / trees / etc
2) Draw the 'rails' of the roller coaster using the straight line tool
3) If you have chosen the "simple" or "auto' template select the blank square object (see the right circle in the second image below) and drag onto the page. Now, this next part is important. Start to create your roller coaster car, but make sure that the wheels for the car do not go below the half way point of the square (I'll explain why in a moment).
4) Once you've created the car, add the character to the car as well. The character has to be drawn in the same object as the car to avoid the "falling out" issue mentioned above. Before closing the design / editing window, drag the "path follow" option onto your design, so that it appears in all 10 of the frame animation options at the bottom of the screen.
5) Place the car onto the roller coaster rails, and resize as needed.
6) Now select the "path follow" tool from the left side of the screen (see the red circle in the image below) and click on the roller coaster rails at each point where the direction changes, finish by clicking on the furthest right point of the rails just before the car rails leave the page.
That's it!
So, why did the car have to be drawn no further than halfway down the object window? The "path follow" tool starts from the centre of an object. If you drew the car with the wheels right at the bottom of the object window, then when it starts to move it would drop down and the wheels would appear to be moving below the rails. By placing the wheels halfway down, the car can then appear to travel on the rails easily.
And for multiple instances of the car - I've just copied and pasted one car and changed the colours. To make sure that they don't all start at the same time, the second car has a blank first animation, whilst the third car has a blank first and second animation frame.
The roller coaster building simply hides the cars at the start to give the effect that they are setting off one after another, and in this example the cars stop before they all reach the end, because I have put more than 10 "path follow" options onto the screen.



Comments