Untitled

mail@pastecode.io avatar
unknown
c_cpp
18 days ago
757 B
1
Indexable
Never
#include "LightTank.h"
#include "MediumTank.h"
#include "HeavyTank.h"
#include "Position.h"
#include <iostream>

int main() {
    // Create a LightTank instance
    Position pos1(10, 20);
    LightTank light_tank(1, 120, 100, 20, "LightTank", 50, "Laser", 3.5f, pos1, 1.5f);
    light_tank.Move();
    light_tank.Attack();

    // Create a MediumTank instance
    Position pos2(15, 25);
    MediumTank medium_tank(2, 200, 180, 40, "MediumTank", 70, "Cannon", 2.5f, pos2, 20);
    medium_tank.Move();
    medium_tank.MediumAttack();

    // Create a HeavyTank instance
    Position pos3(5, 10);
    HeavyTank heavy_tank(3, 300, 280, 50, "HeavyTank", 100, "Missile", 1.5f, pos3, 30);
    heavy_tank.TakeDamage(100);

    return 0;
}
Leave a Comment