-
Notifications
You must be signed in to change notification settings - Fork 7
Quick Start Guide
ural89 edited this page Nov 8, 2025
·
1 revision
Clone the repository and enter the engine folder:
git clone https://github.com/ural89/ConsoleCraftEngine
cd ConsoleCraftEngineRun the project creation script:
./create_new_project.shWhen prompted, enter your project name. Project names must not contain spaces.
Build and run your project:
cd YourProject/build`
`./build.shYou will see an example scene with an example game object. Use W A S D keys to move the object around.
Let’s add a ParticleSource component to the example game object.
Add a ParticleSource pointer in the private section:
class ExampleGameObject : public GameObject {
public:
void Init() override;
void OnInput(int input);
void Update(float deltaTime) override;
private:
class ParticleSource *particleSource;
};Include the particle source header after #include "Input.h":
#include "ExampleGameObject.h"
#include "Input.h"
#include "Core/ParticleSystem/ParticleSource.h"Create and add ParticleSource component to example gameobject
void ExampleGameObject::Init() {
symbol = '8';
sprite = {
{1, 1},
{1, 1},
};
auto inputEvent = BIND_EVENT_FN(ExampleGameObject::OnInput);
Input::AddListener(inputEvent);
//add particle source here
particleSource = AddComponent<ParticleSource>();
}
Then update the OnInput method to emit particles when pressing Space:
void ExampleGameObject::OnInput(int input) {
if (input == SPACEBAR) {
int particleCount = 4;
particleSource->EmitParticle(particleCount,
FIRETYPEPARTICLE);
}
// existing input handling...
if (std::tolower(input) == 'd') transform.MovePosition(1, 0);
if (std::tolower(input) == 'a') transform.MovePosition(-1, 0);
if (std::tolower(input) == 'w') transform.MovePosition(0, -1);
if (std::tolower(input) == 's') transform.MovePosition(0, 1);
}Go back to the build folder and run your project again:
cd YourProject/build
./build.shNow, when you press Spacebar, particles will spawn around your game object!