Chronos Engine Documentation

Getting Started

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.

  1. Download the ZIP from the github repository
  2. Unzip the downloaded zip
  3. Include Chronos as in you project

Features

Explore the powerful features that the Chronos Engine offers to simplify your 2D game development process.

Using the KinematicBody Class

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;
                    }
                }
            }
        

Using the StaticBody Class

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
                }
            }
        

Using the Signal Class

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
                }
            }
        

Contributing

Thank you for considering contributing to the Chronos Engine! You can contribute by reporting issues, suggesting improvements, or submitting pull requests.

Bugs

Describe the bug: A clear and concise description of what the bug is.

To Reproduce: Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

Expected behavior: A clear and concise description of what you expected to happen.

Code of Conduct

Ensure a positive and inclusive community by following our Code of Conduct.

License

This project is licensed under the MIT License - see the LICENSE file for details.