In this video, we'll create the base pickup scene.
We'll then inherit it to create the ghost pickup and the speed pickup.
We're creating an inherited scene
because we're going to have some animations running
that we want to reuse across all pickups.
Similarly, we'll extend a base script for the code
so that we can share functionality.
For now, we're going to set up the scene and create the animations.
We're not going to make the particles just yet.
We'll do that around the end of the series.
With that said, let's get started.
Let's get started by creating the pickup scene.
We'll be working in the ObstacleCourse and this called Part2 folder
that you'll find in the Godot Practices project.
This is just so that we all start on the same page.
Expand the folder.
We're going to right click on it and create a new folder
where we'll store our pickups.
Let's call it pickups.
In that folder, the pickups folder, we right click,
and we're going to create a new scene for the pickup.
Which we'll name this way.
This is going to be the same pattern as before.
This is a collectible,
so we need an area to detect when the character touches the pickup.
We start with an Area2D node.
An Area2D needs a collision shape.
Next, we add a CollisionShape2D node.
In the Inspector, we're going to set the shape to a new CircleShape2D.
Then we're going to drag our sprites in there.
We have an assets subfolder in the ObstacleCourse_Part2 folder.
Expand it, and we're going to look for the pickup gem and the shadow circle.
Drag and drop them onto the view like so.
We want to make sure
that the shadow circle is behind the pickup gem.
We move it up in the Inspector.
Then we're going to take the gem
and we're going to move it up a little bit above the circle.
I'm also going to center it on the vertical axis
so that it's placed symmetrically along that axis.
Finally, we are going to lower the scale of that shadow circle a bit.
To scale the shadow circle, click it to select it in the view.
And then you're going to press Alt, click and drag.
If you want the scale to be uniform, you're going to have the Shift key
pressed as well as you do this.
Same thing, I'm going to nudge it with the arrow keys
to align it onto the vertical axis.
The next thing we want to do is to make that semitransparent.
Do you remember how we do that?
With the shadow circle selected, we go to the Inspector,
the Visibility category, Modulate.
And we're going to lower the Alpha channel a bit.
This will look better when overlaid on top of the final level.
The last thing we have to do is resize the collision shape
because it doesn't match the pickup.
Now, if you try to click to select it in the view,
because the sprite is in front of it, you're not going to be able to do that.
Well, here's the trick.
You can press the Alt key down, and right click
to bring a drop down menu letting you select a node
that is stacked in the view.
You can Alt, right click over the sprite and the collision shape.
And then you can select the collision shape from the menu.
This is a very handy feature.
When you've done that to move the shape,
you're going to press the W key to bring the move tool.
Then Shift, click and drag.
Actually, we're going to put it in front of the sprites in the scene dock.
Because otherwise, it's a bit difficult to see.
We're going to click and drag on the resize handle
with the select tool active in the toolbar
to make the pickup about as big as the sprite.
The last node we'll add is the animation player here.
Select the Area2D, press CTRL+A, and add an animation player node.
We'll just create the animation by going to the Animation menu,
we click and select New, and we'll call this one idle.
This will be the gem moving up and down.
With that, we can get started animating the gem.