Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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 1504 times)
0 Members and 1 Guest are viewing this topic.
Offline Neddy

Junior Newbie




Java games rock!....Big Time?


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

« JGO Spiffy Duke »


Medals: 195
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


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


Exp: 12 years


Where's the Kaboom?


« Reply #2 - Posted 2003-11-30 21: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.

 

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

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (28 views)
2014-11-22 12:13:56

xFryIx (70 views)
2014-11-13 12:34:49

digdugdiggy (49 views)
2014-11-12 21:11:50

digdugdiggy (43 views)
2014-11-12 21:10:15

digdugdiggy (37 views)
2014-11-12 21:09:33

kovacsa (61 views)
2014-11-07 19:57:14

TehJavaDev (65 views)
2014-11-03 22:04:50

BurntPizza (63 views)
2014-11-03 18:54:52

moogie (79 views)
2014-11-03 06:22:04

CopyableCougar4 (78 views)
2014-11-01 23:36:41
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!