When is it worth "splitting" similar objects into different classes?

Hello all,
I’m about to start on a side-scrolling game which will involve around 10 different characters the play could choose from and probably about 20 different enemies. Each of these will have slightly different graphics, movement speeds, attack rates, etc. but I’m wondering how to manage it.

The way I see it there’s two options:
[LIST=1]
[]Have a general classes “Player” and “Enemy” with a setter method for the exact character which could set a bunch of class variables like speed, max health, etc… Most of the code would be the same but I’d need a lot of “if” statements in some places (ranged attack vs. sword, etc.).
[
]Have a whole bunch of classes “Goblin”, “Scarecrow”, “Skeleton”, etc. that inherit from “Player” or “Enemy”. All the stats could be hard coded in individual classes, no need to perform multiple checks on which character it is, but there will inevitably be some code repetition.
[/LIST]

I’m bearing in mind that I’ll have to reference these regularly. For example, each “Player” will probably have a “target” class variable to track who it’s moving towards/attacking. If I strongly type this as “Enemy” and then set it to an instance of “Goblin”, for example, will it be cast to “Enemy”? Is that a bad thing performance wise?
What about using Vector.<Enemy> for tracking objects on screen? I’m guessing I’ll have the same casting issue if the actual objects I push there are instances of Player’s sub-classes.
Will it negatively impact performance to have ~30 extra classes if I go with option 2?

Any advice would be much appreciated :slight_smile: