Are You Trailing?
Its time to start our trail. what are you waiting for? In this video we will revisit the graphics object and figure out how to use it for this need.
Video Transcript
00:00Alright, so so far so good. Let's let's I don't know what's the next thing we're doing
00:04So let's firstly so this is working fine now what I want to do before we actually fix all these issues of moving in the
00:10Stage let's start working on actually adding all these dots and making things and making the motion clean or more accurately making a trail
00:17Where our element could actually we could see the trail that our element is going as I'm traveling
00:21We need to create that line that's going to be drawn as we're going along
00:26So we're going to need to create another little element
00:28we're not going to we're going to need to create another element and that element is going to have to be our trailing zone for
00:33our element or
00:35We could use our element our dot itself and add into a data
00:39So we have a lot of different directions a lot of ways we could do it
00:41So I'm going to choose one direction which is going to be I'm going to create another shape and this shape is going
00:46To keep my trailing information
00:51It's going to be a shape. Well, not a shader
00:55It's going to be a shape
00:58All right, so we're going to take create a trail now our trail is going to be always on the stage
01:03So as soon as I create a dot I'm going to add the trail as well
01:05So I'm going to do that basically the exact same thing for adding a dot as soon as I added the dot
01:10I'm going to have a trail only thing for the trail the trail is not going to be moving around
01:14Contrary to the dot which is moving around which will make it easier for me than later on to duplicate the data
01:19That's inside of the trail
01:21into our
01:22Background all right, so we have our trail now the next stage
01:27I want to do now that I have our trails
01:28I want to go back into our enter frame now first of all when I change the direction here
01:33I don't really know yet if I am in a safe place or not
01:36So I'm going to have to use for now another else here and this else we're going to act
01:40You have to start adding that trail as we know we first before we do anything else before we move before we change our
01:46Direction what we want to do is we first want to set our new
01:49Position of our trail to be in that point where we're starting to move
01:53All right, so we're going to do that in the change direction itself, so I can go into my trail
01:57And go into this graphics area, and I want to move the item
02:01I want to move the pointer where we're going to start drawing to the position of our element and the position of our element
02:07Is going to be our dot dot x dot dot y now. We know that we're in the right position
02:13We move that we don't have to move it again now if we're not in the safe area. We want to go
02:18We want to go into our trail itself
02:21And we want to start coloring with that trail now our trail currently doesn't have a color now
02:26We want to set a color and that color is going to be constant
02:28It's always going to be the same in this trail logic
02:31So if I go back into the top right out of the trail I could add into my trail just one more thing
02:36I could go to my trail
02:37Graphics, and I just want to set into the graphics a specific color and that color is going to be the line color or the
02:44line style and
02:47That line style is going to be that same style that we created for the active color
02:51So first of all we wanted the thickness of it
02:53It could be four or four and the line style is going to be that color so that color was active color
03:02Active color which is in our create done all right, so we now we know that we have a trail it has a color
03:07We don't have to worry about colors
03:08It's always going to have the same color because it's always that active trail now
03:12It's time for us to start drawing our lines, so I can go back into my trail
03:18Dot graphics, and I want to line two
03:22Where do I want to line two? I want to line two to the new position of my P. Deer all right
03:38Now this is happening as long as we're not in the saves on that. Let's check this out and see what happens
03:44So as soon as I start going out as soon as I start going out now
03:48We're first of all we have an issue because our line is starting from the top here
03:51This is not working out as well as we hoped it would right our dot is always in the same spot
03:57We're always drawing it into the exact same position all right
04:00So we definitely have an issue here
04:02It seems that our move to is not doing what it's supposed to do
04:07So we have to figure out another solution, so first of all before it
04:10Let's just trace out to see are we really moving our dot X?
04:14Let's see. Where are you where are we moving it when we change our direction all right, so that looks good
04:25That still looks good
04:27That still looks good, so it seems like we have your some sort of issue
04:30Maybe in our draw it may be in our line two area all right
04:34And then there we go our line two we use it by mistake the PD or XY instead of using the dot XY
04:40So that was our issue. Let's see if this makes things a little bit better and
04:46Here we go so now when we move around our dot is going to have here this nice little red line
04:51And this red line is going to continue on and on and on until we hit that point where it
04:56stops
