1 Star 0 Fork 0

pendulum445/AircraftWar-Cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
prop.h 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
pendulum445 提交于 2024-05-21 15:33 . [feture]新增火力道具
//
// Created by liaoyunjie on 24-5-20.
//
#ifndef PROP_H
#define PROP_H
#include "BaseFlyingObject.h"
#include "ImageManager.h"
class BaseProp : public BaseFlyingObject {
public:
BaseProp(FlyingObjectType type, int location_x, int location_y, int width,
int height)
: BaseFlyingObject(type, location_x, location_y, 0, PROP_SPEEDY, width,
height) {}
virtual void effect() = 0;
void forward() override;
int factor() const override { return 1; }
};
class BloodProp : public BaseProp {
public:
BloodProp(int location_x, int location_y)
: BaseProp(BLOOD_PROP, location_x, location_y,
ImageManager::BLOOD_PROP_IMAGE.width(),
ImageManager::BLOOD_PROP_IMAGE.height()) {}
void effect() override;
};
class BombProp : public BaseProp {
public:
BombProp(int location_x, int location_y)
: BaseProp(BOMB_PROP, location_x, location_y,
ImageManager::BOMB_PROP_IMAGE.width(),
ImageManager::BOMB_PROP_IMAGE.height()) {}
void effect() override;
};
class BulletProp : public BaseProp {
public:
BulletProp(int location_x, int location_y)
: BaseProp(BULLET_PROP, location_x, location_y,
ImageManager::BULLET_PROP_IMAGE.width(),
ImageManager::BULLET_PROP_IMAGE.height()) {}
void effect() override;
private:
static void recover();
};
#endif // PROP_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yunjie445/aircraft-war-cpp.git
git@gitee.com:yunjie445/aircraft-war-cpp.git
yunjie445
aircraft-war-cpp
AircraftWar-Cpp
main

搜索帮助