Basic concept of how far a single class should be [closed]

Asked 2 years ago, Updated 2 years ago, 85 views

Do you want to improve this question?Update your question, Edit this post to be answered with facts and quotes.

Closed 5 years ago.

5 years ago

I am an amateur in making game apps. Do you want to combine multiple types of enemies into a class called enemy and generate each enemy as an instance?
Or do you create classes like enemy1 and enemy2 for each type and instance for each individual?
Do you make similar enemies by putting them together?
What are professionals doing?

For example, Mario's enemies, Cribo, Nokonoko, and Patapata, are
Will Cribo, Nokonoko, and Flatter be generated in enemy class?
Do you want to create a Cribo class, Scorpion class, or Patter class?
Will the Cribo Class and Turtle Class be generated?

After all, is it appropriate to adapt to readability and ease of creation?

game-development

2022-09-30 19:27

1 Answers

Since it is programmed with an object orientation, isn't it best to create a class called enemy character, define a common implementation such as hit determination, and code the character's unique behavior differentially in subclasses of character types?
In this example,

Ann defining the class parents and my < p >, Systems May 1, Academy 2 and defines a subclass, Systems, feeling such as to generate an instance of my two ...? < / >


2022-09-30 19:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.