Creating the Enemy Scene & Variants
1. Scene Setup & Hierarchy
-Click the + tab at the top of the editor to create a New Scene.
-Click Other Node, search for Area2D, and select it as the root node.
-Rename the root Area2D node to enemy.
-Add a CollisionShape2D as a child of enemy.
-Add a Node2D as a child of enemy and rename it to enemy_type.
-With enemy_type selected, add four Sprite2D child nodes and name them:
green_enemy
yellow_enemy
blue_enemy
pink_enemy
2. Node Inspector Settings
enemy_type (Node2D):
Select enemy_type.
In the Inspector, expand Node2D ==> Transform.
Set Scale to x: 0.46, y: 0.46.
CollisionShape2D:
Select CollisionShape2D.
In the Inspector, set Shape to New CircleShape2D.
Set Radius to 22.09.
Sprite Textures: Select each sprite node under enemy_type and drag its matching asset from res://assets/enemies/ into the Texture slot:
green_enemy= res://assets/enemies/enemy4.png
yellow_enemy = res://assets/enemies/enemy3.png
blue_enemy = res://assets/enemies/enemy1.png
pink_enemy = res://assets/enemies/enemy2.png
3. Adding the Node Group
Select the root enemy (Area2D) node.
Click the Node tab next to the Inspector on the right, then select Groups.
Type enemy into the box and click Add.