Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  
  To swing or not to swing??  (Read 1147 times)
0 Members and 1 Guest are viewing this topic.
Offline elwiz

Senior Newbie




Bom-Shackalack, Jatack!


« Posted 2006-02-05 06:57:22 »

Hi all!

I've laid the foundation for my simple Board/strategy game and was going to build some simple frames for the board, dices and news. But then, I read somewhere that one should not use swing for this?
I don't know why - so I have to ask my fellow gamemakers about their opinions?

 Huh
Offline Ask_Hjorth_Larsen

Junior Duke




Java games rock!


« Reply #1 - Posted 2006-02-05 15:36:47 »

If you're writing a complex fast-paced first person shooter with lots of graphical stuff and high frame-per-second requirement then you should consider something else than swing. Swing is well suited for turn-based stuff. It sounds like Swing would be fine for your purposes.
Offline noblemaster

JGO Ninja


Medals: 20
Projects: 10


Age of Conquest makes your day!


« Reply #2 - Posted 2006-02-07 21:08:23 »

I agree with Ask_Hjorth_larsen. Swing is perfectly fine for turn based/board games. I used it 100% for my game and didn't have any performance issues. The cool thing with swing is, you can define your own look and feel, which makes coding much faster!!!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2006-02-08 01:36:08 »

The *only* issue for swing for these kidsn of games, is that if you want to graduate evetually to action games you will have to relearn how to write code.

If that isnt your goal though then yeah Swing is fine.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #4 - Posted 2006-02-08 02:59:24 »

The *only* issue for swing for these kidsn of games, is that if you want to graduate evetually to action games you will have to relearn how to write code.

I'm not sure that's 100% correct. Java uses the same Java2D system for Swing and games, so the experience can transfer. For example, if you're doing chess it makes sense to create a custom chessboard component rather than try to line up 64 labels on the screen. Especially since the labels are bound to interfere with the placement of pieces on the chessboard. In  writing that component, you're forced to work with the Java2D APIs to get the results you need. Ergo, experience that can translate.

Same with events. You need to learn how to handle mouse and keyboard events so that you can properly handle piece dragging and quick shortcuts. Again, more experience.

When the time comes, all you really need to do is learn the full screen and BufferStrategy APIs. From there, the rest is a cakewalk. (With a few gotchas scattered along the way.) Beats the heck out of the MemoryImageSource nonsense that we used to do. Smiley

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Jeff

JGO Coder




Got any cats?


« Reply #5 - Posted 2006-02-09 09:48:40 »

The *only* issue for swing for these kidsn of games, is that if you want to graduate evetually to action games you will have to relearn how to write code.

I'm not sure that's 100% correct. Java uses the same Java2D system for Swing and games, so the experience can transfer.

True but unline Swing you wont be doing it on repaints, you will be doign it in a game loop.

Quote
Same with events. You need to learn how to handle mouse and keyboard events so that you can properly handle piece dragging and quick shortcuts. Again, more experience.

Unless you do it the way most games do and just poll the mouse in the game loop and do all the behavior yourself.  This is typical.  Triying to mix AWT events with a game loop is much less so.  I knwo some pople with rpevious Swing experience go this route but it seems to add all kidsn of needless compelxity.

Quote
When the time comes, all you really need to do is learn the full screen and BufferStrategy APIs. From there, the rest is a cakewalk.\

I really really really disagree.   A fast action game is near real-time type codin g. This is **totally** different from event driven programming and programmers who have learned to program event driven IME need to amjorly rework their neurons to get it.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #6 - Posted 2006-02-09 11:45:27 »

I agree with Jeff. It's a completely different paradigm. It's like the difference between OOP design and old fashioned BASIC.

Cas Smiley

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.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (29 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (56 views)
2014-10-14 00:35:47

TehJavaDev (47 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
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!