It would be nice if we could created classes inside classes. In the game im making, everything is done using classes. Each npc code is automatically inserted within a class like this:
class SomeNpc
{
float x;
float y;
float depth;
//Npc code is inserted here
}
But if i wanted to create a boss npc that has projectiles, the npc code would look something like this:
class Projectile
{
float x;
float y;
}
Projectile[] projectiles;
void OnCreate()
{
//add projectiles to array
}
void OnUpdate()
{
//loop through the projectiles array and check for collisions with
//players and move the projectiles
}
I cant do it because i cant define a class within another class