Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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  
  A few Questions and One Swing Problem  (Read 1207 times)
0 Members and 1 Guest are viewing this topic.
Offline Neddy

Junior Newbie




Java games rock!....Big Time?


« Posted 2003-11-30 08: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


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #1 - Posted 2003-11-30 09: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 Coder




Where's the Kaboom?


« Reply #2 - Posted 2003-11-30 22: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]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (77 views)
2013-05-17 21:29:12

alaslipknot (89 views)
2013-05-16 21:24:48

gouessej (119 views)
2013-05-16 00:53:38

gouessej (113 views)
2013-05-16 00:17:58

theagentd (126 views)
2013-05-15 15:01:13

theagentd (113 views)
2013-05-15 15:00:54

StreetDoggy (156 views)
2013-05-14 15:56:26

kutucuk (179 views)
2013-05-12 17:10:36

kutucuk (179 views)
2013-05-12 15:36:09

UnluckyDevil (186 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.058 seconds with 20 queries.