Skip to content

TheNitram21/Blobby-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Version

Blobby Engine

The blobby engine is a 2D level-based easily moddable game engine.

Summary

  1. Features
  2. Download
  3. Getting started
  4. License

Features

NPCs

Blobby Engine's scripted NPCs allow for creating an immersive and interactive world for the player to explore.

Lighting

Blobby Engine supports real-time lighting using shaders.

Shaders

Blobby Engine supports shaders. They are written in GLSL (OpenGL Shading Language).

Physics

Blobby Engine has built-in collision checks.

Level Editor

Blobby Engine has a level editor called BEE.

Download

Blobby Engine is available using Maven.

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>com.github.TheNitram21</groupId>
    <artifactId>Blobby-Engine</artifactId>
    <version>VERSION</version>
  </dependency>
</dependencies>

Remember to replace VERSION with the version you want to get.

Getting started

To create a simple window, first download the BlobbyEngineFiles.zip from the latest release and unzip it into a directory for the game. The ZIP file does contain the whole JRE (Java Runtime Environment) on version 11, so the download could take some time (if you have a bad internet connection) and Blobby Engine will only support Java 11.
Open your IDE. If you don't want to compile your game and create an executable file everytime you want to test your game, create your project inside the game directory. Then download the engine using Maven (see Download). For opening a basic window using Blobby Engine, the following code is needed:

public class Game implements EventListener {
  public static void main(String[] args) {
    ListenerManager.registerEventListener(new Game());
    BlobbyEngine.run(new RunConfigurations("Title", 1280, 720, null, false));
  }
}

This will create a window with the title "Title", a resolution of 1280x720 (the window has to have an aspect ratio of 16:9) and the default icon. Also, the window will not be in fullscreen mode.
But when running the game now, it will crash! Why? That's because you haven't loaded any level. Open the Blobby Engine Editor (located in bin/BEE.exe from the game directory) and save an empty level into the map directory inside your game directory (you'll have to set some level parameters, BEE will tell you which).
Now back to the code: Add the following method to your main class.

@Override
public void onStart(StartEvent event) {
  BlobbyEngine.setPlayer(new Player(new Vector2d(0, 0), Map.of("Texture", TEXTURE_PATH)));
  LevelLoader.loadLevel(LEVEL_PATH, BlobbyEngine::setLevel);
}

Remember replacing LEVEL_PATH with the path to the level you created (not including maps/ or .json) and TEXTURE_PATH with the path to your player texture (again, not including textures/ or .png). The window should not crash anymore!

License

Blobby Engine is licensed under the MIT license. It can be viewed here.