-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathSerpent.h
41 lines (35 loc) · 877 Bytes
/
Serpent.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
#pragma once
#include "Entity.h"
using namespace std;
#define SERPENT_LENGTH 30
class Serpent : public ControlledEntity
{
public:
Serpent();
void Spawn(Vec2 pos);
void SpawnSection(Vec2 pos);
void Update();
void NeedsToBeRemoved();
void Draw(const float interp);
bool CheckCollided(Sphere s, float damage);
int InWater();
Serpent* Clone()const;
bool bStartDirection;//serpents start outside the top or bottom of the screen
float fRotation;
int RateofFire;
float fLastFireTime;
vector<Serpent> mSections;
int iTickSection;//spawn when this is zero
int iCurSection;
Vec2 StartPos;
bool IsHead;
bool IsVisible;
int iTickToDeath;//so each segment explodes a little after the last
int iCurSegDeath;//next segment to kill
bool IsDead;
void LoadFromFile(CFileIO &fIO);
void WriteToFile(CFileIO &fIO);
float fStartRotation;
private:
int mWaterticks;
};