aboutsummaryrefslogtreecommitdiff
path: root/game/prefab/ZapperPoolSubScene.cpp
blob: a52aa751d53c4bc2d18252f117f731646ad00b61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <crepe/api/BehaviorScript.h>

#include "ZapperPoolScript.h"
#include "ZapperPoolSubScene.h"

using namespace crepe;
using namespace std;

ZapperPoolSubScene::ZapperPoolSubScene(Scene & scene)
	: controller {scene.new_object("controller")} {

	vector<ZapperObject> pool;
	for (size_t i = 0; i < this->POOL_SIZE; i++)
		pool.emplace_back(scene.new_object("zapper", "zapper"));
	BehaviorScript & behavior = this->controller.add_component<BehaviorScript>();
	behavior.set_script<ZapperPoolScript>(std::move(pool));
}