Hi all!
I’m developing a new library for the creation of 2D games in Java. The main goal of the project is to give anyone the opportunity to create a game, without the need to spend a lot of time learning how game programming works. The only prerequisite is some basic java programming knowledge. The libray do not use any particular technology or other libraries (ie LWJGL, JME, ecc…), but only pure Java. The library is not ready for a release yet, but I want to know if the project might be interesting for you or not!
I give you an example what Aries can do:
public class MyGame extends AriesGame {
private AriesPicture p1 = new AriesPicture(200, 200);
public MyGame() {
game = this; // this operation is very important when you extends the class AriesGame
game.set(AriesGame.S_640BY480, AriesGame.FULLSCREEN); // set up the game
p1.drawString(0, 10, "A simple java game!"); // draw a String in the AriesPicture
p1.drawRectangle(0, 0, 199, 199, false); // draw a Rectangle in the AriesPicture, the 'false' determines if the shape is filled or not, in this case: not.
p1.setPosition(100, 150); // the position on the screen
game.store.addObject("p1", p1); // add the object in the game
game.start(); // start the game :)
}
// this method manages the events in the game and you can manage all the game by a sequence of IF-ELSE
// if event occurs you can manage it in this simple way
public void events() {
// if the space bar is hit
if (keyboard.isTyped(keyboard.KEY_SPACE)) {
game.store.getPicture("p1").clear(); // clear the picture
game.store.getPicture("p1").drawString(0, 10, "You hit the Space Key"); // draw a string
}
// if the wheel of mouse is moved up
if (mouse.isWheelUp()) {
game.store.getPicture("p1").move(0, -150); // move the picture 0 pixel for X and -150 pixel for Y
}
// if I'm holding pressed the Shift Key and I click on the Button 1 of mouse
if (keyboard.isPressed(keyboard.KEY_SHIFT) && mouse.isClicked(mouse.BUTTON1)) {
game.store.getPicture("p1").move(50, 30); // move the picture 50 pixel for X and 30 pixel for Y
}
}
public static void main(String[] args) {
new MyGame();
}
}
this is the result: