-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathBullet.h
74 lines (71 loc) · 2.71 KB
/
Bullet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
#include "Vector.h"
#include "Geo2D.h"
#include "Geo2D_Draw.h"
#include "Entity.h"
class Bullet
{
public:
bool IsActive;
Vec2 oPos,Pos,Vel;
float frame;
float fLife;//how much damage it does
float rot;
float user1,user2;//just incase
void (*pSpawn)(Bullet& b, Vec2 pos, Vec2 vel);
void (*pUpdate)(Bullet& b);
void (*pRender)(Bullet& b, const float interp);
void (*pCollide)(Bullet& b);
Sphere sphere;
Entity* pTarget;//for bullets that can chase.
};
Vec2 FireAtTarget(Vec2 curPos, Vec2 tarPos, float speed);
bool FireAtDistantTarget(Vec2 curPos, Vec2 tarPos, float speed, Vec2 &out);
bool CollidedWithMap(Bullet b);
void PickTarget(Bullet& b);
//player bullets
void Render_PlayerBullet(Bullet& b, const float interp);
void Collide_PlayerBullet(Bullet& b);
void Spawn_ForceBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Update_ForceBullet(Bullet& b);
void Render_ForceBullet(Bullet& b, const float interp);
void Collide_ForceBullet(Bullet& b);
void Spawn_PlasmaBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Update_PlasmaBullet(Bullet& b);
void Render_PlasmaBullet(Bullet& b, const float interp);
void Collide_PlasmaBullet(Bullet& b);
void Update_ClusterBullet(Bullet& b);
void Render_ClusterBullet(Bullet& b, const float interp);
void Collide_ClusterBullet(Bullet& b);
void Spawn_LifeBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Update_LifeBullet(Bullet& b);
void Render_LifeBullet(Bullet& b, const float interp);
void Collide_LifeBullet(Bullet& b);
void Spawn_HomingMissile(Bullet& b, Vec2 pos, Vec2 vel);
void Update_HomingMissile(Bullet& b);
void Render_HomingMissile(Bullet& b, const float interp);
void Collide_HomingMissile(Bullet& b);
void Spawn_PulseBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Update_PulseBullet(Bullet& b);
void Render_PulseBullet(Bullet& b, const float interp);
void Collide_PulseBullet(Bullet& b);
//Enemy bullets
void Spawn_BasicBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Update_BasicBullet(Bullet& b);
void Render_BasicBullet(Bullet& b, const float interp);
void Collide_BasicBullet(Bullet& b);
void Spawn_GravityBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Update_GravityBullet(Bullet& b);
void Render_GravityBullet(Bullet& b, const float interp);
void Collide_GravityBullet(Bullet& b);
void Spawn_PowerBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Render_PowerBullet(Bullet& b, const float interp);
void Collide_PowerBullet(Bullet& b);
//midboss bullets
void Spawn_BlastBullet(Bullet& b, Vec2 pos, Vec2 vel);
void Render_BlastBullet(Bullet& b, const float interp);
//bigboss bullets
void Spawn_BossBullet(Bullet& b, Vec2 pos, Vec2 vel);//same properties as power bullet
void Update_BossBullet(Bullet& b);
void Render_BossBullet(Bullet& b, const float interp);
void Render_BossPowerBullet(Bullet& b, const float interp);