Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Pygame for java
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raknarg




PostPosted: Mon Dec 09, 2013 10:05 pm   Post subject: Pygame for java

Hey. I just recently got into java because of university. I already had experience with a language that was directly based off of java and I liked it, but there's one problem: Like python, java only works with the command line. However, Python has the Pygame module to create a canvas that you can interact with (after a lot of practice... it definitely was not intuitive). Is there something like that for java, that has image modules and draw modules, text and sound?
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Mon Dec 09, 2013 10:12 pm   Post subject: RE:Pygame for java

Your best bet for something like pygame is probably either libGDX (http://libgdx.badlogicgames.com/) or Slick2D (http://slick.ninjacave.com/). I'd suggest looking at libGDX first.
Raknarg




PostPosted: Mon Dec 09, 2013 10:16 pm   Post subject: RE:Pygame for java

Thanks, I'll look at that.

Also, if anyone is familiar with the language processing, is it mostly a suitable replacement for Java? I don't know much about how Java itself is used, so I have no idea. Like I've made applications in processing, but I'm pretty sure the method of doing things is different and more complex for java... like it has more control that way
Tony




PostPosted: Mon Dec 09, 2013 10:51 pm   Post subject: RE:Pygame for java

Processing is more for toy projects, animations, demos, etc. It's very interactive and visual. Java is... corporate - it performs well for huge projects that are worked on by many independent teams.

P.S. there's a Java-free version of processing, that runs on top of JavaScript instead -- http://processingjs.org/
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Raknarg




PostPosted: Mon Dec 09, 2013 10:56 pm   Post subject: RE:Pygame for java

Thanks for the post. Yeah, I figured that, I know a few people who work for big corporations or the government, and they use java a lot, but I rarely hear people using Java for personal projects. Or if they do, they only do it because it's for school.

Another question: I see Java getting a lot of hate here (or t least I used to). Why do people have such prejudice against it? I actually sort of like it, it feels right (might be my years of learning programming with Turing)
Tony




PostPosted: Mon Dec 09, 2013 11:18 pm   Post subject: RE:Pygame for java

I suspect that being good for huge corporate projects, comes with a cost that just gets in the way for personal/medium-sized projects. Java forces certain kinds of boilerplate, configs, design patterns, etc. for what "should" be really simple.

Check out http://www.willa.me/2013/11/the-six-most-common-species-of-code.html for different "styles" of doing the same thing. Java trends towards that "large company" example.

That might actually be a reasonable implementation, if the definition of the fibonacci sequence is defined by a business team from the office in another city. But this is also terribly frustrating when you just want to make interesting new things.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
TerranceN




PostPosted: Tue Dec 10, 2013 1:07 am   Post subject: RE:Pygame for java

Check out Scala. Scala is why I don't like Java.

Scala runs on the JVM, so you get all the same libraries, and it has type inferencing, functions as first class citizens - including a collections library with all the standard functional programming functions like map, fold, filter, etc - and pattern matching (it's like a switch statement on steroids). It's hard to be excited about Java8 getting lambda expressions when Scala exists.
Raknarg




PostPosted: Tue Dec 10, 2013 9:57 am   Post subject: RE:Pygame for java

Thanks, I'll take a look at that!

EDIT: scala seems cool, but I can't even get it to create a file class
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Tue Dec 10, 2013 2:49 pm   Post subject: RE:Pygame for java

Note: it's possible to write huge, successful projects without descending into the "Large Corporation" model. You might have to look further for good code samples, though.

Hint to all Java developers: demand to use libraries that make the language better! Try some projectlombok.org ! If you use a database, try Hibernate (in @Entity-mapping mode, not in the config-file mode)!

If your library is making life harder than not using the library, throw it out.
Raknarg




PostPosted: Wed Oct 29, 2014 2:44 pm   Post subject: RE:Pygame for java

hey I know this is old, but I have a new question:

I read somewhere that Swing is hardware accelerated, how is Swing as a graphics library in comparison to some of the other Java graphics libraries?
DemonWasp




PostPosted: Wed Oct 29, 2014 6:50 pm   Post subject: RE:Pygame for java

If you are looking for a UI library, then you should probably use JavaFX or SWT. JavaFX is the latest core Java UI framework; SWT is an IBM effort that forms the basis for Eclipse.

Swing isn't actually deprecated yet, but it may be soon. It's complicated, unintuitive, and its API design is not very good. JavaFX seems to be better in every respect (to be fair, I don't do much UI dev work). Swing is "hardware accelerated", but I have found it difficult to get worthwhile performance out of Swing.

If you are looking for a graphics library, then your first stop should be libGDX. If you are doing more sophisticated 3D stuff, then try JMonkeyEngine. If you want to write 3D rendering engines yourself, look into the lightweight Java game library, LWJGL (both libGDX and JME are based on LWJGL).
Raknarg




PostPosted: Wed Oct 29, 2014 6:54 pm   Post subject: RE:Pygame for java

I see.

I only ask because I've been working on a graphics /GUI library that runs more like a Processing program, and the graphics are all rendered with Swing, but I wonder if I should figure out a way to switch it to something else. It seems to work fine, but if it isn't that great and I want it to be a multipurpose tool (games and applications), maybe I should render the graphics in something more efficient.

I don't use Swing for any of its GUI tools, I just use it to create a canvas and draw images and graphics.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: