using Godot;

/**
 * Script attached to the main node in the WeaponShot scene.
 *
 * A shot fired by a starship; the animation frames are those of the weapon model
 * (see the resources in the images/weapons folder).
 */
public partial class WeaponShot : GameItem
{
	private const string ANIM_SHOT = "shot";

	private const string FRAMES_PATH = "res://images/weapons/";

	public int id;

	public void Configure(string model)
	{
		// Load the animation frames of the weapon model
		sprite.SpriteFrames = ResourceLoader.Load<SpriteFrames>(FRAMES_PATH + model.ToLower() + ".tres");
		sprite.Play(ANIM_SHOT);
	}
}
