KoloidStudios / salty-green

Salty Green
2 stars 0 forks source link

Game Class Design #13

Open DK0280705 opened 1 year ago

DK0280705 commented 1 year ago

To create definite objects of the game, we need to make a class design. We also need a complete control flow of the game. This can be further discussed through the comment.

DK0280705 commented 1 year ago

This will be the basic implementation of Ship object design

classDiagram
    Vessel <|-- Player
    Vessel <|-- Enemy
    class Vessel {
        -Collision2D _collision
        -Engine _engine
        -int _direction
        +virtual void fish()
        +bool is_moving()
        +enum get_gear()
        +void set_gear(enum gear)
        +float get_engine()
        +void set_engine(int direction)
        +float get_drag_force()
    }
    class Player {
        -uint32_t _fish_count
        +void fish()
    }
    class Enemy {
        -uint32_t _fish_count
        +void fish()
    }
DK0280705 commented 1 year ago

Vessel_engine object design.

classDiagram
    note for Vessel_engine "Engine power is in Kilowatt\nEngine thrust is in Newton"
    class Vessel_engine {
        -float _engine_power
        -float _engine_thrust
        -float _thrust_ratio
        +float get_power()
        +float get_thrust(enum gear)
    }