Skip to content

Getting Started

Hackusate_PvP edited this page Jul 29, 2023 · 20 revisions

Getting Started

You will need the following installed:

  • IDE (Intellij/Eclipse)
  • Java JDK 17

Maven

Create an empty Maven project and add the following code to the pom.xml

    <dependencies>
        <dependency>
            <groupId>me.piitex</groupId>
            <artifactId>RenJava</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

You will also need to include the Maven shading plugin.

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Make sure you reload/refresh your Maven project. Next create your project structure, this includes src and resources folders. image

You DO NOT need to create a Main class. The framework already comes with a Main class. Create a class which represents the entry point for your game. In my case I create RenTest.java, you can use the name of your game for the class; MyAwesomeGame.java. Once the class is created simply make the class extend RenJava

import me.piitex.renjava.RenJava;
import me.piitex.renjava.gui.SplashScreenView;
import me.piitex.renjava.gui.title.MainTitleScreenView;

public class RestTest extends RenJava {
    
    public RestTest(String name, String author, String version) {
        super(name, author, version);
    }

    @Override
    public void preEnabled() {
        
    }

    @Override
    public void createBaseData() {

    }

    @Override
    public SplashScreenView buildSplashScreen() {
        return null;
    }

    @Override
    public MainTitleScreenView buildTitleScreen() {
        return null;
    }
}

IMPORTANT Remove the constructor parameters and place the values inside of the super(). Failure to do this will result in errors.

import me.piitex.renjava.RenJava;
import me.piitex.renjava.gui.SplashScreenView;
import me.piitex.renjava.gui.title.MainTitleScreenView;

public class RestTest extends RenJava {

    public RestTest() {
        super("Ren Test Game", "piitex", "1.0");
    }

    @Override
    public void preEnabled() {

    }

    @Override
    public void createBaseData() {

    }

    @Override
    public SplashScreenView buildSplashScreen() {
        return null;
    }

    @Override
    public MainTitleScreenView buildTitleScreen() {
        return null;
    }
}

That's it! You now have a working RenJa project.

Clone this wiki locally