Classes and subclases

Hi,
Im working on a smal game and I have different enemies. They all have the same amount of animation frames and therfore I thought that there was a possibility to use an Animation class and let all the monsters extend it, so that I only have to write the code once.
I mean something like this:

class A{
A(){

}

void loadFrames(){

}
void updateAnimation(){

}
}

class EnimyA{
//In here give file names and frame count ezt to do the stuff from A
}
class EnimyB{
//In here give file names and frame count ezt to do the stuff from A
}

Check here extends / Reference / Processing.org

1 Like

Thank you, That helped :smiley:

1 Like