Welcome to the Chronos Engine documentation! This section will guide you through the initial steps to set up and use the engine for your 2D game development projects.
Explore the powerful features that the Chronos Engine offers to simplify your 2D game development process.
The KinematicBody
class is designed for game objects with predefined motion. It inherits properties and methods from the Body
class and provides specific behavior for certain types of game objects.
public class MovingPlatform extends KinematicBody {
private float speed;
private boolean directionRight;
public MovingPlatform(Sprite sprite, Vector3<Float> position, String name, float speed) {
super(sprite, position, name);
this.speed = speed;
this.directionRight = true;
}
@Override
public void start() {
// Initialization logic for the moving platform
}
@Override
public void update(float dt) {
// Update logic for moving platform
if (directionRight) {
position.x += speed * dt;
} else {
position.x -= speed * dt;
}
}
}
The StaticBody
class represents game objects that remain stationary in the game world. It provides specific behavior for static game objects.
public class Obstacle extends StaticBody {
public Obstacle(Sprite sprite, Vector3<Float> position, String name) {
super(sprite, position, name);
}
@Override
public void start() {
// Initialization logic for the obstacle
}
@Override
public void update(float dt) {
// No update logic for a static obstacle
}
}
The Signal
class provides a simple messaging system that allows different parts of the game to communicate and exchange information.
// Sending a signal
Signal.sendSignal("player_hit", player, damage);
// Retrieving a signal
Optional<List<Object[]>> hitSignal = Signal.getSignal("player_hit");
if (hitSignal.isPresent()) {
List<Object[]> packetsList = hitSignal.get();
for (Object[] packets : packetsList) {
// Process packets
}
}
Thank you for considering contributing to the Chronos Engine! You can contribute by reporting issues, suggesting improvements, or submitting pull requests.
Describe the bug: A clear and concise description of what the bug is.
To Reproduce: Steps to reproduce the behavior:
Expected behavior: A clear and concise description of what you expected to happen.
Ensure a positive and inclusive community by following our Code of Conduct.
This project is licensed under the MIT License - see the LICENSE file for details.