GithubHelp home page GithubHelp logo

juneprimavera / jnebula Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theow03/jnebula

0.0 0.0 0.0 984 KB

JNebula, is a modern Component based Graphics/Game engine for Java.

License: GNU Lesser General Public License v2.1

Shell 0.10% Java 96.02% GLSL 3.88%

jnebula's Introduction

JNebula v1.0.0 In-Dev

a component based graphics engine coded in java

coded by: TheoW03

Getting Started

No JSON editor

main

import org.JNebula.GameObjects.GameRenderer;

public class Main {
    public static void main(String[] args) throws IOException {
        GameRenderer starterCode = new StarterCode(); //for step 3 if you get a not defined error then
        Window.InitWindow(640, 480, "example window", starterCode,"");
    }
}

your renderer class

public class StarterCode extends GameRenderer {

    //runs 1st frame. 
    //dt: delta time
    //GL2: OpenGL context
    @Override
    public void start(float dt, GL2 gl){
        GameObject obj = new GameObject("starterObj"); // you can name it what you want
        obj.AddComponent(new CameraComponent(new Vector3(0,0,0))); //not required if you dont add it will default to 0,0
        obj.AddComponent(new SpriteComponents("sprite.png","png",null)); //the null is a color
        obj.AddComponent(new TransformComponent(new Vector3(0,0,0)));
        Scene.InstantiateObject(obj);
    }
    //runs 1st frame. 
    //dt: delta time
    //GL2: OpenGL context
    @Override
    public void update(float dt, GL2 gl){
        GameObject render1Instance = InitObjects.Find("render1");
    }
}

JSON editor

warning: The JSON editor isn't fully functional and may have some bugs. or some specific test cases where its unusable.

[
  {
    "name": "render1",
    "isActive": true,
    "components": [
      {
        "component_name": "org.JNebula.Components.DifferentComponents.TransformComponent",
        "location": {
          "x": 100,
          "y": 100,
          "z": 0
        }
      },
      {
        "component_name": "org.JNebula.Components.DifferentComponents.SpriteComponent",
        "file": "${path to image}",
        "type": "jpg"
      }
    ]
  }
]
import org.JNebula.GameObjects.GameRenderer;

public class Main {
    public static void main(String[] args) throws IOException {
        GameRenderer starterCode = new StarterCode(); //for step 3 if you get a not defined error then
        Window.InitWindow(640, 480, "example window", starterCode, "${PATH TO JSON}");
    }
}
public class StarterCode extends GameRenderer {
    //runs 1st frame. 
    //dt: delta time
    //GL2: OpenGL context
    @Override
    public void start(float dt, GL2 gl){       

    }
    //runs every frame. 
    // dt: delta time
    //GL2: OpenGL context
    @Override
    public void update(float dt, GL2 gl){
        GameObject render1Instance = InitObjects.Find("render1");


    }
}

Documentation

Demo

Contributors

T-A-B

June


I encourage you all to leave feedback in the issue page, or discussion, greatly appreciated.

https://github.com/TheoW03/JNebula/issues

https://github.com/TheoW03/JNebula/discussions

jnebula's People

Contributors

juneprimavera avatar t-a-b avatar theow03 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.