about summary refs log tree commit diff
path: root/src/game/server/entities/laser.hpp
blob: aa4c22843d7f226e607c47580677081ea74de9cf (plain)
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
/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */

#ifndef GAME_SERVER_ENTITY_LASER_H
#define GAME_SERVER_ENTITY_LASER_H

#include <game/server/entity.hpp>

class CHARACTER;

class LASER : public ENTITY
{
	vec2 from;
	vec2 dir;
	float energy;
	int bounces;
	int eval_tick;
	int owner;
	
	bool hit_character(vec2 from, vec2 to);
	void do_bounce();
	
public:
	
	LASER(vec2 pos, vec2 direction, float start_energy, int owner);
	
	virtual void reset();
	virtual void tick();
	virtual void snap(int snapping_client);
};

#endif