aboutsummaryrefslogtreecommitdiff
path: root/game/missile/MissileScript.h
blob: a492e1894f9a4e89761984cf1b35bb619f9aecdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include <crepe/api/Script.h>

class MissileScript : public crepe::Script {
private:
	bool on_collision(const crepe::CollisionEvent & ev);

	bool seeking_disabled;

	// will be used to calculate when ai will be stopped
	static constexpr int X_RANGE = 90;
	bool is_in_x_range(const crepe::Transform & missile, const crepe::Transform & player);
	void kill_missile();
	void activate();

public:
	void init();
	void fixed_update(crepe::duration_t dt);
};