Space is filled with more dangers than just rocks. In this section, you'll create an enemy spaceship that will periodically appear and shoot at the player.
Enemies
Following a path
When the enemy appears, it should follow a path across the screen. To keep it from looking too repetitive, you can create multiple paths and randomly choose one when the enemy starts.
Create a new scene and add a Node. Name it EnemyPaths and save the scene. To draw the path, add a Path2D node. As you saw earlier, this node allows you to draw a series of connected points. When you add the node, a new menu bar appears:
These buttons let you draw and modify the path's points. Click the one with the + symbol to add points. Click to start...