From b9d4b60486e224261990c0732852513e86dd94ff Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 2 Oct 2015 23:48:34 +0800 Subject: Add BLR3 files. Modify Readme. Currently BLR3 is VERY primitive!! --- src/core/bullet.hpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/core/bullet.hpp (limited to 'src/core/bullet.hpp') diff --git a/src/core/bullet.hpp b/src/core/bullet.hpp new file mode 100644 index 0000000..5f4fe2f --- /dev/null +++ b/src/core/bullet.hpp @@ -0,0 +1,49 @@ +#ifndef BULLET_H +#define BULLET_H +#include "smmath.hpp" +#include "smentity.hpp" +#include "coreshared.hpp" +class bulletBase +{ +public: + smvec2d pos,vel,acc; + float velim; + //velim: velocity scalar limit. + float collrange,scollrange,renderscale; + //collision range and semi-collision range. Replacing "collable" and "scollable". + bool extborder,invincible; + //extborder: true=not removed if out of screen. + //invincible: true=not removed if collided with player or in range of CLR. + bool exist,addblend; + int attrd[8]; + float attrf[8]; + TColors basecolor; + virtual void init(...); + virtual void update(); + virtual void render(); + virtual ~bulletBase(); +}; +class bulletBonus:public bulletBase +{ + void update()override; +}; +class bulletManager +{ +private: + bulletBase* bullets[10240]; + int alloced,used; + smEntity2D* bulent2d[COLOR_COUNT]; + smEntity3D* bulent3d[COLOR_COUNT]; +public: + void init(); + void deinit(); + templateint allocBullet(); + templateint createBullet(); + void updateBullet(); + void renderBullet(); + bulletBase* getHandle(int id); + smEntity2D* getBulEntity2D(TColors col); + smEntity3D* getBulEntity3D(TColors col); +}; +extern bulletManager *bmInstance; +#endif -- cgit v1.2.3