Git Product home page Git Product logo

mvengine-java's Introduction

MVEngine

Game engine/framework made in Java.

Editor will be added in a different project, this is just the rendering, gui and physics framework.

This is a graphical game engine (aka with editor) that can be used to create 2D and 3D games in java. We will make it, so you don't need to know java to code in it. Kotlin support will be added as well. But you will also be able to create node-like scripts (like unreal blueprints) instead of coding it in java.

Modern JRE (Java runtime environment) is almost if not just as fast as native code, since it uses JIT compilation. Therefore, speed is not really an issue with using Java over C++. We might make it in C++ later, after we are done with this. For now, I think this is adequate to be a good game engine.

Example code of how we plan this to work:

public class PlayerScript implements GameObjectScript {

    @Override
    public void start(GameObject object) {
        object.setPosition(new Vector3f(0, 0, 0));
    }

    @Override
    public void update(GameObject object) {
        if (Input.isKeyDown(Key.W)) {
            object.setVelocity(new Vector3f(1f, 0, 0));
        }
    }
}

//AUTO GENERATED CLASSES
public class Player extends GameObject {
    private List<GameObjectScript> scripts = new ArrayList<>();

    @Override
    public void start() {
        super.start();
        scripts.forEach(script -> script.start(this));
    }

    @Override
    public void update() {
        super.update();
        scripts.forEach(script -> script.update(this));
    }

    public void addScript(GameObjectScript script) {
        scripts.add(script);
    }

    public void removeScript(GameObjectScript script) {
        scripts.remove(script);
    }
}

//ENGINE CLASSES

public interface GameObjectScript {
    void start(GameObject object);

    void update(GameObject object);
}

public class GameObject {
    //FUNCTION DEFINITIONS HERE
}

//On Game Launch
public class GameLauncher {

    public void launch() {
        //Get game objects from some data or code
        List<GameObject> gameObjects = new ArrayList<>();
        for (DefinedObject object : Data.getDefinedObjects()) {
            gameObjects.add(object.getGameObject());
            object.getGameObject().addScript(gameObjects.getScript());
        }
    }

}

Using the nodes, you can also do the same thing, editing the script through the node editor, this will have two started nodes: start and update. You can do whatever with those nodes, and then make the script generate java code from the nodes.

mvengine-java's People

Contributors

mqxf avatar v22lel avatar

Stargazers

 avatar  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.