Skip to main content
1 of 3
omgnoseat
  • 1.2k
  • 1
  • 8
  • 16

Reusable skill class structure

Pretty new to the whole game development scene, but I have experience in other branches of programming. Anyway, I was wondering what methods are used to implement a skill structure. I imagine a skill in itself would a class. I'm using actionscript 3 for this project btw.

    public class Skill
{
    public var power:int;
    public var delay:int;
    public var cooldown:int;
    
    public function Attack(user:Mob, target:Mob) 
    {
        
    }
        
    }

}

Each skill would extend the Skill class and add it's own functionality.

    public class Tackle extends Skill
{
    
    public function Tackle(user:Mob, target:Mob) 
    {
        super(user, target);
        executeAttack();
    }
    
    private function executeAttack():void 
    {
        //multiply user.strength with power etc
        //play attack animation
    }
    
}

}

This where I get stuck. How do I termine which mobs has which skills? And which skill will they later be able to retrieve (by reaching a certain level etc). How does the player actually execute the skill and how is it determine if it hits. It's all very new to me so I have no idea where to begin. Any links would also be appreciated. Thanks in advance.

omgnoseat
  • 1.2k
  • 1
  • 8
  • 16