make factories

This commit is contained in:
2024-08-27 15:42:23 +02:00
parent 3c6a3dba44
commit 2353cbb2be
6 changed files with 60 additions and 13 deletions

View File

@@ -0,0 +1,17 @@
#include <blitz/factory/ProjectileFactory.h>
#include <godot_cpp/classes/packed_scene.hpp>
#include <godot_cpp/classes/resource_loader.hpp>
namespace blitz {
namespace ProjectileFactory {
using namespace godot;
Bullet* CreatePen() {
Ref<PackedScene> bulletScene = ResourceLoader::get_singleton()->load("res://Scenes/Weapons/pen.tscn");
return Object::cast_to<Bullet>(bulletScene->instantiate());
}
} // namespace ProjectileFactory
} // namespace blitz