aboutsummaryrefslogtreecommitdiff
path: root/game/prefab/ZapperObject.h
blob: 9f4e4a13cbd2d5c77592d611da07ce0c28b7ed90 (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
32
33
34
35
36
37
38
#pragma once

#include <crepe/api/Animator.h>
#include <crepe/api/BoxCollider.h>
#include <crepe/api/GameObject.h>
#include <crepe/api/Rigidbody.h>
#include <crepe/api/Sprite.h>

class ZapperObject : public crepe::GameObject {
public:
	ZapperObject(crepe::GameObject &&);

public:
	struct {
		crepe::Sprite & orb_start;
		crepe::Sprite & orb_end;
		crepe::Sprite & glow_start;
		crepe::Sprite & glow_end;
		crepe::Sprite & beam;
	} sprite;

	struct {
		crepe::Animator & orb_start;
		crepe::Animator & orb_end;
		crepe::Animator & glow_start;
		crepe::Animator & glow_end;
	} animator;

	crepe::Rigidbody & body;
	crepe::BoxCollider & collider;

private:
	static constexpr float SCALE = 0.8;

public:
	void place(const crepe::vec2 & position, float rotation, float length);
	void set_active(bool active);
};