So I have this basic prototype where I have an enemy and a bullet that gets constantly spawned.
This is my first Godot project where I actually try and I'm currently learning classes and components:
My player now takes a HitboxComponent, an AttackComponent and a HealthComponent and the logic is handled by the main Player script.
Now, I'm trying to set up a MovementComponent to assign to the bullet and the player. And I have a lot of questions:
First, since the bullet is, well, a bullet; It is an Area2D, while the player is a CharacterBody2D.
This implies that the player has a velocity which doesn't need delta while the bullet does not. So if I try to set up functions for movement inside the MovementComponent, the functions would take delta for the bullet but not for the character2D.
Should I change the bullet to be CharacterBody2D? That would make it collide with the player, right? Would that also affect performance faster as I spawn more bullets?
If I keep them as Area2D, should I make two functions for Area2D's and then for the characters? Should I make 2 different movement components?
Is there any GDScript example for A MovementComponent?