We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › GALI: a games library template for Processing
Page Index Toggle Pages: 1
GALI: a games library template for Processing (Read 1188 times)
GALI: a games library template for Processing
Mar 8th, 2010, 2:11pm
 
Hi!

After many tries to make a sofisticated game library for Processing, I' ve decided to make something simplest.
So, here is GALI (a games library template for Processing).

It consists of many Tabs which you' ll have to add to your sketch depending on what you want to achieve.

The library is not fully complete, and I hope this comunity will help improving it Smiley

http://nicolas.atek.perso.sfr.fr/processing/template/applet

There is no help file atm, I wil add brieve description of each command to the sources.

gNode and gali Tabs are mandatory. The gKey Tab add easy keyboard functions.

Each sketch needs at least gNode and gali Tabs and must looks like this:
Code:
import processing.opengl.*;

GALI gali;

void setup() {
 size(400, 400, OPENGL); // GALI only works with openGl
 gali = new GALI(); // Library initialisation
}

void draw() {
 background(0);
 gali.render(); // Render nodes(images, text, canvas, ...)
}


How to add an image:
Code:
import processing.opengl.*;

GALI gali;

gImage myImage;
gNode myImageNode;

void setup() {
 size(400, 400, OPENGL); // GALI only works with openGl
 gali = new GALI(); // Library initialisation
 
 // Load an image and add it to a new node
 myImage = gali.newImage("url of your image");
 myImageNode = gali.addNode(myImage, 200, 200);
}

void draw() {
 background(0);
 gali.render(); // Render nodes(images, text, canvas, ...)
}


Now you can manipulate myImageNode with methods like:
- myImageNode.setPos(x, y);
- myImageNode.setScale(scale);
- myImageNode.turn(amount);
- ...
Or by modifying some properties:
- myImageNode.blend = true;
- myImageNode.z = -1;
- myImageNode.alpha = 0.5;
- ...

You can also add an empty node and parent your myImageNode to it.

Adding a text node is so simple:
- myTextNode = gali.addNode(PFont processingFont, "put your text here", 50, 50);
- myTextNode = gali.addNode("put your text here", 50, 50); // will use the default Courrier font

gCanvas type will let you create and access a JAVA2D graphics buffer with the ability to define a grid for realtime manipulations.



Feel free to modify and send links of your templates and or demos.
Questions? Help? Ideas for optimisations or improvements? -> use this topic  Wink
Re: GALI: a games library template for Processing
Reply #1 - Mar 9th, 2010, 12:51am
 
Hi,
I like the idea very much, but I guess to get things started you really need a good documentation & some examples people can build on.

I just had a very quick look, but I think "understanding what's going on" would take me a considerable time which I -at the moment- would rather invest into some of my own coding, and others might think similarily.

Just checking the number of people who read this (= # of people intrigued by the idea of a gmaes library templates as suggested by the title) compared to the number of replies (= # of people interested in actually using the library as it is and thus commenting) seems to support my argument...

Re: GALI: a games library template for Processing
Reply #2 - Mar 10th, 2010, 1:21am
 
Hello,

what kind of Games can be made with it?

Is it "2D jump and run" or
"3D jump and run" (or even
more like chess or backgammon or
First person shooter)?

Do we have collision, gravity...?

Thank you!

Thanks!


Re: GALI: a games library template for Processing
Reply #3 - Mar 11th, 2010, 2:40pm
 
GALI is a 2D game library with some 3D transformations capabilities (for visual effects).

bejosgha: It is far from finished yet and needs help file and demos (what I am working on).

Chrisir: Once it will be more advanced, you ll be able to make any kind of 2D games.
Page Index Toggle Pages: 1