Test de mi gameEngine en processing.

Todo aquello que no está relacionado con Gemix Studio ni con la programación DIV en general.

Re: Test de mi gameEngine en processing.

Postby erkosone » Sat Aug 05, 2017 9:35 pm

Te dejo un juego que estoy haciendo, de juego tiene bien poco jeje.. pero es para que veas un poco por encima el tipo de resultados que se consiguen y que esfuerzo supone.

No olvides que se trata de java y processing.. pero con una librería al estilo Gemix.

DESCARGA del test: https://www.dropbox.com/s/677jv0cgx3wrf ... 2.rar?dl=0

Source del test:

Source Code (Java) [ Download ] [ Hide ]
  • int st = 0;
  • PFont fnt01, fnt02, fnt03, fnt04;
  • AudioPlayer snd[];
  • PImage img[];
  • sprite sp;
  • boolean guiPosible = true;
  • sprite b0, b1;    // botones del inicio..
  • //------------------------------------------------------------
  • void Settings() {
  •   setMode(400, 640, false);
  •   orientation(PORTRAIT);
  •   fps = 60;
  •   fadingColor = 255; // white screen fading..
  • }
  • //------------------------------------------------------------
  • void Setup() {
  •   img = loadImages("images/");
  •   snd = loadSounds("sound/sfx/");
  •   snd[0] = loadSound("sound/music/external.mp3");
  •   fnt01 = loadFont("Lobster1.4-22.vlw");
  •   fnt02 = loadFont("CabinSketch-Bold-48.vlw");
  •   fnt03 = loadFont("DarkCrystalScript-48.vlw");
  •   fnt04 = loadFont("DejaVuSans-48.vlw");
  •   //println(System.getProperty("os.name"));
  • }
  • //------------------------------------------------------------
  • void Draw() {
  •   switch(st) {
  •   case 0:
  •     sp = new gatoIntro();
  •     fadeOff(0);
  •     st = 10;
  •     break;
  •   //++++++++++++++++++++++++++++++++
  •   case 10:
  •     if (fading == false) {
  •       fadeOn(500);
  •       st = 100;
  •     }
  •     break;
  •   //++++++++++++++++++++++++++++++++
  •   case 100:
  •     // el fadeOff() lo hace el proceso del gato..
  •     if(sp.live == false){
  •       fadeOn(250);
  •       //soundPlay(snd[0]);
  •       new scroll(img[10], 0.5, 0);
  •       b0 = new botonSimple(img[7], 200,250,120,150,  #F73CF5, "EMPEZAR", 32);
  •       b1 = new botonSimple(img[7], 200,400,120,150,  #EDF51B, "SALIR AL SISTEMA", 32);
  •       st = 110;
  •     }
  •     break;
  •   //++++++++++++++++++++++++++++++++
  •   case 110:
  •     screenDrawGraphic(img[7], 200, 50, 0, 180, 200, 128);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 68-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 72-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 198, 70-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 202, 70-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 70-22, 255, 255);
  •     screenDrawText(fnt04, 18, "Programado por: Luis Lopez Martinez.", 4, 200, 600, 0,255);
  •     screenDrawText(fnt04, 18, "Idea original: Tabita Jacas Font.", 4, 200, 620, 0,255);
  •     if(b0.z == 1){
  •       fadeOff(500);
  •       st = 120;
  •     }
  •     if(b1.z == 1){exit();}
  •     break;
  •   //++++++++++++++++++++++++++++++++
  •   case 120:
  •     screenDrawGraphic(img[7], 200, 50, 0, 180, 200, 128);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 68-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 72-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 198, 70-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 202, 70-22, 0, 255);
  •     screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 70-22, 255, 255);
  •     screenDrawText(fnt04, 18, "Programado por: Luis Lopez Martinez.", 4, 200, 600, 0,255);
  •     screenDrawText(fnt04, 18, "Idea original: Tabita Jacas Font.", 4, 200, 620, 0,255);
  •     if(!fading){
  •       letMeAlone();
  •       new SubCrearPartida();
  •       fadeOn(500);
  •       st = 130;
  •     }
  •     break;
  •   //++++++++++++++++++++++++++++++++
  •   case 130:
  •    
  •     break;
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   }
  • }
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • class gatoIntro extends sprite{
  •   int st = 0;
  •   int delay;
  •   int anima = 0;
  •   PImage animation[];
  •   int counter = 0;
  •   String t1 = "TAP TAP NYAA!";
  •   void frame(){
  •     switch(st){
  •       //++++++++++++++++++++++++++++++++
  •       case 0:
  •         backgroundColor = color(#090093);
  •         x = 200;
  •         y = 200;
  •         sizeX = 150;
  •         sizeY = 150;
  •         alpha = 0;
  •         animation = loadImages("cat/");
  •         st = 10;
  •         break;
  •       //++++++++++++++++++++++++++++++++
  •       case 10:
  •         delay = (delay + 1) % 8;
  •         if(delay == 0){
  •           anima = (anima+1) % animation.length;
  •           if(anima == 0){
  •             st = 20;
  •           }
  •         }
  •         screenDrawGraphic(animation[anima], x, y, angle, sizeX, sizeY, 255);
  •         // cat sound trigger..
  •         counter ++;
  •         if(counter == 100){
  •           soundPlay(snd[6]);
  •         }
  •         // info text trigger..
  •         if(counter > 130){
  •           if(alpha < 255){
  •             alpha += 5;
  •           }
  •           screenDrawText(fnt01, 42, t1, 4, 200, 370, 255,alpha);
  •           screenDrawText(fnt01, 22, "By Luis lopez & Tabita Jacas", 4, 200, 400, 127,alpha);
  •         }
  •         break;
  •       //++++++++++++++++++++++++++++++++
  •       case 20:
  •         screenDrawGraphic(animation[anima], x, y, angle, sizeX, sizeY, 255);
  •         screenDrawText(fnt01, 42, t1, 4, 200, 370, 255,alpha);
  •         screenDrawText(fnt01, 22, "By Luis lopez & Tabita Jacas", 4, 200, 400, 127,alpha);
  •         fadeOff(1000);
  •         st = 30;
  •         break;
  •       //++++++++++++++++++++++++++++++++
  •       case 30:
  •         screenDrawGraphic(animation[anima], x, y, angle, sizeX, sizeY, 255);
  •         screenDrawText(fnt01, 42, t1, 4, 200, 370, 255,alpha);
  •         screenDrawText(fnt01, 22, "By Luis lopez & Tabita Jacas", 4, 200, 400, 127,alpha);
  •         if(!fading){
  •           signal(id, s_kill);
  •           st = 40;
  •         }
  •         break;
  •       //++++++++++++++++++++++++++++++++
  •       case 40:
  •        
  •         break;
  •       //++++++++++++++++++++++++++++++++
  •       //++++++++++++++++++++++++++++++++
  •     }
  •   }
  • }
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • class scroll extends sprite{
  •   int st = 0;
  •   float w = 400;
  •   float h = 640;
  •   PImage texture = null;
  •   float deltaX = 0;
  •   float deltaY = 0;
  •   //++++++++++++++++++++++++++++++++
  •   //............................
  •   public scroll(PImage texture, float deltaX, float deltaY) {
  •     this.texture = texture;
  •     this.deltaX = deltaX;
  •     this.deltaY = deltaY;
  •     priority = 1024;
  •   }
  •   //............................
  •   //++++++++++++++++++++++++++++++++
  •   void frame(){
  •     // draw scroll..
  •     draw2();
  •     switch(st){
  •     case 0:
  •       x0 += deltaX;
  •       y0 += deltaY;
  •       break;
  •     }
  •   }
  •   //++++++++++++++++++++++++++++++++
  •   void draw2() {
  •     blitter.pushMatrix();
  •     blitter.beginShape();
  •     blitter.textureWrap(REPEAT);
  •     blitter.tint(255, 255);
  •     blitter.texture(texture);
  •     blitter.vertex(x, y, x0, y0);
  •     blitter.vertex(x+w, y, x0+w, y0);
  •     blitter.vertex(x+w, y+h, x0+w, y0+h);
  •     blitter.vertex(x, y+h, x0, y0+h);
  •     blitter.endShape();
  •     blitter.popMatrix();
  •   }
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  •   //++++++++++++++++++++++++++++++++
  • }
  •  
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • class SubCrearPartida extends sprite{
  •   int st = 0;
  •   void frame(){
  •     switch(st){
  •     //............................
  •     case 0:
  •       new scroll(img[11], 0.2, 0.4);
  •       new numeroDeJugadores();
  •       x = 200;
  •       y = 50;
  •       sizeX = 180;
  •       sizeY = 200;
  •       st = 10;
  •       break;
  •     //............................
  •     case 10:
  •       screenDrawGraphic(img[7], x, y, 0, 180, 200, 128);
  •       screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 68-22, 0, 255);
  •       screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 72-22, 0, 255);
  •       screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 198, 70-22, 0, 255);
  •       screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 202, 70-22, 0, 255);
  •       screenDrawText(fnt03, 56, "oCALIMOCHO", 4, 200, 70-22, 255, 255);
  •      
  •      
  •       break;
  •     //............................
  •     case 20:
  •      
  •       break;
  •     //............................
  •     //............................
  •     //............................
  •     //............................
  •     }
  •   }
  • }
  • //------------------------------------------------------------
  • class numeroDeJugadores extends sprite{
  •   int st = 0;
  •   sprite b1, b2;
  •   int numPlayers = 2;
  •   //............................
  •   void frame(){
  •     switch(st){
  •       //............................
  •       case 0:
  •         b1 = new botonSimple(img[12], 100, 243, 100, 100, 0, "", 1);
  •         b1.priority = 256;
  •         b2 = new botonSimple(img[12], 300, 243, 100, 100, 0, "", 1);
  •         b2.angle = 180;
  •         b2.priority = 256;
  •         st = 10;
  •         break;
  •       //............................
  •       case 10:
  •         render();
  •         if(b1.z == 1){
  •           if(numPlayers > 2){
  •             numPlayers --;
  •             st = 20;
  •           }
  •         }
  •         if(b2.z == 1){
  •           if(numPlayers < 8){
  •             numPlayers ++;
  •             st = 20;
  •           }
  •         }
  •         break;
  •       //............................
  •       case 20:
  •         render();
  •         if(!mouse.left){
  •           b1.z = 0;
  •           b2.z = 0;
  •           st = 10;
  •         }
  •         break;
  •       //............................
  •       //............................
  •       //............................
  •       //............................
  •     }
  •   }
  •   //............................
  •   void render(){
  •     screenDrawGraphic(img[7], 200, 200, 0, 200, 100, 255);
  •     screenDrawText(fnt02, 32, "CUANTOS JUGADORES?", 4, 200, 196, 255, 255);
  •     screenDrawGraphic(img[8], 200, 240, 0, 100, 100, 255);
  •     screenDrawText(fnt02, 48, str(numPlayers), 4, 200, 240, 255, 255);
  •   }
  • }
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • class botonSimple extends sprite{
  •   int st = 0;
  •   color col = 255;
  •   String texto = "";
  •   int textoSize = 0;
  •   //............................
  •   public botonSimple(PImage g, float x, float y, float sizeX, float sizeY, color col, String texto, int textoSize){
  •     this.x = x;
  •     this.y = y;
  •     this.sizeX = sizeX;
  •     this.sizeY = sizeY;
  •     this.texto = texto;
  •     this.textoSize = textoSize;
  •     this.col = col;
  •     setGraph(g);
  •   }
  •   //............................
  •   void frame(){
  •     switch(st){
  •       //............................
  •       case 0:
  •        
  •         st = 10;
  •         break;
  •       //............................
  •       case 10:
  •         screenDrawText(fnt02, textoSize, texto, 4, x, y-5, col, 255);
  •         if(collisionMouse(id)){
  •           if(mouse.left){
  •             z = 1;
  •           }
  •         }
  •         break;
  •       //............................
  •       //............................
  •     }
  •   }
  •   //............................
  •   //............................
  •   //............................
  • }
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
  • //------------------------------------------------------------
User avatar
erkosone
 
Posts: 10654
Joined: Tue Feb 24, 2009 2:13 pm
Location: Barcelona.

Re: Test de mi gameEngine en processing.

Postby Spiderman » Sun Aug 06, 2017 3:03 pm

Guaauu, o deberia decir miauuu? jaja.

La cosa promete. :y:
User avatar
Spiderman
 
Posts: 761
Joined: Wed Feb 11, 2009 2:49 am

Re: Test de mi gameEngine en processing.

Postby erkosone » Wed Aug 30, 2017 10:32 pm

Primer Video Tutorial de mi libreria para videoJuegos en processing llamada 'gameLibZero'.

El video dura una hora y cuarto, presento la librería y programo un juego de naves desde cero con ella, el parecido con GemixStudio es muy grande, espero cicTec que no te moleste que use los mismos nombres de función que los de tu lenguaje, si hay algun problema los cambiaré y ya esta.

Por lo que dura el video me es imposible subirlo entero a youtube, os dejo el link de descarga del archivo de video que ocupa 300 megas.
https://www.dropbox.com/s/1jppruc6gxjsv ... 0.wmv?dl=0

La libreria es Open Source y la publicaré en pocos días en el foro de processing, junto con la librería de audio que ya incluye para Android también programada por mi. :)

Si alguien quiere darme algun tipo de feedback bienvenido será.
Para verlo en HD descargarlo.
User avatar
erkosone
 
Posts: 10654
Joined: Tue Feb 24, 2009 2:13 pm
Location: Barcelona.

Re: Test de mi gameEngine en processing.

Postby CicTec » Thu Aug 31, 2017 7:45 am

erkosone wrote:el parecido con GemixStudio es muy grande, espero cicTec que no te moleste que use los mismos nombres de función que los de tu lenguaje, si hay algun problema los cambiaré y ya esta.

Si estas utilizando la misma API de Gemix (o casi), significa que el trabajo que hice en el lenguaje ha gustado tanto da adoptarla como modelo para otros engines, no le veo problema.
User avatar
CicTec
 
Posts: 16553
Joined: Thu Jul 31, 2008 10:18 pm

Re: Test de mi gameEngine en processing.

Postby OskarG » Thu Aug 31, 2017 11:16 am

te comento,he bajado el ejemplo testarrayobject,se ejecuta una ventanita ,pero no hace nada....supongo que es un problema de opengl ?¿??
User avatar
OskarG
 
Posts: 612
Joined: Tue Jan 12, 2010 2:12 am

Re: Test de mi gameEngine en processing.

Postby erkosone » Thu Aug 31, 2017 11:22 am

Hola OskarG, pues es un error de opengl en tu maquina, supongo que o no tienes los drivers de la grafica bien instalados o la grafica es obsoleta.
User avatar
erkosone
 
Posts: 10654
Joined: Tue Feb 24, 2009 2:13 pm
Location: Barcelona.

Re: Test de mi gameEngine en processing.

Postby erkosone » Thu Aug 31, 2017 11:23 am

@CicTec, gracias ;) el API de gemix en gran parte me parece muy bueno, si no me pareciera bueno no lo adoptaria jeje.
User avatar
erkosone
 
Posts: 10654
Joined: Tue Feb 24, 2009 2:13 pm
Location: Barcelona.

Re: Test de mi gameEngine en processing.

Postby CicTec » Thu Aug 31, 2017 11:28 am

erkosone wrote:@CicTec, gracias ;) el API de gemix en gran parte me parece muy bueno, si no me pareciera bueno no lo adoptaria jeje.

Asi que deduco que otra pequeña parte no gusta mucho :P, igual algun dia pon un listado de las cosas que "no te gustan", almenos para saber si en futuro se puede mejorar algo.
User avatar
CicTec
 
Posts: 16553
Joined: Thu Jul 31, 2008 10:18 pm

Re: Test de mi gameEngine en processing.

Postby Spiderman » Fri Sep 01, 2017 7:38 pm

Pues es muy muyyy interesante.

Ya me he visto el video y me parece que esto tiene muchas posibilidades. No conocia este lenguaje de programación.

Se agradece mucho el curro que te has pegado y sobre todo gracias por compartirlo. Te he oido en el video que dices que es el primero. Ya estas tardando en subir más :P

Fuera de bromas, tengo muchas preguntas pero voy a dejarlo en dos de momento.

El foro de processing que comentas cual es?

El editor que usas es el propio de Processing? Me ha gustado bastante su sencillez.
User avatar
Spiderman
 
Posts: 761
Joined: Wed Feb 11, 2009 2:49 am

Re: Test de mi gameEngine en processing.

Postby erkosone » Fri Sep 01, 2017 9:48 pm

Hola Spiderman, el foro que comento es el foro oficial de processing.
Y el IDE es el oficial creado para processing.

La librería que he creado te juro que cada vez que ejecuto uno de mis juegos/aplicaciones en android me da un placer inmesurable..

En breve subo todos los demás, voy a tomar como referencia los que tengo de gemix y los voy a pasar a 'GameLibZero'.

Lo mejor de todo son los cientos de librerias que hay para processing tio.. es increible lo que se puede hacer.. :D
User avatar
erkosone
 
Posts: 10654
Joined: Tue Feb 24, 2009 2:13 pm
Location: Barcelona.

PreviousNext

Return to Offtopic

Who is online

Users browsing this forum: No registered users and 2 guests