Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  2DGE (EDGE) Java graphics engine  (Read 1596 times)
0 Members and 1 Guest are viewing this topic.
Offline lcass
« Posted 2013-08-20 21:29:56 »

2DGE

So I decided to wright a simple little graphics engine for people who either dont want to write their own or arnet to sure.
Features:
custom height,width.
supports offsets.
contains an image reader.
game timer.
multiple draw methods.
custom default image size.

future features:
Font renderer.
layering support.
lighting controller

so here it is enjoy!

2DGE download: https://docs.google.com/file/d/0B48ywWBymi3OLVZtZ1c3LTV3UEk/edit?usp=sharing

Basic usage.

Updated tutorial!

---tutorial---

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
package GEDEMO;

import GECORE.Ge;//import ant!
import GEGRAPHICS.drawableobj;
import GEGRAPHICS.renderhandler;
import GEINPUT.spritesheet;
import GEINTERFACE.Animation;

public class Tutorial {
   private Ge ge;//setup objects
   private spritesheet s;
   private drawableobj dro;
   private drawableobj dro1;
   private drawableobj dro2;
   private renderhandler rh;
   private Animation a;
   private Animation a1;
   private int[][] data = new int[64][64];//image array, this may change in the future to a sprite object
   public static void main(String[] args){
      new Tutorial();//basically start.
   }
   public Tutorial(){
      rh = new renderhandler();//generate the render handler
      ge = new Ge(600,600,1,"Tutorial",rh,2,2);//set up the frame,  width   height    scale    name   renderhander(this will be updated so you can add multiple ones)  multx multy (for the graphical map size)
      rh.setuphandler(ge, 3);//setup the rh with a GEcore and how many objects it will be rendering at most
      //s = new spritesheet("spritelocation.png/jpg"); dont have an image so its commented out but put the image location plus the extension in as a string
      setup();//called to setup everything before you start the tick loop otherwise it will not load.
      ge.start(true);//start the tickloop this will run the graphics and animation timers.
   }
   public void setup(){
      for(int x = 0; x < 64;x++){//dont need to use this is just because i dont have an image. gives a nice effect though :)
         for(int y = 0; y < 64;y++){
            data[x][y] = x * y * 9999;
         }
      }
      //s.getsprite(0, 0, data, 64, 64);//what would be used to get a 64 by 64 sprite from the x and ypos 0.
      dro = new drawableobj(0,0, 64, 64, data, "Tut1");  //turn the data into a drawable object for use in the renderhandler
      dro1 = new drawableobj(128,0, 64, 64, data, "Tut2");//just for extras
      dro2 = new drawableobj(0,128, 64, 64, data, "Tut3");
      rh.addobj(dro1);//add each one to it.  We set the max it would render to three so it will only render 3.
      rh.addobj(dro2);
      rh.addobj(dro);
      a = new Animation(16, 16, 4, data, ge,"animation 1");//setup the animations   width    height    frame num    datafile(has all frames on it consecutively from left to right)   GEcore   id
      a1 = new Animation(16,16,4,data,ge,"animation 2");
      ge.addanimationtimer(a);//used to tick the animation
      ge.addanimationtimer(a1);
      a.animate(128, 128, 40);//animates the data and then removes it when complete
      a1.stop();//used to setup variables and stop all running processes in animation. you must use this before running a repetitive animation.
      a1.repetitiveanim(128, 192, 40);//runs until stop is called/
      ge.screen.draw(256, 256, data);//a function that draws a 32 by 32 image at the set x and y
      ge.screen.draw(512, 256, data,64,64);// the same but with custom bounds
      ge.screen.clear(520, 280, 10, 10);//removes an area from the graphical map
   }
}





Enjoy lots more features to come.

---updates---

UPDATE 1:
New features:
An auto drawing system called renderhandler();
Now functions as an import type system not a base system.
Setup for GUI's.
New way of using images.

UPDATE 2:
New features:
animation handling! horrah!
fixed a bug messing with the rendering.
new commands and a new import file!
new commands.
stop();
animate(x,y,ticks);
repetitiveanim(x,y,ticks);
addanimationtimer(animation);
clear(x,y,width,height);

UPDATE 3:
Tutorial is now up to date.



---Quick thoughts---
So I was having an idea about pushing everything into the ge class so you only require to type Ge. not go Ge.screen Ge.spritesheet.
Along with this maybe implementing input handing and mousehandling maybe rename it to game engine possibly even in the future add in support for tilling and entitys we will see...
Offline lcass
« Reply #1 - Posted 2013-08-21 13:27:15 »

So just had an idea. An animation creator that exports a .png file storing your animation that can be read by the 2DGE software. what do you guys think?
Offline gouessej
« Reply #2 - Posted 2013-08-21 15:32:34 »

I prefer LibGDX  persecutioncomplex

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lcass
« Reply #3 - Posted 2013-08-21 19:35:07 »

Ok code update is now out for supporting people who do not want to have to run their own loop.
Offline HeroesGraveDev

JGO Kernel


Medals: 297
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #4 - Posted 2013-08-22 04:13:02 »

Your package naming is unconventional. Pointing

Also, you're competing for the same userbase as LibGDX. You're not really going to win.
And the people that don't use LibGDX have already made this stuff themselves.

The source code might be a good learning resource for beginners to OpenGL, but other than that I see no real value in this project as of it's current state. (even LibGDX had to start somewhere)

Offline lcass
« Reply #5 - Posted 2013-08-22 11:33:53 »

True, it is only in the early versions. Its mainly designed for people who just want a renderer and dont want the hastle of making their own.  As for the package names ill play around with them.
Offline Troncoso

JGO Coder


Medals: 20



« Reply #6 - Posted 2013-08-22 11:48:46 »

Your package naming is unconventional. Pointing

Also, you're competing for the same userbase as LibGDX. You're not really going to win.
And the people that don't use LibGDX have already made this stuff themselves.

The source code might be a good learning resource for beginners to OpenGL, but other than that I see no real value in this project as of it's current state. (even LibGDX had to start somewhere)

You misunderstand LibGDX's popularity. It's popular because there isn't any competition for it. If you remember, Slick2D was anyone's first choice until it stopped being maintained.

I'm not saying that this project in particular will do anything to changed that, but honestly, LibGDX was just started by a regular programmer like any of us. Again, it picked up because there wasn't much an alternative besides Slick. To try and tell someone they couldn't do the same thing...well, that's just not very nice.
Offline namrog84

JGO Ninja


Medals: 46
Projects: 4


Keep programming!


« Reply #7 - Posted 2013-08-22 13:02:05 »

I agree partly with Troncoso.

Although its a small start now. It takes time to polish it. Especially if he is learning some of it as he goes along. 

Also Java/Eclipse is great at refactoring, changing things like package naming and other things are very easy.  I am sure if he were to continue working on it, that it will improve with time.

Additionally if he even developed it partly, maybe he will make a couple things in it, that are awesome, that could be absorbed into LibGDX or someone else's homegrown engine.

So I say keep up the work!  Cool


"Experience is what you get when you did not get what you wanted"
Offline lcass
« Reply #8 - Posted 2013-08-22 13:06:08 »

Thanks for all the support. Brilliant community here. Also if you have any suggestions please tell me.  Currently this is whats going to happen in the near future:  Rotation algorithms for integer arrays(this will be useful for all sorts of stuff)  Gui stuff like popups. Possibly a built in lighting engine I may start talking to the person who made straight edge(brilliant lighting engine).

Note it will be just 2d for the foreseeable future.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #9 - Posted 2013-08-22 17:44:16 »

When I see APIs with naming conventions that unconventional, I need to be convinced that it's for a reason and not due to a lack of understanding of basic conventions.  How this reflects on the library's quality in general should go without saying.  Looks matter.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lcass
« Reply #10 - Posted 2013-08-22 21:05:21 »

looks matter but its use its the most important.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (65 views)
2014-11-26 15:22:04

toopeicgaming1999 (58 views)
2014-11-26 15:20:36

toopeicgaming1999 (11 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (28 views)
2014-11-25 11:26:43

Gibbo3771 (24 views)
2014-11-24 19:59:16

trollwarrior1 (37 views)
2014-11-22 12:13:56

xFryIx (76 views)
2014-11-13 12:34:49

digdugdiggy (53 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!