#ifndef PROJECTILE_H
#define PROJECTILE_H

#include <cpctelera.h>
#include "Actor.h"
#include "Map.h"
#include "Object.h"

// Small moving object fired from the player's weapon.
typedef struct Projectile Projectile;

struct Projectile
{
    // Actor variables.
    Object object;
    u8 health;

    // Projectile variables.
    u8 backgroundSprite[8];
    u8 redraw;
};

// Initialises values when constructing a projectile.
void initProjectile(Projectile* projectile, u8 x, u8 y, u8 direction);

// Draws the projectile.
void drawProjectile(Projectile* projectile);

// Run the logic for the projectile.
void logicProjectile(Projectile* projectile);

// Destroys the projectile and cleans up the screen by drawing the projectile background.
void destroyProjectile(Projectile* projectile);

// Copy the background that the projectile is currently occupying into the background sprite for later redraw.
void copyBackground(Projectile* projectile);

#endif