msx80
Posts: 17
Joined: Sun Feb 11, 2018 4:36 am

Omicron, a Java game engine/fantasy console (running on PI)

Fri Mar 02, 2018 12:18 pm

Hi there, if anyone is interested, i released this project, which is something between a super simple 2d game engine and a "fantasy console" like pico8 and tic80 (much simpler anyway), based on libgdx. You can program games for raspberry pi in java with it.

If anybody is interested in using or hacking on it, or asking questions, just write here :)

Image

In short, you can write a game using a very simple and flat API, with no other dependency. The game gets compiled to a "cartridge' that can be run on the runtime (omicron.jar) (or you can bundle the runtime and release as a standalone game).

It features:
- runs on all platforms, including raspbian (thanks to clicky)
- generalized gamepad configuration
- old school api and simple resource management
- sandboxed cartridge execution
- fixed resolution (??)

To run just give java -jar omicron.jar <game>.omicron
You can find everything here:

https://github.com/msx80/Omicron/

NB. to run omicron on RPi you probably have to adjust the opengl driver and openal support with the following commands:

Code: Select all

sudo mv /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0.disabled
sudo cp /opt/vc/lib/libbrcmGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
sudo modprobe snd_pcm_oss
Here's the API:

Code: Select all

package com.github.msx80.omicron;

public interface Sys {
	public static final int SCREEN_WIDTH = 384;
	public static final int SCREEN_HEIGHT = 192;
	
	Image loadImage(String filename);
	Image[][] loadSpritesheet(String filename, int sizex, int sizey);
	Sound loadSound(String filename);
	void clearScreen(float red, float green, float blue);
	void color(float red, float green, float blue, float alpha);
	void draw(Image image, int x, int y);
	void draw(Image image, int x, int y, boolean flipX, boolean flipY);
	void draw(Image image, int x, int y, boolean flipX, boolean flipY, int width, int height);
	void draw(Image image, int x, int y, boolean flipX, boolean flipY, int width, int height, int angle);
	void write(Image[][] font, int x, int y, String text);
	void offset(int x, int y);
	void playSound(Sound sound);
	int availableControllers();
	Controller controller(int index);
	Mouse mouse();
	void dispose(Image image);
	void dispose(Sound sound);
	void exit(Object returnValue);
}
Last edited by msx80 on Wed Mar 14, 2018 9:51 am, edited 1 time in total.

clicky
Posts: 226
Joined: Thu Oct 25, 2012 7:34 am

Re: Omicron, a Java game engine/fantasy console (running on PI)

Fri Mar 09, 2018 4:48 pm

Next is to use 3d! Raspberry Pi's GPU is quite good! :D

msx80
Posts: 17
Joined: Sun Feb 11, 2018 4:36 am

Re: Omicron, a Java game engine/fantasy console (running on PI)

Wed Mar 14, 2018 9:50 am

clicky wrote:
Fri Mar 09, 2018 4:48 pm
Next is to use 3d! Raspberry Pi's GPU is quite good! :D
Uh some nice retro 3d game would be cool :)


NB. i forgot to mention that to run omicron you probably have to adjust the opengl driver and openal support with the following commands:

Code: Select all

sudo mv /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0.disabled
sudo cp /opt/vc/lib/libbrcmGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
sudo modprobe snd_pcm_oss

Return to “Java”