This pull request introduces several new features and improvements, primarily focusing on the addition of a game object management system and tank models. The most important changes include adding the ObjectController and BaseObject classes, implementing different tank models, and configuring pre-commit hooks.
Game Object Management System:
src/app/core/base_object.py: Introduced the BaseObject class, which inherits from pygame.Rect and includes abstract methods start, update, and end for managing game objects.
src/app/core/object_controller.py: Added the ObjectController class to manage the lifecycle of game objects, including methods start, update, and end.
src/app/core/__init__.py: Imported ObjectController and BaseObject to make them available for use in other modules.
src/app/main.py: Implemented the main game loop, initializing Pygame, managing game state, and drawing game objects, including a test draw for LightTank.
Pre-commit Configuration:
.pre-commit-config.yaml: Configured pre-commit hooks to use Black for code formatting with a line length of 88.
This pull request introduces several new features and improvements, primarily focusing on the addition of a game object management system and tank models. The most important changes include adding the
ObjectController
andBaseObject
classes, implementing different tank models, and configuring pre-commit hooks.Game Object Management System:
src/app/core/base_object.py
: Introduced theBaseObject
class, which inherits frompygame.Rect
and includes abstract methodsstart
,update
, andend
for managing game objects.src/app/core/object_controller.py
: Added theObjectController
class to manage the lifecycle of game objects, including methodsstart
,update
, andend
.src/app/core/__init__.py
: ImportedObjectController
andBaseObject
to make them available for use in other modules.Tank Models:
src/app/models/tank/BaseTank.py
: Created theBaseTank
class with methods for aiming, moving, and drawing tanks.src/app/models/tank/HeavyTank.py
: Added theHeavyTank
class, inheriting fromBaseTank
, with specific attributes and ashoot
method.src/app/models/tank/LightTank.py
: Added theLightTank
class, inheriting fromBaseTank
, with specific attributes and ashoot
method.src/app/models/tank/StandardTank.py
: Added theStandardTank
class, inheriting fromBaseTank
, with specific attributes and ashoot
method.src/app/models/tank/__init__.py
: Imported the tank classes for easy access.Main Game Loop:
src/app/main.py
: Implemented the main game loop, initializing Pygame, managing game state, and drawing game objects, including a test draw forLightTank
.Pre-commit Configuration:
.pre-commit-config.yaml
: Configured pre-commit hooks to use Black for code formatting with a line length of 88.