Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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  
  Graphics2D  (Read 2673 times)
0 Members and 1 Guest are viewing this topic.
Offline SkyAphid
« Posted 2012-01-03 23:30:05 »

Hey. I'm still a bit new, I've been programming in Java since summer of last year. Anyway, I got into tile-maps and such, and now I'm using pre-rendered maps for what I need done and some tile collision maps for simplicity sake.

Anyway, would graphics2D work for a simple dungeon crawling game? All you do in my so far is go between your characters apartment/town/ and the dungeon. The battles are a lot like The World Ends With You's engine. I mean, I'm not terribly far in, and I'd like to know if I should implement that OpenGL or whatever seeing as this is my first relatively big game in java. It's been simple stuff like Space Invaders and classic Final Fantasy rip offs.

“Life is pretty simple: You do some stuff. Most fails. Some works. You do more of what works. If it works big, others quickly copy it. Then you do something else. The trick is the doing something else.” ~Leonardo da Vinci
Offline JESTERRRRRR

Senior Member


Medals: 7
Exp: 1 year



« Reply #1 - Posted 2012-01-04 01:28:08 »

I'd vote yes to Java2D. If it's your first relatively big game it will cut down dev time so more likely be completed, and keep the rendering simple so you can focus on the game.

However probably going to want to learn openGL sometime and no time like the present... but java2d Smiley
Offline Grunnt

JGO Wizard


Medals: 64
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #2 - Posted 2012-01-04 11:06:47 »

If you're working on a 2D game and would like to get hardware accelleration support, Slick2D is a good place to start. It wraps all the nasty OpenGL stuff and is quite easy to use. I'd argue that using accelleration such as Slick2D offers is actually easier, since you have to worry less about performance. I believe it's also got some built-in support for tiles, though I have never used that.

You can get it here: http://slick.cokeandcode.com/

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ReBirth
« Reply #3 - Posted 2012-01-04 14:45:30 »

Java2D works well when not much load into it.

Offline theagentd
« Reply #4 - Posted 2012-01-04 14:48:00 »

Java2D works well when not much load into it when you're not using it.
FTFY.

Myomyomyo.
Offline gouessej
« Reply #5 - Posted 2012-01-04 16:13:08 »

Lol  Grin

Offline ReBirth
« Reply #6 - Posted 2012-01-04 16:38:31 »

LoL Java2D is not that bad. Just say it's good enough when the game isn't on bloody render.

Offline theagentd
« Reply #7 - Posted 2012-01-04 16:42:08 »

Just to clarify to dear SkyAphid: Java2D is a great starting place, and I've used it a lot in the past. OpenGL is a lot more hassle for the same result (but with better performance of course). Java2D is very sufficient in your case. Just in my experience stay away from scaling and rotating images in real-time...

PS: Why did you name yourself after a bug? Obviously, everyone's gonna hate bugs on a programming forum! xD

Myomyomyo.
Offline ReBirth
« Reply #8 - Posted 2012-01-04 16:51:37 »

hate, or gonna be afraid to him Cheesy

Offline SkyAphid
« Reply #9 - Posted 2012-01-05 01:27:48 »

Haha. My name is came from some guys from school and it stuck. lol.

Anyway, I'm rewriting the game with Slick, seeing as slick obliterates 90% of the problems I have using normal libraries. The only question I have is, does using this destroy the whole "Java works everywhere" thing? That's kind of why I learned the language in the first place so my buddies could play with their macs. lol.

“Life is pretty simple: You do some stuff. Most fails. Some works. You do more of what works. If it works big, others quickly copy it. Then you do something else. The trick is the doing something else.” ~Leonardo da Vinci
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline teletubo
« League of Dukes »

JGO Ninja


Medals: 48
Projects: 4
Exp: 8 years



« Reply #10 - Posted 2012-01-05 01:39:57 »

Your friends will still be able to play your games, but you'll have a little more work to deploy different versions (windows, mac, windows 64, linux, etc). But no code changes at all, only replacing libs and command lines .

Offline SkyAphid
« Reply #11 - Posted 2012-01-05 01:45:04 »

Also, I'm now getting an error from Java.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:75)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
   at org.lwjgl.Sys.loadLibrary(Sys.java:84)
   at org.lwjgl.Sys.<clinit>(Sys.java:101)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
   at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
   at edu.bgp.global.Game.main(Game.java:31)


It's kind of making me mad because it was working like 5 seconds ago.
But even then I got an error related to SlickException.
...
This is making me relatively angry.

“Life is pretty simple: You do some stuff. Most fails. Some works. You do more of what works. If it works big, others quickly copy it. Then you do something else. The trick is the doing something else.” ~Leonardo da Vinci
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #12 - Posted 2012-01-05 02:05:02 »

http://lwjgl.org/wiki/index.php?title=Downloading_and_Setting_Up_LWJGL

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline SkyAphid
« Reply #13 - Posted 2012-01-05 02:10:50 »


I'm sitting here looking at the tutorial at their website.
I've set it up just as directed.
My VM argument has this:
-Djava.library.path=..\lib\natives

The natives folder being where the DLLs are.

“Life is pretty simple: You do some stuff. Most fails. Some works. You do more of what works. If it works big, others quickly copy it. Then you do something else. The trick is the doing something else.” ~Leonardo da Vinci
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #14 - Posted 2012-01-05 06:16:42 »

If this is inside Eclipse, how are you using that java.library.path parameter? You should be setting the natives path from inside the build path by expanding the lwjgl.jar entry and double clicking the "natives" property.

Offline theagentd
« Reply #15 - Posted 2012-01-05 06:19:53 »

1  
-Djava.library.path="C:\Users\Mokyu\lib\lwjgl-2.8.2\native\windows"

That's how mine is. Note the ", they might help... xD

Myomyomyo.
Offline SkyAphid
« Reply #16 - Posted 2012-01-05 11:50:42 »

Well, it's loading them in, now it's doing this.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
Exception in thread "main" java.lang.NoSuchMethodError: getPointer
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(Unknown Source)
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:75)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
   at org.lwjgl.Sys.loadLibrary(Sys.java:84)
   at org.lwjgl.Sys.<clinit>(Sys.java:101)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
   at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
   at edu.bgp.global.Game.main(Game.java:32)


Alright! Fixed it.

I looked over the error and figured it must be related to one of the files being older than another, and then I realized that I was using the lwjgl jar that came with slick. I replaced it with the one from the website, and it fixed my problem.
As related to the missing lwjgl error from earlier, I went to build paths, found lwjgl, lowered the tree, and added the locations of the natives to Natives property. (As ra4king suggested) That's for anyone who may have the same problem, as the VM argument didn't work out for me!

Thanks for the help guys.

“Life is pretty simple: You do some stuff. Most fails. Some works. You do more of what works. If it works big, others quickly copy it. Then you do something else. The trick is the doing something else.” ~Leonardo da Vinci
Offline R.D.

Senior Member


Medals: 2
Projects: 1


"For the last time, Hats ARE Awesome"


« Reply #17 - Posted 2012-01-06 01:14:06 »

If you wanna konw ow to deploy your game to ensure you don't have to put all the natives into the same folder as the jar (or use reflection) just say it, there is a really easy way, at least I think it is easy Cheesy
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.

pw (26 views)
2014-07-24 01:59:36

Riven (25 views)
2014-07-23 21:16:32

Riven (19 views)
2014-07-23 21:07:15

Riven (22 views)
2014-07-23 20:56:16

ctomni231 (51 views)
2014-07-18 06:55:21

Zero Volt (46 views)
2014-07-17 23:47:54

danieldean (37 views)
2014-07-17 23:41:23

MustardPeter (40 views)
2014-07-16 23:30:00

Cero (56 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!