Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  A few Questions and One Swing Problem  (Read 1029 times)
0 Members and 2 Guests are viewing this topic.
Offline Neddy

JGO n00b
*

Posts: 7


Java games rock!....Big Time?


« on: 2003-11-30 02:59:09 »

Hey,

Im about to start a new project where im going to be creating a side view 2D shooter game, that is multiplayer, same concept as Soldat if you have played it. So i just had a few questions;

1. What would be the best 2D API to use? and what degree of hardness is the one you suggest to use?

2. Does anyone know where i can find any information on how to create a level editor for something like this, where the levels will be able to be customized on a pixel by pixel basis.

And finally, One problem. Im creating a language selector in swing, and the language appear in a drop down combo box. I have a JLabel above this, with these two components in a Box layout arranged vertically. The problem is that when i add in the Combo box, the Jlabel gets indented a certain amount relative to the left hand end of the combo box, and  if i move the combo box  to try to align it up with the Jlabel, the Jlabel moves accordingly to keep at the same point relative to the Combo Box.  Does anyone know whay this is happening and how i can stop it, and let me just put it where i want.

Thanx alot.
Offline kevglass
« League of Dukes »

JGO Kernel
*****

Posts: 5214
Medals: 49


Mentally unstable, best avoided.


« Reply #1 on: 2003-11-30 03:06:37 »

If you just want to place swing components by pixel and don't want to worry about layouts, use:

1  
2  
3  
4  
myPanel.setLayout(null);

myLabel.setBounds(10,10,100,25);
muPanel.add(myLabel);


Most people refer to this as null layout manager.

---

If you're going to do something like Soldat, first off you might want to check the projects on games.dev.java.net since I think there is already a Soldat clone underway. That aside, its a fairly fast action and effects packed game so raw Java2D is out. At the moment you'll find it difficult to get the performance you'll want from Java2D accelerated mode (due to some restrictions with alpha blending).

You might want to consider writing a sprite engine with either LWJGL or JOGL. There are a couple floating around but its not very difficult to do and there have been a few examples posted. Not to advertise too much you could always check out J2DA (in my signature) which is basically a 2D sprite engine over JOGL.

---

A map based on a pixel by pixel destruction! Smiley The best editor I can think of would be Paint Shop Pro Smiley Since you're doing pixel by pixel design, the easiest thing is just paint the level.

---

HTH

Kev

Offline swpalmer

JGO Kernel
*****

Posts: 3438
Medals: 4


Where's the Kaboom?


« Reply #2 on: 2003-11-30 16:01:58 »

If you are going to avoid using a layout manager (not generally recommended) be careful to allow for the different sizes that components might have on different platforms.  If you force a specific look and feel you can avoid some of those issues.
In a game where you are going to control the look nearly 100% by overriding the paint method for buttons for instance, then it matters less.

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.087 seconds with 19 queries.